Evaluating Optimizations for a High-Level Language

Leonardo Kaplan, Roberto Ierusalimschy · 2021

Pallene aims to be a system language counterpart for Lua, with similar syntax but ahead-of-time compilation. It also has optional typing and stricter semantics, allowing it to emit C code with unboxed values, which enable several optimizations in the C compiler. Assuming that, the current Pallene compiler does not implement most classic optimizations. However, the C compiler cannot perform all the expected optimizations due to the difference in the level of abstraction between Pallene and C. In this work, we studied several scenarios where the C compiler couldn’t perform those expected optimizations trying to understand why and implemented them in the Pallene compiler, which has higher-level understanding of the language. Among the implemented optimizations are function inlining and scalar replacement of aggregates, achieving results that bring evidence that higher level optimizations cannot be done in the lower level compiler.

Read the paper · More papers on PaperTik