@@ -8,51 +8,72 @@ import java
88 * Predicates for basic-block-level dominance.
99 */
1010
11- /** The immediate dominance relation for basic blocks. */
12- predicate bbIDominates ( BasicBlock dom , BasicBlock node ) { dom .immediatelyDominates ( node ) }
11+ /**
12+ * DEPRECATED: Use `BasicBlock::immediatelyDominates` instead.
13+ *
14+ * The immediate dominance relation for basic blocks.
15+ */
16+ deprecated predicate bbIDominates ( BasicBlock dom , BasicBlock node ) {
17+ dom .immediatelyDominates ( node )
18+ }
1319
1420/** Exit points for basic-block control-flow. */
1521private predicate bbSink ( BasicBlock exit ) { exit .getLastNode ( ) instanceof ControlFlow:: ExitNode }
1622
1723/** Reversed `bbSucc`. */
18- private predicate bbPred ( BasicBlock post , BasicBlock pre ) { post = pre .getABBSuccessor ( ) }
24+ private predicate bbPred ( BasicBlock post , BasicBlock pre ) { post = pre .getASuccessor ( ) }
1925
2026/** The immediate post-dominance relation on basic blocks. */
21- cached
22- predicate bbIPostDominates ( BasicBlock dominator , BasicBlock node ) =
27+ deprecated predicate bbIPostDominates ( BasicBlock dominator , BasicBlock node ) =
2328 idominance( bbSink / 1 , bbPred / 2 ) ( _, dominator , node )
2429
25- /** Holds if `dom` strictly dominates `node`. */
26- predicate bbStrictlyDominates ( BasicBlock dom , BasicBlock node ) { bbIDominates + ( dom , node ) }
27-
28- /** Holds if `dom` dominates `node`. (This is reflexive.) */
29- predicate bbDominates ( BasicBlock dom , BasicBlock node ) {
30- bbStrictlyDominates ( dom , node ) or dom = node
30+ /**
31+ * DEPRECATED: Use `BasicBlock::strictlyDominates` instead.
32+ *
33+ * Holds if `dom` strictly dominates `node`.
34+ */
35+ deprecated predicate bbStrictlyDominates ( BasicBlock dom , BasicBlock node ) {
36+ dom .strictlyDominates ( node )
3137}
3238
33- /** Holds if `dom` strictly post-dominates `node`. */
34- predicate bbStrictlyPostDominates ( BasicBlock dom , BasicBlock node ) { bbIPostDominates + ( dom , node ) }
39+ /**
40+ * DEPRECATED: Use `BasicBlock::dominates` instead.
41+ *
42+ * Holds if `dom` dominates `node`. (This is reflexive.)
43+ */
44+ deprecated predicate bbDominates ( BasicBlock dom , BasicBlock node ) { dom .dominates ( node ) }
3545
36- /** Holds if `dom` post-dominates `node`. (This is reflexive.) */
37- predicate bbPostDominates ( BasicBlock dom , BasicBlock node ) {
38- bbStrictlyPostDominates ( dom , node ) or dom = node
46+ /**
47+ * DEPRECATED: Use `BasicBlock::strictlyPostDominates` instead.
48+ *
49+ * Holds if `dom` strictly post-dominates `node`.
50+ */
51+ deprecated predicate bbStrictlyPostDominates ( BasicBlock dom , BasicBlock node ) {
52+ dom .strictlyPostDominates ( node )
3953}
4054
55+ /**
56+ * DEPRECATED: Use `BasicBlock::postDominates` instead.
57+ *
58+ * Holds if `dom` post-dominates `node`. (This is reflexive.)
59+ */
60+ deprecated predicate bbPostDominates ( BasicBlock dom , BasicBlock node ) { dom .postDominates ( node ) }
61+
4162/**
4263 * The dominance frontier relation for basic blocks.
4364 *
4465 * This is equivalent to:
4566 *
4667 * ```
47- * bbDominates(x, w.getABBPredecessor ()) and not bbStrictlyDominates(x, w)
68+ * x.dominates(w.getAPredecessor ()) and not x.strictlyDominates( w)
4869 * ```
4970 */
5071predicate dominanceFrontier ( BasicBlock x , BasicBlock w ) {
51- x = w .getABBPredecessor ( ) and not bbIDominates ( x , w )
72+ x = w .getAPredecessor ( ) and not x . immediatelyDominates ( w )
5273 or
5374 exists ( BasicBlock prev | dominanceFrontier ( prev , w ) |
54- bbIDominates ( x , prev ) and
55- not bbIDominates ( x , w )
75+ x . immediatelyDominates ( prev ) and
76+ not x . immediatelyDominates ( w )
5677 )
5778}
5879
@@ -65,7 +86,7 @@ predicate iDominates(ControlFlowNode dominator, ControlFlowNode node) {
6586 exists ( BasicBlock bb , int i | dominator = bb .getNode ( i ) and node = bb .getNode ( i + 1 ) )
6687 or
6788 exists ( BasicBlock dom , BasicBlock bb |
68- bbIDominates ( dom , bb ) and
89+ dom . immediatelyDominates ( bb ) and
6990 dominator = dom .getLastNode ( ) and
7091 node = bb .getFirstNode ( )
7192 )
@@ -75,7 +96,7 @@ predicate iDominates(ControlFlowNode dominator, ControlFlowNode node) {
7596pragma [ inline]
7697predicate strictlyDominates ( ControlFlowNode dom , ControlFlowNode node ) {
7798 // This predicate is gigantic, so it must be inlined.
78- bbStrictlyDominates ( dom .getBasicBlock ( ) , node .getBasicBlock ( ) )
99+ dom .getBasicBlock ( ) . strictlyDominates ( node .getBasicBlock ( ) )
79100 or
80101 exists ( BasicBlock b , int i , int j | dom = b .getNode ( i ) and node = b .getNode ( j ) and i < j )
81102}
@@ -84,7 +105,7 @@ predicate strictlyDominates(ControlFlowNode dom, ControlFlowNode node) {
84105pragma [ inline]
85106predicate dominates ( ControlFlowNode dom , ControlFlowNode node ) {
86107 // This predicate is gigantic, so it must be inlined.
87- bbStrictlyDominates ( dom .getBasicBlock ( ) , node .getBasicBlock ( ) )
108+ dom .getBasicBlock ( ) . strictlyDominates ( node .getBasicBlock ( ) )
88109 or
89110 exists ( BasicBlock b , int i , int j | dom = b .getNode ( i ) and node = b .getNode ( j ) and i <= j )
90111}
@@ -93,7 +114,7 @@ predicate dominates(ControlFlowNode dom, ControlFlowNode node) {
93114pragma [ inline]
94115predicate strictlyPostDominates ( ControlFlowNode dom , ControlFlowNode node ) {
95116 // This predicate is gigantic, so it must be inlined.
96- bbStrictlyPostDominates ( dom .getBasicBlock ( ) , node .getBasicBlock ( ) )
117+ dom .getBasicBlock ( ) . strictlyPostDominates ( node .getBasicBlock ( ) )
97118 or
98119 exists ( BasicBlock b , int i , int j | dom = b .getNode ( i ) and node = b .getNode ( j ) and i > j )
99120}
@@ -102,7 +123,7 @@ predicate strictlyPostDominates(ControlFlowNode dom, ControlFlowNode node) {
102123pragma [ inline]
103124predicate postDominates ( ControlFlowNode dom , ControlFlowNode node ) {
104125 // This predicate is gigantic, so it must be inlined.
105- bbStrictlyPostDominates ( dom .getBasicBlock ( ) , node .getBasicBlock ( ) )
126+ dom .getBasicBlock ( ) . strictlyPostDominates ( node .getBasicBlock ( ) )
106127 or
107128 exists ( BasicBlock b , int i , int j | dom = b .getNode ( i ) and node = b .getNode ( j ) and i >= j )
108129}
0 commit comments