Peephole Optimization
Peephole Optimization
UIT-RGPV
By:
Mr. Praveen Yadav
Assistant Professor
DoCSE, UIT-RGPV
Bhopal
Peephole Optimization
• A simple but effective technique for locally improving the target
code is peephole optimization.
• Peephole optimization is done by examining a sliding window of
target instructions (called the peephole) and replacing
instruction sequences within the peephole by a shorter or faster
sequence, whenever possible.
• Peephole optimization can also be applied directly after
intermediate code generation to improve the intermediate
representation.