Principle Sources of Optimization
Principle Sources of Optimization
UIT-RGPV
By:
Mr. Praveen Yadav
Assistant Professor
DoCSE, UIT-RGPV
Bhopal
Principle Sources of Optimization
• Local Optimization: Transformations performed on a basic block (i.e
local transformation).
• Global Optimization: Transformation performed on more/all basic
blocks as a whole without changing their function. Flow of control
analysis and Data flow analysis are used for global optimization.
• We distinguish local transformations, from global transformations.
• A basic block computes a set of expressions: A number of
transformations can be applied to a basic block without changing
the expressions computed by the block.
• Following optimization techniques can be performed at local and
global level.
1. Function Preserving Transformations (Structure Preserving)
2. Loop Optimization
Compiler Design By Asst. Prof. Praveen Yadav, DoCSE, UIT-RGPV 2
Function Preserving Transformations
• There are number of ways in which a compiler can improve a
program without changing the function it computes.
• Some common function preserving transformations are:
1. Common Sub-expressions elimination.
2. Copy Propagation (Variable Propagation).
3. Dead-Code elimination.
4. Constant Folding and Constant Propagation.