Add An Optimizer

Tiger in Stratego -- Compilation by Program Transformation
After finishing the basic TigerCompiler, extend it with at least one optimization component. Which optimization in which stage of compilation you implement is up to you. Here are some ideas, but other optimizations are also possible

Transformations on Tiger Abstract Syntax

The TigerOptimize component can be filled with many kinds of optimizations.

  • Constant and copy propagation (requires canonicalization)
  • Dead code elimination
  • Allocate non-escaping records and arrays on the stack
  • Make static links explicit (LambdaLifting?)
  • Partial evaluation / specialization
  • Make memory explicit (introduce MEM operator in Tiger)

Improvements of TAS2IR

  • Improve stack allocation of escaping variables and spilled local variables (overlap variables that are not live at the same time)
  • TailCallElimination

Transformations on Intermediate Representation

  • Target different platforms (e.g. Intel)
  • Constant and copy propagation
  • Dead code elimination

Transformations on ASM Code

  • Improve spilling heuristics in the register allocator

Extensions of the Run Time System

  • Garbage collection


  • Parallel execution

-- EelcoVisser - 04 Dec 2001