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....

all the approaches mentioned in this paper need an operation that can't be implemented in the jvm
so, I think the best approach might just be to treat it as a register machine (using locals) then apply peephole optimization to remove redundant store/load pairs

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

Sign in to participate in the conversation

personal server for leo60228 (