Optimizing Nested Loops Using Local CPS Conversion

  • Authors:
  • John Reppy

  • Affiliations:
  • Bell Labs, Lucent Technologies, 600 Mountain Avenue, Murray Hill, NJ 07901, USA. jhr@cs.uchicago.edu

  • Venue:
  • Higher-Order and Symbolic Computation
  • Year:
  • 2002

Quantified Score

Hi-index 0.01

Visualization

Abstract

Local CPS conversion is a compiler transformation for improving the code generated for nested loops by a direct-style compiler that uses recursive functions to represent loops. The transformation selectively applies CPS conversion at non-tail call sites, which allows the compiler to use a single machine procedure and stack frame for both the caller and callee. In this paper, we describe LCPS conversion, as well as a supporting analysis. We have implemented Local CPS conversion in the MOBY compiler and describe our implementation. In addition to improving the performance of loops, Local CPS conversion is also used to aid the optimization of non-local control flow by the MOBY compiler. We present results from preliminary experiments with our compiler that show significant reductions in loop overhead as a result of Local CPS conversion.