[polly] 7f62759 - [polly] Properly create and initialize new PM analysis managers

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 5 09:35:09 PDT 2021


Author: Arthur Eubanks
Date: 2021-11-05T09:32:54-07:00
New Revision: 7f627596977624730f9298a1b69883af1555765e

URL: https://github.com/llvm/llvm-project/commit/7f627596977624730f9298a1b69883af1555765e
DIFF: https://github.com/llvm/llvm-project/commit/7f627596977624730f9298a1b69883af1555765e.diff

LOG: [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.

Added: 
    

Modified: 
    polly/lib/Transform/ScopInliner.cpp

Removed: 
    


################################################################################
diff  --git a/polly/lib/Transform/ScopInliner.cpp b/polly/lib/Transform/ScopInliner.cpp
index 5054b66cf6ae6..ed54731c6b2a3 100644
--- a/polly/lib/Transform/ScopInliner.cpp
+++ b/polly/lib/Transform/ScopInliner.cpp
@@ -68,9 +68,17 @@ class ScopInliner : public CallGraphSCCPass {
     }
 
     PassBuilder PB;
+    // Populate analysis managers and register Polly-specific analyses.
+    LoopAnalysisManager LAM;
     FunctionAnalysisManager FAM;
+    CGSCCAnalysisManager CGAM;
+    ModuleAnalysisManager MAM;
     FAM.registerPass([] { return ScopAnalysis(); });
+    PB.registerModuleAnalyses(MAM);
+    PB.registerCGSCCAnalyses(CGAM);
     PB.registerFunctionAnalyses(FAM);
+    PB.registerLoopAnalyses(LAM);
+    PB.crossRegisterProxies(LAM, FAM, CGAM, MAM);
 
     RegionInfo &RI = FAM.getResult<RegionInfoAnalysis>(*F);
     ScopDetection &SD = FAM.getResult<ScopAnalysis>(*F);
@@ -84,9 +92,6 @@ class ScopInliner : public CallGraphSCCPass {
                         << " has scop as top level region");
       F->addFnAttr(llvm::Attribute::AlwaysInline);
 
-      ModuleAnalysisManager MAM;
-      PB.registerModuleAnalyses(MAM);
-      MAM.registerPass([&] { return FunctionAnalysisManagerModuleProxy(FAM); });
       ModulePassManager MPM;
       MPM.addPass(AlwaysInlinerPass());
       Module *M = F->getParent();


        


More information about the llvm-commits mailing list