Lambda the Ultimate SSA: Optimizing Functional Programs in SSA
Siddharth Bhat, Tobias Grosser

TL;DR
This paper introduces a novel SSA extension called regions to better optimize functional programs, enabling classical SSA reasoning for higher-order constructs and demonstrating its effectiveness in the LEAN4 theorem prover.
Contribution
We extend classical SSA to include regions, allowing systematic optimization of functional programs within an SSA framework, and implement a feature-complete backend for LEAN4.
Findings
Region optimizations achieve performance parity with existing LEAN4 backend.
The SSA+regions framework effectively models functional sub-expressions.
Our approach unifies optimization techniques for functional and imperative languages.
Abstract
Static Single Assignment (SSA) is the workhorse of modern optimizing compilers for imperative programming languages. However, functional languages have been slow to adopt SSA and prefer to use intermediate representations based on minimal lambda calculi due to SSA's inability to express higher order constructs. We exploit a new SSA construct -- regions -- in order to express functional optimizations via classical SSA based reasoning. Region optimization currently relies on ad-hoc analyses and transformations on imperative programs. These ad-hoc transformations are sufficient for imperative languages as regions are used in a limited fashion. In contrast, we use regions pervasively to model sub-expressions in our functional IR. This motivates us to systematize region optimizations. We extend classical SSA reasoning to regions for functional-style analyses and transformations. We implement…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Formal Methods in Verification · Parallel Computing and Optimization Techniques
