mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 10:42:39 +01:00
Revert "[NPM][CGSCC] FunctionAnalysisManagerCGSCCProxy: do not clear immutable function passes"
This reverts commit 5eaeb0fa67e57391f5584a3f67fdb131e93afda6. It appears there are analyses that assume clearing - example: https://lab.llvm.org/buildbot#builders/36/builds/5964
This commit is contained in:
parent
c85bdf8369
commit
87d29d8dee
@ -720,7 +720,7 @@ bool FunctionAnalysisManagerCGSCCProxy::Result::invalidate(
|
|||||||
auto PAC = PA.getChecker<FunctionAnalysisManagerCGSCCProxy>();
|
auto PAC = PA.getChecker<FunctionAnalysisManagerCGSCCProxy>();
|
||||||
if (!PAC.preserved() && !PAC.preservedSet<AllAnalysesOn<LazyCallGraph::SCC>>()) {
|
if (!PAC.preserved() && !PAC.preservedSet<AllAnalysesOn<LazyCallGraph::SCC>>()) {
|
||||||
for (LazyCallGraph::Node &N : C)
|
for (LazyCallGraph::Node &N : C)
|
||||||
FAM->invalidate(N.getFunction(), PA);
|
FAM->clear(N.getFunction(), N.getFunction().getName());
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1942,30 +1942,5 @@ TEST_F(CGSCCPassManagerTest, TestInsertionOfNewNonTrivialCallEdge) {
|
|||||||
ASSERT_TRUE(Ran);
|
ASSERT_TRUE(Ran);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(CGSCCPassManagerTest, TestFunctionPassesAreQueriedForInvalidation) {
|
|
||||||
std::unique_ptr<Module> M = parseIR("define void @f() { ret void }");
|
|
||||||
CGSCCPassManager CGPM;
|
|
||||||
bool SCCCalled = false;
|
|
||||||
FunctionPassManager FPM;
|
|
||||||
int ImmRuns = 0;
|
|
||||||
FAM.registerPass([&] { return TestImmutableFunctionAnalysis(ImmRuns); });
|
|
||||||
FPM.addPass(RequireAnalysisPass<TestImmutableFunctionAnalysis, Function>());
|
|
||||||
CGPM.addPass(
|
|
||||||
LambdaSCCPass([&](LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM,
|
|
||||||
LazyCallGraph &CG, CGSCCUpdateResult &UR) {
|
|
||||||
SCCCalled = true;
|
|
||||||
return PreservedAnalyses::none();
|
|
||||||
}));
|
|
||||||
CGPM.addPass(createCGSCCToFunctionPassAdaptor(
|
|
||||||
RequireAnalysisPass<TestImmutableFunctionAnalysis, Function>()));
|
|
||||||
ModulePassManager MPM;
|
|
||||||
|
|
||||||
MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
|
|
||||||
MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(std::move(CGPM)));
|
|
||||||
MPM.run(*M, MAM);
|
|
||||||
ASSERT_EQ(ImmRuns, 1);
|
|
||||||
ASSERT_TRUE(SCCCalled);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
} // namespace
|
} // namespace
|
||||||
|
Loading…
Reference in New Issue
Block a user