I am trying to understand exactly the concept of a dependency graph. Suppose I have the following control flow graph (in DOT notation):
graph g { 1 -> 2; 2 -> 3; 3 -> 2; 2 -> 4; 1 -> 4 }
It has a unique entry node (1) and a unique output node (4), and a loop 2 → 3 → 2.
My question is: Does the control dependency graph for this CFG edge of the loop from 2 to itself?
Allen and Kennedy "Optimizing Compilers for Modern Architectures" have an algorithm that creates such an edge to the loop. However, the Mchnick Compilation and Compiler Implementation algorithm for control dependency does not create such an edge. In addition, I could not find examples in the literature where a CDG is drawn with such a loop edge. I am inclined to believe that such an edge does not exist, but, according to the formal definition of the control dependence and according to the Allen and Kennedy algorithm, it should!
If you can give me an example where there is such a loop in the CDG (preferably in a peer-reviewed article or any lectures by a professor, etc.), or if you can argue why the Allen and Kennedy algorithm should be incorrect, I would be glad discover.
source share