by larsberg · 12y ago · 0 comments
It sounds trivial, but in practice it dramatically reduces the size of not only optimization passes such as inlining, but it makes analyses that drive optimizations simpler as well (e.g., control-flow analysis). For an example from my experience (Manticore - http://manticore.cs.uchicago.edu/), my pretty coarse CFA analysis on our direct-style IR is about 750 lines of SML code whereas an optimized CFA with three different variants and extra support for environment analysis is only 700 lines of SML.
If you allow first-class continuations in user programs, though, all bets are off and CPS is more expressive.
Richard Kelsey wrote the paper that talks about how to convert between CPS and SSA forms, along with the first-class continuation limitation mentioned above:
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.3.67...
[1] http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.34.3...