Peephole optimization is an optimization technique performed on a small set of compiler-generated instructions; the small set is known as the peephole or window.[1]
Peephole optimization involves changing the small set of instructions to an equivalent set that has better performance.
For example:
instead of pushing register A onto the stack and then immediately popping the value back into register A, a peephole optimization would remove both instructions;
instead of multiplying x by 2, it is likely faster to do x + x.
instead of multiplying a floating point register by 8, a peephole optimization might add 3 to the floating point register's exponent; and
instead of multiplying an index by 4, adding the result to a base address to get a pointer value, and then dereferencing the pointer, a peephole optimization might use a hardware addressing mode that accomplishes the same result with one instruction.
The term peephole optimization was introduced by William Marshall McKeeman in 1965.[2]
^Cite error: The named reference Muchnick_1997 was invoked but never defined (see the help page).
^Cite error: The named reference McKeeman_1965 was invoked but never defined (see the help page).
and 19 Related for: Peephole optimization information
Peepholeoptimization is an optimization technique performed on a small set of compiler-generated instructions; the small set is known as the peephole...
used today in optimizing compilers (sometimes known as Kildall's method). Peepholeoptimization is a simple but effective optimization technique. It was...
optimizations could be performed. Because of these factors, optimization rarely produces "optimal" output in any sense, and in fact, an "optimization"...
slumps provides superoptimization for WASM programs based on souper. Peepholeoptimization Dead code elimination Metacompilation Massalin, Henry (1987). "Superoptimizer:...
An object code optimizer, sometimes also known as a post pass optimizer or, for small sections of code, peepholeoptimizer, forms part of a software compiler...
general-purpose global optimizer followed by machine-specific peepholeoptimization is a commonly used implementation technique. The optimization of code for some...
instructions in a later pass or the errata. In an assembler with peepholeoptimization, addresses may be recalculated between passes to allow replacing...
as temporaries) and may still be – and typically is – subject to peepholeoptimization. Otherwise, it closely resembles the target machine code, bytecode...
remove many types of unused and duplicated code, perform over 200 peepholeoptimizations, reduce variable allocation, inline constant and short methods,...
was first described in The Design and Application of a Retargetable PeepholeOptimizer. In GCC, RTL is generated from the GIMPLE representation, transformed...
forms, and no loop-wide or procedure-wide optimizations. XCOM does, however, perform peepholeoptimization. The code generation response to each grammar...
syntax tree include constant folding and context propagation, but peepholeoptimization is also performed. Perl has a Turing-complete grammar because parsing...
post-code generation-phase object code optimizer for the IBM COBOL compiler. The product acted in part as a peepholeoptimizer, replacing code sequences generated...
trade-off between the granularity of the optimizations and the cost of compilation. For example, peepholeoptimizations are fast to perform during compilation...
is followed by a peepholeoptimization pass that uses this intermediate format to analyze and optimize instructions. After optimization, final LAP code...
currently being developed by the XBLite team. This aims to give Peepholeoptimization technology to the XBLite project. The project has been distributed...
run-time. One such static binary translator uses universal superoptimizer peephole technology (developed by Sorav Bansal and Alex Aiken from Stanford University)...
the 3D felt more immersive: "Where the 3DS felt like peering through a peephole into another world, the XL is almost like stepping through a door." On...