I’m writing an optimizer for a language similar to JavaScript, and need to choose an intermediate code representation. The obvious/typical choice these days is Static Single Assignment (SSA).
However, Modern Compiler Implementation in C also discusses functional intermediate form, which basically means going pure functional for the intermediate representation (pure in terms only of local variables, heap data is still mutable, and not CPS, just straightforward let
blocks and tail calls) and has some advantages in terms of being easier to reason about.
Presumably it’s not a no-brainer or everyone would already be using such a representation, so my question is, what disadvantages does functional intermediate form have compared to SSA?
3
SSA is great for dead code elimination, constant propagation, partial specialisation and such. If this kind of stuff is not on your menu, you can skip SSA and use a more relaxed representation for simpler analysis passes