Control dependency generation is flawed
Created by: cargaji
Control dependencies are generated based on the structure of the program (the AST).
This does not scale when more instructions are added (i.e. unconditional jumps, switch
statements, exception handling). In the literature, control dependence is generated based on properties of the Control Flow Graph:
Postdominance: given a CFG, a node a
postdominates b
iff every path between b
and the "Exit" node of the CFG contains a
.
Successor: given a CFG with nodes (n1, n2...) and arcs (ni → nj), nb is a successor of na iff there exists an arc na → nb.
Control dependency: given a CFG, node a
is control dependent on another node b
iff b
postdominates some but not all of a
's successors.
This still doesn't represent the aforementioned dependencies in a proper way. To fix that, the CFG needs to be modified, creating non-executable edges that are used to compute postdominance and control dependencies.