Question 71
What is 'Peephole Optimization'?
Peephole optimization inspects a short sequence of target instructions (peephole) to eliminate redundant loads/stores, algebraic identities, and unreachable code.
What is 'Peephole Optimization'?
Peephole optimization inspects a short sequence of target instructions (peephole) to eliminate redundant loads/stores, algebraic identities, and unreachable code.
Which of the following transformations can be applied during Peephole Optimization?
Peephole optimization handles small-window local cleanups such as removing 'MOV R0, A' followed immediately by 'MOV A, R0', and replacing $x = x \cdot 0$ with $x = 0$.
What does 'Copy Propagation' do?
Copy propagation uses assignments of the form 'x = y' to substitute 'y' for 'x' in subsequent expressions, often turning 'x' into dead code.
In a basic block, if statement (1) 't1 = a + b' is followed by statement (2) 't2 = a + b', replacing (2) with 't2 = t1' is an example of:
Detecting duplicate computation 'a + b' within a single basic block and reusing the previously computed value 't1' is Local Common Subexpression Elimination.
What is the 'Loop Pre-Header' in loop optimizations?
A loop pre-header is inserted as a single predecessor to the loop header to host loop-invariant statements moved out of the loop body.