File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
lib/SILOptimizer/Transforms Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -958,15 +958,18 @@ void TempRValueOptPass::run() {
958
958
simplifyAndReplaceAllSimplifiedUsesAndErase (srcInst, callbacks, &deBlocks);
959
959
}
960
960
}
961
- if (!deadCopies.empty ()) {
962
- invalidateAnalysis (SILAnalysis::InvalidationKind::Instructions);
963
- }
964
961
965
962
// Call the utlity to complete ossa lifetime.
963
+ bool completedAny = false ;
966
964
OSSALifetimeCompletion completion (function, da->get (function), deBlocks);
967
965
for (auto it : valuesToComplete) {
968
- completion.completeOSSALifetime (it,
969
- OSSALifetimeCompletion::Boundary::Liveness);
966
+ auto completed = completion.completeOSSALifetime (
967
+ it, OSSALifetimeCompletion::Boundary::Liveness);
968
+ completedAny = (completed == LifetimeCompletion::WasCompleted);
969
+ }
970
+
971
+ if (!deadCopies.empty () || completedAny) {
972
+ invalidateAnalysis (SILAnalysis::InvalidationKind::Instructions);
970
973
}
971
974
}
972
975
You can’t perform that action at this time.
0 commit comments