mass
mass copied to clipboard
Only allow labels for explicit basic blocks
Right now arbitrary labels and jumps are allowed which makes it really difficult to come up with a simple, correct register allocation solution that is also single pass. If the jumps are only allowed to basic block boundaries (start, end) it should be relatively easy to build up the graph as the program is compiled and do a decent allocation setup. This setup would be similar, but not identical to WebAssembly.
Unlike WebAssembly, arbitrary jumps should still be allowed, but with those all bets are off and it is the programmers responsibility to save and restore registers.