@@ -98,55 +98,55 @@ abstract private class GuardConditionImpl extends Expr {
98
98
* being short-circuited) then it will only control blocks dominated by the
99
99
* true (for `&&`) or false (for `||`) branch.
100
100
*/
101
- cached
102
101
final predicate controls ( BasicBlock controlled , boolean testIsTrue ) {
103
102
this .valueControls ( controlled , any ( BooleanValue bv | bv .getValue ( ) = testIsTrue ) )
104
103
}
105
104
106
105
/** Holds if (determined by this guard) `left < right + k` evaluates to `isLessThan` if this expression evaluates to `testIsTrue`. */
106
+ pragma [ inline]
107
107
abstract predicate comparesLt ( Expr left , Expr right , int k , boolean isLessThan , boolean testIsTrue ) ;
108
108
109
109
/**
110
110
* Holds if (determined by this guard) `left < right + k` must be `isLessThan` in `block`.
111
111
* If `isLessThan = false` then this implies `left >= right + k`.
112
112
*/
113
- cached
113
+ pragma [ inline ]
114
114
abstract predicate ensuresLt ( Expr left , Expr right , int k , BasicBlock block , boolean isLessThan ) ;
115
115
116
116
/**
117
117
* Holds if (determined by this guard) `e < k` evaluates to `isLessThan` if
118
118
* this expression evaluates to `value`.
119
119
*/
120
- cached
120
+ pragma [ inline ]
121
121
abstract predicate comparesLt ( Expr e , int k , boolean isLessThan , AbstractValue value ) ;
122
122
123
123
/**
124
124
* Holds if (determined by this guard) `e < k` must be `isLessThan` in `block`.
125
125
* If `isLessThan = false` then this implies `e >= k`.
126
126
*/
127
- cached
127
+ pragma [ inline ]
128
128
abstract predicate ensuresLt ( Expr e , int k , BasicBlock block , boolean isLessThan ) ;
129
129
130
130
/** Holds if (determined by this guard) `left == right + k` evaluates to `areEqual` if this expression evaluates to `testIsTrue`. */
131
- cached
131
+ pragma [ inline ]
132
132
abstract predicate comparesEq ( Expr left , Expr right , int k , boolean areEqual , boolean testIsTrue ) ;
133
133
134
134
/**
135
135
* Holds if (determined by this guard) `left == right + k` must be `areEqual` in `block`.
136
136
* If `areEqual = false` then this implies `left != right + k`.
137
137
*/
138
- cached
138
+ pragma [ inline ]
139
139
abstract predicate ensuresEq ( Expr left , Expr right , int k , BasicBlock block , boolean areEqual ) ;
140
140
141
141
/** Holds if (determined by this guard) `e == k` evaluates to `areEqual` if this expression evaluates to `value`. */
142
- cached
142
+ pragma [ inline ]
143
143
abstract predicate comparesEq ( Expr e , int k , boolean areEqual , AbstractValue value ) ;
144
144
145
145
/**
146
146
* Holds if (determined by this guard) `e == k` must be `areEqual` in `block`.
147
147
* If `areEqual = false` then this implies `e != k`.
148
148
*/
149
- cached
149
+ pragma [ inline ]
150
150
abstract predicate ensuresEq ( Expr e , int k , BasicBlock block , boolean areEqual ) ;
151
151
}
152
152
@@ -187,12 +187,14 @@ private class GuardConditionFromBinaryLogicalOperator extends GuardConditionImpl
187
187
)
188
188
}
189
189
190
+ pragma [ inline]
190
191
override predicate ensuresLt ( Expr left , Expr right , int k , BasicBlock block , boolean isLessThan ) {
191
192
exists ( boolean testIsTrue |
192
193
this .comparesLt ( left , right , k , isLessThan , testIsTrue ) and this .controls ( block , testIsTrue )
193
194
)
194
195
}
195
196
197
+ pragma [ inline]
196
198
override predicate ensuresLt ( Expr e , int k , BasicBlock block , boolean isLessThan ) {
197
199
exists ( AbstractValue value |
198
200
this .comparesLt ( e , k , isLessThan , value ) and this .valueControls ( block , value )
@@ -207,6 +209,7 @@ private class GuardConditionFromBinaryLogicalOperator extends GuardConditionImpl
207
209
)
208
210
}
209
211
212
+ pragma [ inline]
210
213
override predicate ensuresEq ( Expr left , Expr right , int k , BasicBlock block , boolean areEqual ) {
211
214
exists ( boolean testIsTrue |
212
215
this .comparesEq ( left , right , k , areEqual , testIsTrue ) and this .controls ( block , testIsTrue )
@@ -222,6 +225,7 @@ private class GuardConditionFromBinaryLogicalOperator extends GuardConditionImpl
222
225
)
223
226
}
224
227
228
+ pragma [ inline]
225
229
override predicate ensuresEq ( Expr e , int k , BasicBlock block , boolean areEqual ) {
226
230
exists ( AbstractValue value |
227
231
this .comparesEq ( e , k , areEqual , value ) and this .valueControls ( block , value )
@@ -244,6 +248,7 @@ private class GuardConditionFromIR extends GuardConditionImpl {
244
248
this .controlsBlock ( controlled , v )
245
249
}
246
250
251
+ pragma [ inline]
247
252
override predicate comparesLt ( Expr left , Expr right , int k , boolean isLessThan , boolean testIsTrue ) {
248
253
exists ( Instruction li , Instruction ri |
249
254
li .getUnconvertedResultExpression ( ) = left and
@@ -252,13 +257,15 @@ private class GuardConditionFromIR extends GuardConditionImpl {
252
257
)
253
258
}
254
259
260
+ pragma [ inline]
255
261
override predicate comparesLt ( Expr e , int k , boolean isLessThan , AbstractValue value ) {
256
262
exists ( Instruction i |
257
263
i .getUnconvertedResultExpression ( ) = e and
258
264
ir .comparesLt ( i .getAUse ( ) , k , isLessThan , value )
259
265
)
260
266
}
261
267
268
+ pragma [ inline]
262
269
override predicate ensuresLt ( Expr left , Expr right , int k , BasicBlock block , boolean isLessThan ) {
263
270
exists ( Instruction li , Instruction ri , boolean testIsTrue |
264
271
li .getUnconvertedResultExpression ( ) = left and
@@ -268,6 +275,7 @@ private class GuardConditionFromIR extends GuardConditionImpl {
268
275
)
269
276
}
270
277
278
+ pragma [ inline]
271
279
override predicate ensuresLt ( Expr e , int k , BasicBlock block , boolean isLessThan ) {
272
280
exists ( Instruction i , AbstractValue value |
273
281
i .getUnconvertedResultExpression ( ) = e and
@@ -276,6 +284,7 @@ private class GuardConditionFromIR extends GuardConditionImpl {
276
284
)
277
285
}
278
286
287
+ pragma [ inline]
279
288
override predicate comparesEq ( Expr left , Expr right , int k , boolean areEqual , boolean testIsTrue ) {
280
289
exists ( Instruction li , Instruction ri |
281
290
li .getUnconvertedResultExpression ( ) = left and
@@ -284,6 +293,7 @@ private class GuardConditionFromIR extends GuardConditionImpl {
284
293
)
285
294
}
286
295
296
+ pragma [ inline]
287
297
override predicate ensuresEq ( Expr left , Expr right , int k , BasicBlock block , boolean areEqual ) {
288
298
exists ( Instruction li , Instruction ri , boolean testIsTrue |
289
299
li .getUnconvertedResultExpression ( ) = left and
@@ -293,13 +303,15 @@ private class GuardConditionFromIR extends GuardConditionImpl {
293
303
)
294
304
}
295
305
306
+ pragma [ inline]
296
307
override predicate comparesEq ( Expr e , int k , boolean areEqual , AbstractValue value ) {
297
308
exists ( Instruction i |
298
309
i .getUnconvertedResultExpression ( ) = e and
299
310
ir .comparesEq ( i .getAUse ( ) , k , areEqual , value )
300
311
)
301
312
}
302
313
314
+ pragma [ inline]
303
315
override predicate ensuresEq ( Expr e , int k , BasicBlock block , boolean areEqual ) {
304
316
exists ( Instruction i , AbstractValue value |
305
317
i .getUnconvertedResultExpression ( ) = e and
@@ -362,7 +374,6 @@ private predicate nonExcludedIRAndBasicBlock(IRBlock irb, BasicBlock controlled)
362
374
* For performance reasons conditions inside static local initializers or
363
375
* global initializers are not considered `IRGuardCondition`s.
364
376
*/
365
- cached
366
377
class IRGuardCondition extends Instruction {
367
378
Instruction branch ;
368
379
@@ -383,7 +394,7 @@ class IRGuardCondition extends Instruction {
383
394
* gcc extension.
384
395
*
385
396
* The implementation of all four follows the same structure: Each relation
386
- * has a cached user-facing predicate that. For example,
397
+ * has a user-facing predicate that. For example,
387
398
* `GuardCondition::comparesEq` calls `compares_eq`. This predicate has
388
399
* several cases that recursively decompose the relation to bring it to a
389
400
* canonical form (i.e., a relation of the form `e1 == e2 + k`). The base
@@ -393,7 +404,6 @@ class IRGuardCondition extends Instruction {
393
404
* `e1 + k1 == e2 + k2` into canonical the form `e1 == e2 + (k2 - k1)`.
394
405
*/
395
406
396
- cached
397
407
IRGuardCondition ( ) { branch = getBranchForCondition ( this ) }
398
408
399
409
/**
@@ -402,7 +412,6 @@ class IRGuardCondition extends Instruction {
402
412
*
403
413
* For details on what "controls" mean, see the QLDoc for `controls`.
404
414
*/
405
- cached
406
415
predicate valueControls ( IRBlock controlled , AbstractValue v ) {
407
416
// This condition must determine the flow of control; that is, this
408
417
// node must be a top-level condition.
@@ -440,7 +449,6 @@ class IRGuardCondition extends Instruction {
440
449
* being short-circuited) then it will only control blocks dominated by the
441
450
* true (for `&&`) or false (for `||`) branch.
442
451
*/
443
- cached
444
452
predicate controls ( IRBlock controlled , boolean testIsTrue ) {
445
453
this .valueControls ( controlled , any ( BooleanValue bv | bv .getValue ( ) = testIsTrue ) )
446
454
}
@@ -449,7 +457,6 @@ class IRGuardCondition extends Instruction {
449
457
* Holds if the control-flow edge `(pred, succ)` may be taken only if
450
458
* the value of this condition is `v`.
451
459
*/
452
- cached
453
460
predicate valueControlsEdge ( IRBlock pred , IRBlock succ , AbstractValue v ) {
454
461
pred .getASuccessor ( ) = succ and
455
462
this .valueControls ( pred , v )
@@ -468,7 +475,6 @@ class IRGuardCondition extends Instruction {
468
475
* Holds if the control-flow edge `(pred, succ)` may be taken only if
469
476
* the value of this condition is `testIsTrue`.
470
477
*/
471
- cached
472
478
final predicate controlsEdge ( IRBlock pred , IRBlock succ , boolean testIsTrue ) {
473
479
this .valueControlsEdge ( pred , succ , any ( BooleanValue bv | bv .getValue ( ) = testIsTrue ) )
474
480
}
@@ -506,7 +512,7 @@ class IRGuardCondition extends Instruction {
506
512
}
507
513
508
514
/** Holds if (determined by this guard) `left < right + k` evaluates to `isLessThan` if this expression evaluates to `testIsTrue`. */
509
- cached
515
+ pragma [ inline ]
510
516
predicate comparesLt ( Operand left , Operand right , int k , boolean isLessThan , boolean testIsTrue ) {
511
517
exists ( BooleanValue value |
512
518
compares_lt ( valueNumber ( this ) , left , right , k , isLessThan , value ) and
@@ -518,7 +524,7 @@ class IRGuardCondition extends Instruction {
518
524
* Holds if (determined by this guard) `op < k` evaluates to `isLessThan` if
519
525
* this expression evaluates to `value`.
520
526
*/
521
- cached
527
+ pragma [ inline ]
522
528
predicate comparesLt ( Operand op , int k , boolean isLessThan , AbstractValue value ) {
523
529
compares_lt ( valueNumber ( this ) , op , k , isLessThan , value )
524
530
}
@@ -527,7 +533,7 @@ class IRGuardCondition extends Instruction {
527
533
* Holds if (determined by this guard) `left < right + k` must be `isLessThan` in `block`.
528
534
* If `isLessThan = false` then this implies `left >= right + k`.
529
535
*/
530
- cached
536
+ pragma [ inline ]
531
537
predicate ensuresLt ( Operand left , Operand right , int k , IRBlock block , boolean isLessThan ) {
532
538
exists ( AbstractValue value |
533
539
compares_lt ( valueNumber ( this ) , left , right , k , isLessThan , value ) and
@@ -539,7 +545,7 @@ class IRGuardCondition extends Instruction {
539
545
* Holds if (determined by this guard) `op < k` must be `isLessThan` in `block`.
540
546
* If `isLessThan = false` then this implies `op >= k`.
541
547
*/
542
- cached
548
+ pragma [ inline ]
543
549
predicate ensuresLt ( Operand op , int k , IRBlock block , boolean isLessThan ) {
544
550
exists ( AbstractValue value |
545
551
compares_lt ( valueNumber ( this ) , op , k , isLessThan , value ) and
@@ -551,7 +557,7 @@ class IRGuardCondition extends Instruction {
551
557
* Holds if (determined by this guard) `left < right + k` must be `isLessThan` on the edge from
552
558
* `pred` to `succ`. If `isLessThan = false` then this implies `left >= right + k`.
553
559
*/
554
- cached
560
+ pragma [ inline ]
555
561
predicate ensuresLtEdge (
556
562
Operand left , Operand right , int k , IRBlock pred , IRBlock succ , boolean isLessThan
557
563
) {
@@ -565,7 +571,7 @@ class IRGuardCondition extends Instruction {
565
571
* Holds if (determined by this guard) `op < k` must be `isLessThan` on the edge from
566
572
* `pred` to `succ`. If `isLessThan = false` then this implies `op >= k`.
567
573
*/
568
- cached
574
+ pragma [ inline ]
569
575
predicate ensuresLtEdge ( Operand left , int k , IRBlock pred , IRBlock succ , boolean isLessThan ) {
570
576
exists ( AbstractValue value |
571
577
compares_lt ( valueNumber ( this ) , left , k , isLessThan , value ) and
@@ -574,7 +580,7 @@ class IRGuardCondition extends Instruction {
574
580
}
575
581
576
582
/** Holds if (determined by this guard) `left == right + k` evaluates to `areEqual` if this expression evaluates to `testIsTrue`. */
577
- cached
583
+ pragma [ inline ]
578
584
predicate comparesEq ( Operand left , Operand right , int k , boolean areEqual , boolean testIsTrue ) {
579
585
exists ( BooleanValue value |
580
586
compares_eq ( valueNumber ( this ) , left , right , k , areEqual , value ) and
@@ -583,7 +589,7 @@ class IRGuardCondition extends Instruction {
583
589
}
584
590
585
591
/** Holds if (determined by this guard) `op == k` evaluates to `areEqual` if this expression evaluates to `value`. */
586
- cached
592
+ pragma [ inline ]
587
593
predicate comparesEq ( Operand op , int k , boolean areEqual , AbstractValue value ) {
588
594
unary_compares_eq ( valueNumber ( this ) , op , k , areEqual , false , value )
589
595
}
@@ -592,7 +598,7 @@ class IRGuardCondition extends Instruction {
592
598
* Holds if (determined by this guard) `left == right + k` must be `areEqual` in `block`.
593
599
* If `areEqual = false` then this implies `left != right + k`.
594
600
*/
595
- cached
601
+ pragma [ inline ]
596
602
predicate ensuresEq ( Operand left , Operand right , int k , IRBlock block , boolean areEqual ) {
597
603
exists ( AbstractValue value |
598
604
compares_eq ( valueNumber ( this ) , left , right , k , areEqual , value ) and
@@ -604,7 +610,7 @@ class IRGuardCondition extends Instruction {
604
610
* Holds if (determined by this guard) `op == k` must be `areEqual` in `block`.
605
611
* If `areEqual = false` then this implies `op != k`.
606
612
*/
607
- cached
613
+ pragma [ inline ]
608
614
predicate ensuresEq ( Operand op , int k , IRBlock block , boolean areEqual ) {
609
615
exists ( AbstractValue value |
610
616
unary_compares_eq ( valueNumber ( this ) , op , k , areEqual , false , value ) and
@@ -616,7 +622,7 @@ class IRGuardCondition extends Instruction {
616
622
* Holds if (determined by this guard) `left == right + k` must be `areEqual` on the edge from
617
623
* `pred` to `succ`. If `areEqual = false` then this implies `left != right + k`.
618
624
*/
619
- cached
625
+ pragma [ inline ]
620
626
predicate ensuresEqEdge (
621
627
Operand left , Operand right , int k , IRBlock pred , IRBlock succ , boolean areEqual
622
628
) {
@@ -630,7 +636,7 @@ class IRGuardCondition extends Instruction {
630
636
* Holds if (determined by this guard) `op == k` must be `areEqual` on the edge from
631
637
* `pred` to `succ`. If `areEqual = false` then this implies `op != k`.
632
638
*/
633
- cached
639
+ pragma [ inline ]
634
640
predicate ensuresEqEdge ( Operand op , int k , IRBlock pred , IRBlock succ , boolean areEqual ) {
635
641
exists ( AbstractValue value |
636
642
unary_compares_eq ( valueNumber ( this ) , op , k , areEqual , false , value ) and
0 commit comments