-
Notifications
You must be signed in to change notification settings - Fork 237
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
[SSA] Ensure phi args are only added when defined. #118
base: main
Are you sure you want to change the base?
Conversation
Isn't your I believe the problem you're trying to solve:
Is caused by a bug in the |
I'm not saying I'm correct in any way, but can you explain what you mean by "over-estimate of defined variables"? I'm not sure I'm following. And yep! That's what I was attempting to fix. |
Consider the variable
I think a better name for the analysis is |
Huh, yeah good point. It produces the same SSA as your PR, but |
Address latter part of #108.
Originally, variables were added to
phi
that were undefined along the path. This resulted inid
ing a non-existent variable during thefrom_ssa
phase.I was trying to force the use of reaching definitions, but this shouldn't be necessary. All we care about here is that for each
p
, it was defined along some path of predecessors beforehand. Otherwise, it is, well, undefined.Example
Outputs
We can then leave SSA form:
Next Step(s)
After the submission of this PR:
Remove instances of
var: <type> = id __undefined
. It works in most simple cases to just not append arguments that undefined tophi
, but leads to undefined variables when leaving SSA form on some of the benchmarks, probably from propagating.Tests for
from_ssa
.