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() {
958958 simplifyAndReplaceAllSimplifiedUsesAndErase (srcInst, callbacks, &deBlocks);
959959 }
960960 }
961- if (!deadCopies.empty ()) {
962- invalidateAnalysis (SILAnalysis::InvalidationKind::Instructions);
963- }
964961
965962 // Call the utlity to complete ossa lifetime.
963+ bool completedAny = false ;
966964 OSSALifetimeCompletion completion (function, da->get (function), deBlocks);
967965 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);
970973 }
971974}
972975
You can’t perform that action at this time.
0 commit comments