@@ -2275,6 +2275,12 @@ private predicate guardControlsPhiInput(
2275
2275
*/
2276
2276
signature predicate guardChecksSig ( IRGuardCondition g , Expr e , boolean branch ) ;
2277
2277
2278
+ bindingset [ g, n]
2279
+ pragma [ inline_late]
2280
+ private predicate controls ( IRGuardCondition g , Node n , boolean edge ) {
2281
+ g .controls ( n .getBasicBlock ( ) , edge )
2282
+ }
2283
+
2278
2284
/**
2279
2285
* Provides a set of barrier nodes for a guard that validates an expression.
2280
2286
*
@@ -2318,15 +2324,17 @@ module BarrierGuard<guardChecksSig/3 guardChecks> {
2318
2324
exists ( IRGuardCondition g , Expr e , ValueNumber value , boolean edge |
2319
2325
e = value .getAnInstruction ( ) .getConvertedResultExpression ( ) and
2320
2326
result .asConvertedExpr ( ) = e and
2321
- guardChecks ( g , value .getAnInstruction ( ) .getConvertedResultExpression ( ) , edge ) and
2322
- g .controls ( result .getBasicBlock ( ) , edge )
2327
+ guardChecks ( g ,
2328
+ pragma [ only_bind_into ] ( value .getAnInstruction ( ) .getConvertedResultExpression ( ) ) , edge ) and
2329
+ controls ( g , result , edge )
2323
2330
)
2324
2331
or
2325
2332
exists (
2326
2333
IRGuardCondition g , boolean branch , Ssa:: DefinitionExt def , IRBlock input , Ssa:: PhiNode phi
2327
2334
|
2328
2335
guardChecks ( g , def .getARead ( ) .asOperand ( ) .getDef ( ) .getConvertedResultExpression ( ) , branch ) and
2329
- guardControlsPhiInput ( g , branch , def , input , phi ) and
2336
+ guardControlsPhiInput ( g , branch , def , pragma [ only_bind_into ] ( input ) ,
2337
+ pragma [ only_bind_into ] ( phi ) ) and
2330
2338
result = TSsaPhiInputNode ( phi , input )
2331
2339
)
2332
2340
}
@@ -2404,8 +2412,9 @@ module BarrierGuard<guardChecksSig/3 guardChecks> {
2404
2412
exists ( IRGuardCondition g , Expr e , ValueNumber value , boolean edge |
2405
2413
e = value .getAnInstruction ( ) .getConvertedResultExpression ( ) and
2406
2414
result .asIndirectConvertedExpr ( indirectionIndex ) = e and
2407
- guardChecks ( g , value .getAnInstruction ( ) .getConvertedResultExpression ( ) , edge ) and
2408
- g .controls ( result .getBasicBlock ( ) , edge )
2415
+ guardChecks ( g ,
2416
+ pragma [ only_bind_into ] ( value .getAnInstruction ( ) .getConvertedResultExpression ( ) ) , edge ) and
2417
+ controls ( g , result , edge )
2409
2418
)
2410
2419
or
2411
2420
exists (
@@ -2414,7 +2423,8 @@ module BarrierGuard<guardChecksSig/3 guardChecks> {
2414
2423
guardChecks ( g ,
2415
2424
def .getARead ( ) .asIndirectOperand ( indirectionIndex ) .getDef ( ) .getConvertedResultExpression ( ) ,
2416
2425
branch ) and
2417
- guardControlsPhiInput ( g , branch , def , input , phi ) and
2426
+ guardControlsPhiInput ( g , branch , def , pragma [ only_bind_into ] ( input ) ,
2427
+ pragma [ only_bind_into ] ( phi ) ) and
2418
2428
result = TSsaPhiInputNode ( phi , input )
2419
2429
)
2420
2430
}
@@ -2443,17 +2453,18 @@ module InstructionBarrierGuard<instructionGuardChecksSig/3 instructionGuardCheck
2443
2453
/** Gets a node that is safely guarded by the given guard check. */
2444
2454
Node getABarrierNode ( ) {
2445
2455
exists ( IRGuardCondition g , ValueNumber value , boolean edge , Operand use |
2446
- instructionGuardChecks ( g , value .getAnInstruction ( ) , edge ) and
2456
+ instructionGuardChecks ( g , pragma [ only_bind_into ] ( value .getAnInstruction ( ) ) , edge ) and
2447
2457
use = value .getAnInstruction ( ) .getAUse ( ) and
2448
2458
result .asOperand ( ) = use and
2449
- g . controls ( result . getBasicBlock ( ) , edge )
2459
+ controls ( g , result , edge )
2450
2460
)
2451
2461
or
2452
2462
exists (
2453
2463
IRGuardCondition g , boolean branch , Ssa:: DefinitionExt def , IRBlock input , Ssa:: PhiNode phi
2454
2464
|
2455
2465
instructionGuardChecks ( g , def .getARead ( ) .asOperand ( ) .getDef ( ) , branch ) and
2456
- guardControlsPhiInput ( g , branch , def , input , phi ) and
2466
+ guardControlsPhiInput ( g , branch , def , pragma [ only_bind_into ] ( input ) ,
2467
+ pragma [ only_bind_into ] ( phi ) ) and
2457
2468
result = TSsaPhiInputNode ( phi , input )
2458
2469
)
2459
2470
}
0 commit comments