Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dpdk Backend: Move Mux handling after simplifying select expression #3464

Merged
merged 2 commits into from
Aug 1, 2022

Conversation

usha1830
Copy link
Contributor

Comparison operations on RHS of assignment are translated into Mux expressions. Mux expressions are further simplified into if-else statement by the dpdk backend
Mux expression handling in backend works on Assignment statement assuming the Mux expressions are simplified into RHS of Assignment statements.

When statements like below are present in parser state, copy propagation moves the assignment statement inside Select expression which is not simplified when control reaches Mux handling.

bool var = a == b;
select(var)

Moving DismantleMuxExpressions after RemoveComplexExpressions (which simplifies Select Expressions) solves this issue.

@mihaibudiu
Copy link
Contributor

I don't understand why the MacOS build error happened.

@mihaibudiu mihaibudiu merged commit 9ef80c0 into p4lang:main Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants