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

More tests and a fix for SSA conversion (from #119) #134

Merged
merged 6 commits into from
Aug 23, 2021
Merged

Conversation

sampsyo
Copy link
Owner

@sampsyo sampsyo commented Aug 23, 2021

This pulls out a few pieces of #119 without doing the "big change" to fix undefined values in SSA conversion:

  • Add some ssa_roundtrip tests that convert to SSA, back out of SSA, and then interprets the result to ensure that they don't crash.
  • Fix a problem in to_ssa.py with some CFGs where the recursive calls wouldn't property clear the stack names. (I used a simpler fix than the one in [SSA] Fix up to_ssa.py and add test cases #119.)

This doesn't fix the big outstanding issue in #108, but it preserves some test (suffixed .BROKEN) that demonstrate the problem.

This is similar to the functional stack passing fix in #119 but has a
smaller fix (just clobber the stacks altogether before restoring the old
values; previously we just overwrote the new variables).
The current state of the SSA examples can leave references to an
intentionally undefined variable (`__undefined`) in situations where it
thinks the value will never be used. So we allow ourselves to run
trivial DCE to clean up these assignments before attempting to run the
code.
Will discuss current status in #108.
@sampsyo sampsyo merged commit 6f7371e into main Aug 23, 2021
@sampsyo sampsyo deleted the ssa-tweaks branch August 23, 2021 21:51
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.

1 participant