Peephole optimisation

Jeff Siegal jbs at fenchurch.mit.edu
Tue Feb 28 05:16:20 AEST 1989


>cik at l.cc.purdue.edu (Herman Rubin) writes:
>
>   [...]And how big is the peephole?

Every study I've seen claims that three instructions is very nearly
always sufficient.  The exception being very complex instructions
which might be recognized as a substitution for a long sequence of
simple instructions.  In reality, the long sequence of simple
instructions is very unlikely to *exactly* match the complex
instruction anyway, so the very long peephole would almost never be of
value.

For RISC machines, this is not likely to be an issue, and three
instructions would (probably) suffice.

Multiple passes can often be used to get the same effect as a longer
peephole (by using intermediate transformations).

Jeff Siegal



More information about the Comp.lang.c mailing list