next up previous contents
Next: Loop-invariant Code Motion Up: Optimizations Previous: Unreachable Code Elimination

Global Constant Propagation

To perform global constant propagation, I make use of an iterative data flow solver. I use the data flow solver to solve reaching definitions problem. The basic blocks are traversed in reverse PostOrder so that the solution converges quickly. The underlying assumption is that the control flow graph is not irreducible, or else the data flow solver might not even converge. If all the reaching definitions of a given exposed use have the same constant value, and there is no other path to this use (detected by using a variation of the dominance property), then the constant value is propagated to this use.



Suman Banerjee
Tue Jun 16 14:38:56 EDT 1998