Type Systems for Optimizing Stack-based Code

  • Authors:
  • Ando Saabas;Tarmo Uustalu

  • Affiliations:
  • Institute of Cybernetics, Tallinn University of Technology, Akadeemia tee 21, EE-12618 Tallinn, Estonia;Institute of Cybernetics, Tallinn University of Technology, Akadeemia tee 21, EE-12618 Tallinn, Estonia

  • Venue:
  • Electronic Notes in Theoretical Computer Science (ENTCS)
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

We give a uniform type-systematic account of a number of optimizations and the underlying analyses for a bytecode-like stack-based low-level language, including analysis soundness proofs and strongest analysis (principal type inference) algorithms. Specifically, we treat dead store instructions, load-pop pairs, duplicating load instructions, store-load pairs. The load-pop pairs and store-load pairs elimination optimizations are built on top of bidirectional analyses, facilitating correct elimination of instruction pairs spanning across basic block boundaries. As a result, no assumptions are needed about input code (it need not be the compiled form of a high-level source program, the stack need not be empty at basic block boundaries and not even need it be checked for safety before the analysis). The soundness proofs and strongest analysis algorithms are simple and uniform.