The introduction of a "loop header" block facilitates the hoisting of loop-invariant code from a loop. In a λ-calculus intermediate representation, which has a notion of scope, this transformation is particularly useful. Loop headers with scope also solve a problem with in-line expansion of recursive functions or loops: if done naively, only the first iteration is inlined. A loop header can encapsulate the loop or recursion for better in-line expansion. This optimization improves performance by about 5% in Standard ML of New Jersey.
All Science Journal Classification (ASJC) codes
- Computer Science(all)
- continuation-passing style
- in-line expansion
- loop header