@@ -63,36 +63,3 @@ class SemSsaReadPositionBlock extends SemSsaReadPosition {
6363
6464 SemExpr getAnExpr ( ) { result = this .getBlock ( ) .getAnExpr ( ) }
6565}
66-
67- /**
68- * Holds if `inp` is an input to `phi` along a back edge.
69- */
70- predicate semBackEdge ( SemSsaPhiNode phi , SemSsaVariable inp , SemSsaReadPositionPhiInputEdge edge ) {
71- edge .phiInput ( phi , inp ) and
72- // Conservatively assume that every edge is a back edge if we don't have dominance information.
73- (
74- phi .getBasicBlock ( ) .bbDominates ( edge .getOrigBlock ( ) ) or
75- irreducibleSccEdge ( edge .getOrigBlock ( ) , phi .getBasicBlock ( ) ) or
76- not edge .getOrigBlock ( ) .hasDominanceInformation ( )
77- )
78- }
79-
80- /**
81- * Holds if the edge from b1 to b2 is part of a multiple-entry cycle in an irreducible control flow
82- * graph.
83- *
84- * An ireducible control flow graph is one where the usual dominance-based back edge detection does
85- * not work, because there is a cycle with multiple entry points, meaning there are
86- * mutually-reachable basic blocks where neither dominates the other. For such a graph, we first
87- * remove all detectable back-edges using the normal condition that the predecessor block is
88- * dominated by the successor block, then mark all edges in a cycle in the resulting graph as back
89- * edges.
90- */
91- private predicate irreducibleSccEdge ( SemBasicBlock b1 , SemBasicBlock b2 ) {
92- trimmedEdge ( b1 , b2 ) and trimmedEdge + ( b2 , b1 )
93- }
94-
95- private predicate trimmedEdge ( SemBasicBlock pred , SemBasicBlock succ ) {
96- pred .getASuccessor ( ) = succ and
97- not succ .bbDominates ( pred )
98- }
0 commit comments