• Home
  • Search
  • Lambda the Ultimate SSA: Optimizing Functional Programs in SSA
  • Open Access IconOpen Access
  • Cite Icon3
  • https://doi.org/10.1109/cgo53902.2022.9741279Copy DOI Icon

Lambda the Ultimate SSA: Optimizing Functional Programs in SSA

  • Apr 2, 2022
  • Siddharth Bhat +1 more
Show More
  • Abstract
  • Literature Map
  • References
  • Citations
  • Similar Papers
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 a new SSA + regions based backend for LEAN4, a theorem prover that implements a purely functional, dependently typed programming language. Our backend is feature-complete and handles all constructs of LEAN4’s functional intermediate representation $\lambda _{\mathbf{rc}}$ within the SSA framework. We evaluate our proposed region optimizations by optimizing $\lambda_{\mathbf{rc}}$ within an SSA + regions based framework implemented in MLIR and demonstrating performance parity with the current LEAN4 backend. We believe our work will pave the way for a unified optimization framework capable of representing, analyzing, and optimizing both functional and imperative languages.

Similar Papers
  • Conference Article
  • Citations1

Inferring types and effects via static single assignment

  • Mar 30, 2020
  • Leonardo Filipe Rigon +2
  • Book Chapter
  • Citations26

Extended SSA mumbering: Introducing SSA properties to languages with multi-level pointers

  • Jan 01, 1998
  • Christopher Lapkowski +1
  • Conference Article
  • Citations13

Verified construction of static single assignment form

  • Mar 17, 2016
  • Sebastian Buchwald +2
  • Research Article
  • Citations3

Structural Encoding of Static Single Assignment Form

  • Nov 25, 2005
  • Electronic Notes in Theoretical Computer Science
  • Andreas Gal +2
  • Conference Article

A hybrid intermediate language between SSA and CPS

  • Sep 21, 2017
  • Paulo Torrens +2
  • Book Chapter
  • Citations7

An ASM Semantics for SSA Intermediate Representations

  • Jan 01, 2004
  • Sabine Glesner
  • Conference Article

An approach for pointer optimization using SSA based intermediate representation

  • Jun 01, 2011
  • Deodatta Barhate +1
  • Book Chapter
  • Citations24

A Formally Verified SSA-Based Middle-End

  • Jan 01, 2012
  • Gilles Barthe +2
  • Conference Article
  • Citations18

Formal verification of dead code elimination in Isabelle/HOL

  • Jan 01, 2005
  • J.O Blech +2
  • Research Article
  • Citations1

Functional Elimination of Φ-instructions

  • Jul 01, 2007
  • Electronic Notes in Theoretical Computer Science
  • Lennart Beringer
  • Research Article
  • Citations38

A Functional Perspective on SSA Optimisation Algorithms

  • Apr 01, 2004
  • Electronic Notes in Theoretical Computer Science
  • Manuel M.T Chakravarty +2
  • Conference Article
  • Citations1

Domain-specific languages with custom operators

  • Jan 01, 2015
  • Áron Baráth +1
  • Conference Article
  • Citations10

Investigating the Performance of Language Models for Completing Code in Functional Programming Languages: a Haskell Case Study

  • Apr 14, 2024
  • Tim Van Dam +5
  • Conference Article
  • Citations13

QSSA: an SSA-based IR for Quantum computing

  • Mar 18, 2022
  • Anurudh Peduri +2
  • Conference Article
  • Citations29

Extended SSA with factored use-def chains to support optimization and parallelism

  • Jan 01, 1994
  • Stoltz +2
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.