@@ -367,25 +367,41 @@ abstract class StackVariableReachability extends string {
367
367
)
368
368
}
369
369
370
- /** Holds if `cond` is a condition with a known truth value in `bb`. */
370
+ /**
371
+ * Holds if `cond` is a condition with a known truth value in `bb`.
372
+ *
373
+ * This predicate is `pragma[noopt]` as it seems difficult to get the correct join order for the
374
+ * recursive case otherwise:
375
+ * revBbSuccessorEntryReaches0(bb) -> getASuccessor -> prev_delta ->
376
+ * revBbSuccessorEntryReaches0(pred) -> {isLoopCondition, isDisjunctionCondition, isLoopVariantCondition}
377
+ */
378
+ pragma [ noopt]
371
379
private Condition getACondition ( ControlFlowNode source , SemanticStackVariable v , BasicBlock bb ) {
372
- revBbSuccessorEntryReaches0 ( source , pragma [ only_bind_into ] ( bb ) , v , _, this ) and
380
+ revBbSuccessorEntryReaches0 ( source , bb , v , _, this ) and
373
381
(
374
382
result = getADirectCondition ( bb ) and
375
383
(
376
- result .refutesCondition ( getASinkCondition ( v ) )
384
+ exists ( Condition c |
385
+ c = getASinkCondition ( v ) and
386
+ result .refutesCondition ( c )
387
+ )
377
388
or
378
- result .impliesCondition ( getABarrierCondition ( v ) )
389
+ exists ( Condition c |
390
+ c = getABarrierCondition ( v ) and
391
+ result .impliesCondition ( c )
392
+ )
379
393
)
380
394
or
381
395
exists ( BasicBlock pred , LogicalCondition cond |
396
+ pred .getASuccessor ( ) = bb and
382
397
cond = getACondition ( source , v , pred ) and
398
+ revBbSuccessorEntryReaches0 ( source , pred , v , _, this ) and
383
399
result = cond and
384
- revBbSuccessorEntryReaches0 ( source , pragma [ only_bind_into ] ( pred ) , v , _ , this ) and
385
- pred . getASuccessor ( ) = bb and
386
- not isLoopCondition ( cond . getCondition ( ) , pred , bb ) and
387
- not isDisjunctionCondition ( cond . getCondition ( ) , pred , bb ) and
388
- not isLoopVariantCondition ( cond . getCondition ( ) , pred , bb )
400
+ exists ( LogicalGuardCondition c | c = cond . getCondition ( ) |
401
+ not isLoopCondition ( c , pred , bb ) and
402
+ not isDisjunctionCondition ( c , pred , bb ) and
403
+ not isLoopVariantCondition ( c , pred , bb )
404
+ )
389
405
)
390
406
)
391
407
}
0 commit comments