@@ -424,8 +424,13 @@ module Make<LocationSig Location, InputSig<Location> Input> {
424
424
rnk = ssaRefRank ( bb , _, v , SsaActualRead ( ) )
425
425
}
426
426
427
+ /**
428
+ * Holds if `v` is live at the end of basic block `bb` with the same value as at
429
+ * the end of the immediate dominator, `idom`, of `bb`.
430
+ */
427
431
pragma [ nomagic]
428
- private predicate liveThrough ( BasicBlock bb , SourceVariable v ) {
432
+ private predicate liveThrough ( BasicBlock idom , BasicBlock bb , SourceVariable v ) {
433
+ idom = getImmediateBasicBlockDominator ( bb ) and
429
434
liveAtExit ( bb , v ) and
430
435
not ssaRef ( bb , _, v , SsaDef ( ) )
431
436
}
@@ -443,14 +448,16 @@ module Make<LocationSig Location, InputSig<Location> Input> {
443
448
liveAtExit ( bb , v )
444
449
)
445
450
or
446
- // The construction of SSA form ensures that each read of a variable is
447
- // dominated by its definition. An SSA definition therefore reaches a
448
- // control flow node if it is the _closest_ SSA definition that dominates
449
- // the node. If two definitions dominate a node then one must dominate the
450
- // other, so therefore the definition of _closest_ is given by the dominator
451
- // tree. Thus, reaching definitions can be calculated in terms of dominance.
452
- ssaDefReachesEndOfBlock ( getImmediateBasicBlockDominator ( bb ) , def , pragma [ only_bind_into ] ( v ) ) and
453
- liveThrough ( bb , pragma [ only_bind_into ] ( v ) )
451
+ exists ( BasicBlock idom |
452
+ // The construction of SSA form ensures that each read of a variable is
453
+ // dominated by its definition. An SSA definition therefore reaches a
454
+ // control flow node if it is the _closest_ SSA definition that dominates
455
+ // the node. If two definitions dominate a node then one must dominate the
456
+ // other, so therefore the definition of _closest_ is given by the dominator
457
+ // tree. Thus, reaching definitions can be calculated in terms of dominance.
458
+ ssaDefReachesEndOfBlock ( idom , def , v ) and
459
+ liveThrough ( idom , bb , v )
460
+ )
454
461
}
455
462
456
463
/**
0 commit comments