Local CPS conversion in a direct-style compiler

John H. Reppy · 2001

Local CPS conversion is a compiler transformation for improving the code generated for nested loops by a direct-style compiler. The transformation consists of a combination of CPS conversion and light-weight closure conversion, which allows the compiler to merge the environments of nested recursive functions. This merging, in turn, allows the backend to use a single machine-level procedure to implement the nested loops. Preliminary experiments with the Moby compiler show the potential for significant reductions in loop overhead as a result of Local CPS conversion. 1 Introduction Most compilers for functional languages use a -calculus based intermediate representation (IR) for their optimization phases. The - calculus is a good match for this purpose because, on the one hand, it models surface-language features like higher-order functions and lexical scoping, while, on the other hand, it can be transformed into a form that is quite close to the machine model. To make analysis and opt...

Read the paper · More papers on PaperTik