9.2 Reaching Definitions

Reaching definitions determine for each basic block B and each program variable x what statement of the program could be the last statement defining x along some path from the start node to B.

A statement defines x if it assigns a value to x, for example, an assignment or read of x, or a procedure call passed x (not by value) or a procedure call that can access x.

Formally, we say that a definition, def

reaches a point P in the program if there is some path from the start node to p along which def occurs and, subsequent to def, there are no other definitions of x. Figure 1 shows this pictorially.

Data Flow Equations

Transfer Equation for Reaching Definitions

The Iterative Method for Solving Data Flow Equations

Data Structures for Reaching Definitions

Application of Reaching Definitions

Send questions and comments to: Karen Lemone