Reaching definition

In compiler theory, a reaching definition for a given instruction is an earlier instruction whose target variable can reach (be assigned to) the given one without an intervening assignment.

The similarly named reaching definitions is a data-flow analysis which statically determines which definitions may reach a given point in the code.

Because of its simplicity, it is often used as the canonical example of a data-flow analysis in textbooks.

The data-flow confluence operator used is set union, and the analysis is forward flow.

Reaching definitions are used to compute use-def chains.

is the set of all definitions that assign to the variable

is a unique label attached to the assigning instruction; thus, the domain of values in reaching definitions are these instruction labels.

Reaching definition is usually calculated using an iterative worklist algorithm.

Input: control-flow graph CFG = (Nodes, Edges, Entry, Exit)