Loop-Invariant Computations and Code Motion

Induction Variable Detection and Elimination

Strength Reduction

Loop Unrolling

Loop Jamming (Fusion)

Counting up to Zero

Unswitching

Loop Collapse

10.2.8 Loop Collapse

Sometimes, as the result of other optimizations, the body of a loop becomes vacuous. It may then be removed:

    LOOP
     ENDLOOP              Null