31-10-2012, 04:32 PM
Code Optimization[/size]
Code Optimization.ppt (Size: 63 KB / Downloads: 26)
Levels
Window – peephole optimization
Basic block
Procedural – global (control flow graph)
Program level – intra procedural (program dependence graph)
Peephole Optimizations
Local in nature
Pattern driven
Limited by the size of the window
Basic Block Level
Common Sub expression elimination
Value Numbering
Constant Propagation
Copy Propagation
Dead code elimination
…
Definitions
point - any location between adjacent statements and before and after a basic block.
A path in a CFG from point p1 to pn I
s a sequence of points such that j, 1 <= j < n, either pi is the point immediately preceding a statement and pi+1 is the point immediately following that statement in the same block, or pi is the end of some block and pi+1 is the start of a successor block.