Subtopic 3 of 3
10.3Peephole optimisation
Slide a small window over the target code and replace patterns: redundant load/store, jumps to jumps, unreachable code, algebraic identities, strength reduction.
MOV a, R0store R0 into aMOV R0, aREDUNDANT: R0 already equals a, delete
Valid only if the second instruction is not a jump target.
Previous year questions: Code Generation & Register Allocation (3)
PYQs are grouped by topic, so this is the full set for Code Generation & Register Allocation; try the ones that match this subtopic. Open all 3 on the topic page.