llvm.org GIT mirror llvm / 49ae598
Only passes that preserve MemorySSA must mark it as preserved. Summary: The method `getLoopPassPreservedAnalyses` should not mark MemorySSA as preserved, because it's being called in a lot of passes that do not preserve MemorySSA. Instead, mark the MemorySSA analysis as preserved by each pass that does preserve it. These changes only affect the new pass mananger. Reviewers: chandlerc Subscribers: mehdi_amini, jlebar, Prazek, george.burgess.iv, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62536 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363091 91177308-0d34-0410-b5e6-96231b3b80d8 Alina Sbirlea a month ago
7 changed file(s) with 27 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
140140 PA.preserve();
141141 PA.preserve();
142142 PA.preserve();
143 if (EnableMSSALoopDependency)
144 PA.preserve();
145143 // FIXME: What we really want to do here is preserve an AA category, but that
146144 // concept doesn't exist yet.
147145 PA.preserve();
293293
294294 PA.preserve();
295295 PA.preserve();
296 if (EnableMSSALoopDependency)
297 PA.preserve();
296298
297299 return PA;
298300 }
232232
233233 auto PA = getLoopPassPreservedAnalyses();
234234 PA.preserveSet();
235 if (EnableMSSALoopDependency)
236 PA.preserve();
235237 return PA;
236238 }
237239
5353 if (AR.MSSA && VerifyMemorySSA)
5454 AR.MSSA->verifyMemorySSA();
5555
56 return getLoopPassPreservedAnalyses();
56 auto PA = getLoopPassPreservedAnalyses();
57 if (EnableMSSALoopDependency)
58 PA.preserve();
59 return PA;
5760 }
5861
5962 namespace {
700700 if (DeleteCurrentLoop)
701701 LPMU.markLoopAsDeleted(L, "loop-simplifycfg");
702702
703 return getLoopPassPreservedAnalyses();
703 auto PA = getLoopPassPreservedAnalyses();
704 if (EnableMSSALoopDependency)
705 PA.preserve();
706 return PA;
704707 }
705708
706709 namespace {
28602860 // Historically this pass has had issues with the dominator tree so verify it
28612861 // in asserts builds.
28622862 assert(AR.DT.verify(DominatorTree::VerificationLevel::Fast));
2863 return getLoopPassPreservedAnalyses();
2863
2864 auto PA = getLoopPassPreservedAnalyses();
2865 if (EnableMSSALoopDependency)
2866 PA.preserve();
2867 return PA;
28642868 }
28652869
28662870 namespace {
395395 // No need to re-run if we require again from a fresh loop pass manager.
396396 FPM.addPass(createFunctionToLoopPassAdaptor(
397397 RequireAnalysisLoopPass()));
398
399398 // For 'f', preserve most things but not the specific loop analyses.
399 auto PA = getLoopPassPreservedAnalyses();
400 if (EnableMSSALoopDependency)
401 PA.preserve();
400402 EXPECT_CALL(MFPHandle, run(HasName("f"), _))
401403 .InSequence(FSequence)
402 .WillOnce(Return(getLoopPassPreservedAnalyses()));
404 .WillOnce(Return(PA));
403405 EXPECT_CALL(MLAHandle, invalidate(HasName("loop.0.0"), _, _))
404406 .InSequence(FSequence)
405407 .WillOnce(DoDefault());
474476 EXPECT_CALL(MMPHandle, run(_, _)).WillOnce(InvokeWithoutArgs([] {
475477 auto PA = getLoopPassPreservedAnalyses();
476478 PA.preserve();
479 if (EnableMSSALoopDependency)
480 PA.preserve();
477481 return PA;
478482 }));
479483 // All the loop analyses from both functions get invalidated before we
802806 // the fact that they were preserved.
803807 EXPECT_CALL(MFPHandle, run(HasName("f"), _)).WillOnce(InvokeWithoutArgs([] {
804808 auto PA = getLoopPassPreservedAnalyses();
809 if (EnableMSSALoopDependency)
810 PA.preserve();
805811 PA.preserveSet>();
806812 return PA;
807813 }));
823829 // Which means that no extra invalidation occurs and cached values are used.
824830 EXPECT_CALL(MFPHandle, run(HasName("g"), _)).WillOnce(InvokeWithoutArgs([] {
825831 auto PA = getLoopPassPreservedAnalyses();
832 if (EnableMSSALoopDependency)
833 PA.preserve();
826834 PA.preserveSet>();
827835 return PA;
828836 }));