next up previous
Next: Induction Variables Up: Compiler Theory: Code Optimization Previous: Global Recycling of Available Expressions

Invariant Code Motion

THE GENERAL METHOD can be described as follows.
  1. A statement a : = b op c in block B of a loop is marked as invariant if all definitions of b and c that are in inR(B) are outside the loop, or are invariant statements in the loop. Observe that
  2. Repeat previous step until no more invariant statements are found.


REMARKS.


next up previous
Next: Induction Variables Up: Compiler Theory: Code Optimization Previous: Global Recycling of Available Expressions
Marc Moreno Maza
2004-12-02