4 ms·
1) Using one of the more efficient CPS transformations will help remove many stupid constructs that are harder to statically find later. 2) In our CPS-based in
by larsberg 14y ago
1) Using one of the more efficient CPS transformations will help remove many stupid constructs that are harder to statically find later.
2) In our CPS-based intermediate representation, we rely heavily on control flow analysis (CFA) to enable many classic compiler optimizations (inlining, untupling, unreachable code elimination, cases where only one member of a datatype is constructed/destructed, etc.).
CPS is a great transformation and makes for a wonderful IR, but you have to pay a decent static analysis cost before you will be able to perform many classic optimizations and get great performance. That said, we've done pretty well (http://manticore.cs.uchicago.edu http://manticore.cs.uchicago.edu ), but it's taken years of development. I'd also like to second cjfrisz's pointer to Appel's green book. It's a fabulous introduction to compiling in a CPS-style IR, though you'll find you still have a fairly large performance gap if you don't implement the CFA-based versions of them.