[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.
GitOrigin-RevId: e2d4b02404af13a600f27b67cad86682fd298efa
diff --git a/lib/Transform/ScopInliner.cpp b/lib/Transform/ScopInliner.cpp
index 83c3b8d..5054b66 100644
--- a/lib/Transform/ScopInliner.cpp
+++ b/lib/Transform/ScopInliner.cpp
@@ -78,6 +78,7 @@
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 @@
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 {