Local, Global & Inter-Procedural Optimization:

In case of local optimization straight line codes with in basic block are optimized. The basic block consists of only assignment statements with no jumps or loops. Some of the optimization techniques that can be used for local optimization are constant folding, constant propagations and algebraic transformations.

Optimization considering many basic blocks of single procedure is called global optimization. They use optimization techniques like code motion, elimination of induction variables and reduction in strength of expression. Global optimization requires data flow analysis to detect jump boundaries before optimization.


Inter-procedural optimization deals with optimization of entire program as a whole. This is very difficult to achieve as it has to take care of different parameters passing mechanization and non local variable access. The advantage of inter procedural optimization is that each procedure can be optimized independently and linked together at the end with the help of linker which performs optimization later on.

0 comments