[polly] Properly create and initialize new PM analysis managers
If we don't properly initialize all the analysis managers, we may be missing analyses that other analyses depend on. Fixes broken polly test, e.g. https://lab.llvm.org/buildbot/#/builders/10/builds/7501.
This commit is contained in:
parent
a83a6c22e6
commit
7f62759697
|
@ -68,9 +68,17 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
PassBuilder PB;
|
PassBuilder PB;
|
||||||
|
// Populate analysis managers and register Polly-specific analyses.
|
||||||
|
LoopAnalysisManager LAM;
|
||||||
FunctionAnalysisManager FAM;
|
FunctionAnalysisManager FAM;
|
||||||
|
CGSCCAnalysisManager CGAM;
|
||||||
|
ModuleAnalysisManager MAM;
|
||||||
FAM.registerPass([] { return ScopAnalysis(); });
|
FAM.registerPass([] { return ScopAnalysis(); });
|
||||||
|
PB.registerModuleAnalyses(MAM);
|
||||||
|
PB.registerCGSCCAnalyses(CGAM);
|
||||||
PB.registerFunctionAnalyses(FAM);
|
PB.registerFunctionAnalyses(FAM);
|
||||||
|
PB.registerLoopAnalyses(LAM);
|
||||||
|
PB.crossRegisterProxies(LAM, FAM, CGAM, MAM);
|
||||||
|
|
||||||
RegionInfo &RI = FAM.getResult<RegionInfoAnalysis>(*F);
|
RegionInfo &RI = FAM.getResult<RegionInfoAnalysis>(*F);
|
||||||
ScopDetection &SD = FAM.getResult<ScopAnalysis>(*F);
|
ScopDetection &SD = FAM.getResult<ScopAnalysis>(*F);
|
||||||
|
@ -84,9 +92,6 @@ public:
|
||||||
<< " has scop as top level region");
|
<< " has scop as top level region");
|
||||||
F->addFnAttr(llvm::Attribute::AlwaysInline);
|
F->addFnAttr(llvm::Attribute::AlwaysInline);
|
||||||
|
|
||||||
ModuleAnalysisManager MAM;
|
|
||||||
PB.registerModuleAnalyses(MAM);
|
|
||||||
MAM.registerPass([&] { return FunctionAnalysisManagerModuleProxy(FAM); });
|
|
||||||
ModulePassManager MPM;
|
ModulePassManager MPM;
|
||||||
MPM.addPass(AlwaysInlinerPass());
|
MPM.addPass(AlwaysInlinerPass());
|
||||||
Module *M = F->getParent();
|
Module *M = F->getParent();
|
||||||
|
|
Loading…
Reference in New Issue