Dominance Frontiers
The other part of dominance that plays an important part in the ssa construction is the calculation of
dominance frontiers for each node in the cfg. Cytron et al. define the dominance frontier of a node, b, as:
. . . the set of all cfg nodes, y, such that b dominates a predecessor of y but does not strictly
dominate y [13].
Dominance frontiers have applications to algorithms other than ssa, as well. For example, finding postdominance
frontiers is an efficient method of computing control dependence, a critical analysis for automatic
parallelization [6].
Cytron et al. propose finding the dominance frontier set for each node in a two step manner. They begin
by walking over the dominator tree in a bottom-up traversal. At each node, b, they add to b’s dominancefrontier
set any cfg successors not dominated by b. They then traverse the dominance-frontier sets of b’s
dominator-tree children – each member of these frontiers that is not dominated by b is copied into b’s
dominance frontier.
We approach the problem from the opposite direction, based on three observations. First, nodes in a
dominance frontier represent join points in the graph, nodes into which control flows from multiple predecessors.
Second, the predecessors of any join point, j, must have j in their respective dominance-frontier sets,
unless the predecessor dominates j. This is a direct result of the definition of dominance frontiers, above.
Finally, the dominators of j’s predecessors must themselves have j in their dominance-frontier sets unless
they also dominate j.
8
for all nodes, b
if the number of predecessors of b ≥ 2
for all predecessors, p, of b
runner ← p
while runner 6= doms[b]
add b to runner’s dominance frontier set
runner = doms[runner]
Figure 5: The Dominance-Frontier Algorithm