← ⚙️ Code Generation & Register Allocation
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, R0 store R0 into a
  • MOV R0, a REDUNDANT: 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.