# Algorithm to find Dominance Frontiers

The algorithm that is used by gcc and llvm is that of Keith D. Cooper, Timothy J. Harvey, and Ken Kennedy (page 9). We start with the immediate dominators of each control-flow graph node B already calculated and stored in idom[B]:

for each B in all basic blocks
if size of Predecessors(B) >= 2
for each P in Predecessors(B)
runner = P
while runner != idom[B]    # idom is the immediate dominator
DF(runner) += B
runner = idom[runner]


My question is about the Predecessors set. Do they refer to the direct predecessors ("fathers") of B or to all of them that lead to B?

Predecessors(B) is just the set of direct predecessors of B. The "fathers", not the more distant ancestors.