next up previous
Next: Global Copy Propagation and Dead Up: Compiler Theory: Code Optimization Previous: Data-flow analysis: available expressions.

Global Live Variable Analysis

We return to the analysis of live varaibles. Our earlier analysis and optimization were restricted to a basic block, We recall the following definition.


A VARIABLE IS LIVE AT A POINT P of the program if it is referenced further in the program (which can decided by considering the control flow graph) otherwise it is said to be dead.


DATA-FLOW SETS. We assume that the control flow graph is reducible. For a basic block B

The safety principle requires that we should assume that variables remain live if there is any doubt.


COMPUTING THE DATA-FLOW SETS. Note that the information to be computed is opposite to the flow of control

The following iterative algorithm propagates liveness information backwards around the control flow graph.


next up previous
Next: Global Copy Propagation and Dead Up: Compiler Theory: Code Optimization Previous: Data-flow analysis: available expressions.
Marc Moreno Maza
2004-12-02