9.2 A few words about basic block successors, predecessors and dominators

Next: 10. Acknowledgments Up: 9. Compiler internals Previous: 9.1 The anatomy of Contents Index

# 9.2 A few words about basic block successors, predecessors and dominators

Successors are basic blocks that might execute after this basic block.
Predecessors are basic blocks that might execute before reaching this basic block.
Dominators are basic blocks that WILL execute before reaching this basic block.

[basic block 1]

if (something)

[basic block 2]

else

[basic block 3]

[basic block 4]

a) succList of [BB2] = [BB4], of [BB3] = [BB4], of [BB1] = [BB2,BB3]

b) predList of [BB2] = [BB1], of [BB3] = [BB1], of [BB4] = [BB2,BB3]

c) domVect of [BB4] = BB1 ... here we are not sure if BB2 or BB3 was executed but we are SURE that BB1 was executed.