Lib.Dominators module
Utility functions to work with dominators in a CFG
.
Do not hesitate to look at the source of the functions to get a better understanding of the algorithms.
- Lib.Dominators.computeDom(cfg: CFG) Dict[Block, Set[Block]] [source]
computeDom(cfg) computes the table associating blocks to their dominators in cfg. It works by solving the equation system.
This is an helper function called during SSA entry.
- Lib.Dominators.printDT(filename: str, graph: Dict[Block, Set[Block]]) None [source]
Display a graphical rendering of the given domination tree.
- Lib.Dominators.computeDT(cfg: CFG, dominators: Dict[Block, Set[Block]], dom_graphs: bool, basename: str) Dict[Block, Set[Block]] [source]
computeDT(cfg, dominators) computes the domination tree of cfg using the previously computed dominators. It returns DT, a dictionary which associates a block with its children in the dominator tree.
This is an helper function called during SSA entry.
- Lib.Dominators.computeDF(cfg: CFG, dominators: Dict[Block, Set[Block]], DT: Dict[Block, Set[Block]], dom_graphs: bool, basename: str) Dict[Block, Set[Block]] [source]
computeDF(…) computes the dominance frontier of a CFG. It returns DF which associates a block to its frontier.
This is an helper function called during SSA entry.