Skip to content

Commit f312541

Browse files
committed
[NFC] OwnedLifetimeCan: Extracted dead-end visit.
This is separate from deinit barrier visiting, and will be deleted once complete lifetimes are finished.
1 parent 800cd3f commit f312541

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

include/swift/SILOptimizer/Utils/CanonicalizeOSSALifetime.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ class CanonicalizeOSSALifetime final {
472472
void findExtendedBoundary(PrunedLivenessBoundary const &originalBoundary,
473473
PrunedLivenessBoundary &boundary);
474474

475+
void extendLivenessToDeadEnds();
475476
void extendLivenessToDeinitBarriers();
476477

477478
void extendUnconsumedLiveness(PrunedLivenessBoundary const &boundary);

lib/SILOptimizer/Utils/CanonicalizeOSSALifetime.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,9 @@ bool CanonicalizeOSSALifetime::computeCanonicalLiveness() {
252252
return true;
253253
}
254254

255-
void CanonicalizeOSSALifetime::extendLivenessToDeinitBarriers() {
256-
// OSSALifetimeCompletion: With complete lifetimes, creating completeLiveness
257-
// and using it to visit unreachable lifetime ends should be deleted.
255+
void CanonicalizeOSSALifetime::extendLivenessToDeadEnds() {
256+
// TODO: OSSALifetimeCompletion: Once lifetimes are always complete, delete
257+
// this method.
258258
SmallVector<SILBasicBlock *, 32> discoveredBlocks(this->discoveredBlocks);
259259
SSAPrunedLiveness completeLiveness(*liveness, &discoveredBlocks);
260260

@@ -274,7 +274,9 @@ void CanonicalizeOSSALifetime::extendLivenessToDeinitBarriers() {
274274
return true;
275275
});
276276
});
277+
}
277278

279+
void CanonicalizeOSSALifetime::extendLivenessToDeinitBarriers() {
278280
SmallVector<SILInstruction *, 8> ends;
279281
if (currentLexicalLifetimeEnds.size() > 0) {
280282
visitExtendedUnconsumedBoundary(
@@ -1204,6 +1206,7 @@ bool CanonicalizeOSSALifetime::computeLiveness() {
12041206
return false;
12051207
}
12061208
if (respectsDeinitBarriers()) {
1209+
extendLivenessToDeadEnds();
12071210
extendLivenessToDeinitBarriers();
12081211
}
12091212
if (accessBlockAnalysis) {

0 commit comments

Comments
 (0)