Contents    Page-10    Prev    Next    Page+10    Index   

Local and Global Optimization

Local optimization is that which can be done correctly based on analysis of a small part of the program.
Examples:

Global optimization requires information about the whole program to be done correctly.

Example:


   I * 8           ==>       R1 = I * 8

   ...                       ...

   I * 8           ==>       R1
This is correct only if I is not redefined between the two points. Doing optimization correctly requires program analysis: a special-purpose proof that program P' produces the same output values as P.