Closed quisar closed 8 months ago
Reading #regAlloc code, I do not understand how this code handles loops.
yeah, regAlloc is really dumb. I'm kind of surprised it ever works
Yep, need a better dataflow analysis to fix this. It might be able to just split the code into basic blocks and analyze that graph, without going all the way to SSA.
I think we can solve this without using dataflow. Instead we can keep a tree of variable declaration related to blocks. I will try to see if I can make this work.
See https://github.com/quisar/desynced-tools/tree/variable_scope
This change doesn't pass the test. The issue is that the variable is used in the loop conditional and updated inside the loop. The generated assembly do not update the variable