www.delorie.com/gnu/docs/gcc/gccint_92.html   search  
 
Buy the book!


GNU Compiler Collection (GCC) Internals

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.17 Machine-Specific Peephole Optimizers

In addition to instruction patterns the `md' file may contain definitions of machine-specific peephole optimizations.

The combiner does not notice certain peephole optimizations when the data flow in the program does not suggest that it should try them. For example, sometimes two consecutive insns related in purpose can be combined even though the second one does not appear to use a register computed in the first one. A machine-specific peephole optimizer can detect such opportunities.

There are two forms of peephole definitions that may be used. The original define_peephole is run at assembly output time to match insns and substitute assembly text. Use of define_peephole is deprecated.

A newer define_peephole2 matches insns and substitutes new insns. The peephole2 pass is run after register allocation but before scheduling, which may result in much better code for targets that do scheduling.

9.17.1 RTL to Text Peephole Optimizers  
9.17.2 RTL to RTL Peephole Optimizers  


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003