Peephole optimization as a targeting and coupling tool

  • Authors:
  • V. H. Allan

  • Affiliations:
  • Department of Computer Science, Utah State University

  • Venue:
  • MICRO 22 Proceedings of the 22nd annual workshop on Microprogramming and microarchitecture
  • Year:
  • 1989

Quantified Score

Hi-index 0.00

Visualization

Abstract

The term peephole optimization is used to mean the pattern matching and conditional replacement performed on small sections of the intermediate form.The circular dependence between the code generation phases implies that local optimals are rarely global optimals. There are several reactions: (1) accept the local optimal, (2) develop intermediate goals whose achievement suggest global optimality, (3) retain the choices so that the decisions can be made later, (4) optimize the object code by replacing awkward or overly constrained segments of code with improved ones. Optimizing the object code has several advantages. First, code generation is greatly simplified. The code generator is allowed to forgo case analysis and utilize only a subset of the machine's instructions and addressing modes [BD88,DF84a,DF84b,DF87]. Second, a phase ordering problem often encountered in optimizations is reduced.