hm, i'm looking into compiling rust to jvm bytecode (why are you looking at me like that) and somewhat surprisingly converting from ssa form to java bytecode doesn't seem to at all be a solved problem? there's obviously a naive way that barely uses the operand stack, and i've found some papers that do that, but i'm not at all confident in hotspot handling that well....
dont have time to read it rn but this paper looks promising http://www.complang.tuwien.ac.at/anton/euroforth2006/papers/shannon.pdf
finally found a very directly relevant paper, they compared just removing redundant store/load pairs to a brute-force optimal solution and found that the difference was negligible https://link.springer.com/content/pdf/10.1007/BFb0026432.pdf
@bun i don't 100% understand what that's doing but it seems like while it's more efficient than the naive method it's still treating bytecode as a register machine instead of a hybrid stack/register machine which isn't the most efficient thing to do (but getting rid of all the redundant loads/stores in the naive approach is definitely a plus)
@bun bigger issue with the naive approach is that it uses a massive amount of locals and even if the jit is fine with it that could easily lead to stack overflows with the interpreter
personal server for leo60228 (@firstname.lastname@example.org)