bril icon indicating copy to clipboard operation
bril copied to clipboard

[SSA] Swap problem test is not in SSA form

Open ethanuppal opened this issue 8 months ago • 3 comments
trafficstars

The test for the swap problem is not in SSA form. In particular, i is reassigned:

https://github.com/sampsyo/bril/blob/175580e85cb6e4f78e82cdc8c26bfacfb0ef6c22/examples/test/from_ssa/swap-problem.bril#L2

https://github.com/sampsyo/bril/blob/175580e85cb6e4f78e82cdc8c26bfacfb0ef6c22/examples/test/from_ssa/swap-problem.bril#L19

If this is not supposed to be in SSA form, I can close the issue. Otherwise, it's a pretty trivial fix.

ethanuppal avatar Mar 15 '25 17:03 ethanuppal

Similarly, the dead-set.bril is not in SSA either, and turning it into SSA seems to defeat the point of the test?

ethanuppal avatar Mar 15 '25 18:03 ethanuppal

Hi! Thanks for pointing this out.

  • For swap-problem.bril, yeah, it's not really critical for this to be in SSA form to demonstrate the problem, but I guess it would be nice. Any chance you would mind applying the trivial fix?
  • For dead-set.bril, I think it's a similar story: it's not really required for this to be fully in SSA form to test what it's trying to test (which are the semantics of get and set, in the context of any program). But for neatness, we could make it SSA by just removing the get altogether in that file? Would that make sense? I think it would still test what I was hoping to test (i.e., that set does not actually affect the "real" state of the x variable).

sampsyo avatar Mar 17 '25 15:03 sampsyo

I see. I assumed it wasn't critical; I just caught it because my out-of-SSA pass first assert!s that the program is indeed in SSA.

ethanuppal avatar Mar 17 '25 22:03 ethanuppal