@@ -522,7 +522,7 @@ void CanonicalizeOSSALifetime::findOriginalBoundary(
522
522
// / These are the "original" live blocks (originalLiveBlocks).
523
523
// / [Color these blocks green.]
524
524
// / - From within that collection, collect the blocks which contain a _final_
525
- // / consuming, non-destroy use, and their successors.
525
+ // / consuming, non-destroy use, and their iterative successors.
526
526
// / These are the "consumed" blocks (consumedAtExitBlocks).
527
527
// / [Color these blocks red.]
528
528
// / - Extend liveness down to the boundary between originalLiveBlocks and
@@ -569,8 +569,11 @@ void CanonicalizeOSSALifetime::extendUnconsumedLiveness(
569
569
}
570
570
}
571
571
572
- // Second, collect the blocks which occur after a _final_ consuming use.
572
+ // Second, collect the blocks which contain a _final_ consuming use and their
573
+ // iterative successors within the originalLiveBlocks.
573
574
BasicBlockSet consumedAtExitBlocks (currentDef->getFunction ());
575
+ // The subset of consumedAtExitBlocks which do not contain a _final_ consuming
576
+ // use, i.e. the subset that is dead.
574
577
StackList<SILBasicBlock *> consumedAtEntryBlocks (currentDef->getFunction ());
575
578
{
576
579
// Start the forward walk from blocks which contain _final_ non-destroy
@@ -596,8 +599,8 @@ void CanonicalizeOSSALifetime::extendUnconsumedLiveness(
596
599
}
597
600
}
598
601
599
- // Third, find the blocks on the boundary between the originally-live blocks
600
- // and the originally-live-but-consumed blocks. Extend liveness "to the end"
602
+ // Third, find the blocks on the boundary between the originalLiveBlocks
603
+ // blocks and the consumedAtEntryBlocks blocks. Extend liveness "to the end"
601
604
// of these blocks.
602
605
for (auto *block : consumedAtEntryBlocks) {
603
606
for (auto *predecessor : block->getPredecessorBlocks ()) {
0 commit comments