Optimal chain rule placement for instruction selection based on SSA graphs

  • Authors:
  • Stefan Schäfer;Bernhard Scholz

  • Affiliations:
  • University of Sydney, Sydney NSW;University of Sydney, Sydney NSW

  • Venue:
  • SCOPES '07 Proceedingsof the 10th international workshop on Software & compilers for embedded systems
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

Instruction selection is a compiler optimisation that translates the intermediate representation of a program into a lower intermediate representation or an assembler program. We use the SSA form as an intermediate representation for instruction selection. Patterns are used for translation and are expressed as production rules in a graph grammar. The instruction selector seeks for a syntax derivation with minimal costs optimising execution time, code size, or a combination of both. Production rules are either base rules which match nodes in the SSA graph or chain rules which convert results of operations. We present a new algorithm for placing chain rules in a control flow graph. This new algorithm places chain rules optimally for an arbitrary cost metric. Experiments with the MiBench and SPEC2000 benchmark suites show that our proposed algorithm is feasible and always yields better results than simple strategies currently in use. We reduce the costs for placing chain rules by 25% for the MiBench suite and by 11% for the SPEC2000 suite.