[polly] e2d4b02 - [Polly][ScopInliner] Indicate if the IR has changed.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 24 13:49:33 PDT 2021


Author: Michael Kruse
Date: 2021-06-24T15:44:39-05:00
New Revision: e2d4b02404af13a600f27b67cad86682fd298efa

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

LOG: [Polly][ScopInliner] Indicate if the IR has changed.

Return true to indicate that the IR has changed if the nested pass
manager has changed it.

Fixes the ScopInliner tests in the LLVM_ENABLE_EXPENSIVE_CHECKS=ON
configuration.

Thanks to Alexandre Ganea for reporting.

Added: 
    

Modified: 
    polly/lib/Transform/ScopInliner.cpp

Removed: 
    


################################################################################
diff  --git a/polly/lib/Transform/ScopInliner.cpp b/polly/lib/Transform/ScopInliner.cpp
index 83c3b8d350ba7..5054b66cf6ae6 100644
--- a/polly/lib/Transform/ScopInliner.cpp
+++ b/polly/lib/Transform/ScopInliner.cpp
@@ -78,6 +78,7 @@ class ScopInliner : public CallGraphSCCPass {
     const bool HasScopAsTopLevelRegion =
         SD.ValidRegions.count(RI.getTopLevelRegion()) > 0;
 
+    bool Changed = false;
     if (HasScopAsTopLevelRegion) {
       LLVM_DEBUG(dbgs() << "Skipping " << F->getName()
                         << " has scop as top level region");
@@ -90,13 +91,15 @@ class ScopInliner : public CallGraphSCCPass {
       MPM.addPass(AlwaysInlinerPass());
       Module *M = F->getParent();
       assert(M && "Function has illegal module");
-      MPM.run(*M, MAM);
+      PreservedAnalyses PA = MPM.run(*M, MAM);
+      if (!PA.areAllPreserved())
+        Changed = true;
     } else {
       LLVM_DEBUG(dbgs() << F->getName()
                         << " does NOT have scop as top level region\n");
     }
 
-    return false;
+    return Changed;
   };
 
   void getAnalysisUsage(AnalysisUsage &AU) const override {


        


More information about the llvm-commits mailing list