Declarative peephole optimization using string pattern matching

  • Authors:
  • Diomidis Spinellis

  • Affiliations:
  • Department of Information & Communication Systems, University of the Aegean, GR-83200 Karlobasi, Greece

  • Venue:
  • ACM SIGPLAN Notices
  • Year:
  • 1999

Quantified Score

Hi-index 0.00

Visualization

Abstract

Peephole optimisation as a last step of a compilation sequence capitalises on significant opportunities for removing low level code slackness left over by the code generation process. We have designed a peephole optimiser that operates using a declarative specification of the optimisations to be performed. The optimiser's implementation is based on string pattern matching using regular expressions. We used this approach to prototype an optimiser to convert target machine instruction sequences containing conditional execution of instructions inside loop bodies into code that adaptively executes the optimum branch instructions according to the program's branch behaviour.