Flattening tuples in an SSA intermediate representation

  • Authors:
  • Lukasz Ziarek;Stephen Weeks;Suresh Jagannathan

  • Affiliations:
  • Department of Computer Science, Purdue University, West Lafayette, USA;Jane Street Capital, New York, USA;Department of Computer Science, Purdue University, West Lafayette, USA

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

Quantified Score

Hi-index 0.00

Visualization

Abstract

For functional programs, unboxing aggregate data structures such as tuples removes memory indirections and frees dead components of the decoupled structures. To explore the consequences of such optimizations in a whole-program compiler, this paper presents a tuple flattening transformation and a framework that allows the formal study and comparison of different flattening schemes.We present our transformation over functional SSA, a simply-typed, monomorphic language and show that the transformation is type-safe. The flattening algorithm defined by our transformation has been incorporated into MLton, a whole-program, optimizing compiler for SML. Experimental results indicate that aggressive tuple flattening can lead to substantial improvements in runtime performance, a reduction in code size, and a decrease in total allocation without a significant increase in compilation time.