-
Notifications
You must be signed in to change notification settings - Fork 445
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
InlineActions also seems to handle exit statements incorrectly #2382
Comments
It is more useful to have these in one place; if the fix is common to all of them we should have all these examples as regression tests. I would at least cross-link from the original issue to this one. |
Tagged as duplicate, but kept for the test case. |
What is expected output for this issue with a fixed p4c? Should the "exit;" just disappear from the output? |
For this particular program removing exit would preserve the semantics. |
Also, even if the bmv2 backend supports exit statement, it does make sense to me that exit statements inside actions are removed in a frontend pass such as SideEffectsOrdering. |
Some targets may support exit directly (as bmv2 does), and, on such targets, adding and testing a flag may introduce significant overhead. So we don't want to force removal of exits in the compiler frontend, as supporting such targets efficiently would become much harder. |
It's not clear that in the most general case we can take advantage of native exit implementations - exactly because we have no way to execute the copy-out code on exit. My plan is to use the native implementation only when copy-out is not needed, but eliminate the other instances of exit in software. |
Agree with @mbudiu-vmw. I did mention the SideEffectsOrdering pass which deals with copy-out and thus only for such cases exit should be removed. |
I have another instance where there are issues with exit, this time in
InlineActions
.is converted to
Should I collect all the examples of exit problems in one thread or keep filing individual issues?
inline_actions_exit.p4.txt
inline_actions_exit.stf.txt
The text was updated successfully, but these errors were encountered: