An SSA form could possibly help reduce number of registers needed?
I just had a discussion with someone where, in the same discussion:
- I mentioned that the format we're compiling into has an extremely limited set of registers
- I said that truth doesn't have a CFG or SSA "because optimization is currently a non-goal (compared to round-trippability)"
Shortly after the discussion it dawned on me that SSA could quite possibly help with allocating registers to named local variables (allowing a register to be reused even if a variable it was bound to is still in scope). It'd probably be a lot of work (and a lot for me to learn :sweat_smile:), but it in the end it could help make ANM scripts even nicer to write.
I should also note that the disassembler Binary Ninja also has SSA forms. So I guess they have use cases for decompilation as well? (anything useful for us?)
Anyways, getting a CFG is a big part of this, and is a requirement for many other techniques as well. I imagine that many of its possible use cases for truth will become apparent as I work on that.
actually, interupt[]s could be a really big problem for any attempt to build a CFG.