From e2d4b02404af13a600f27b67cad86682fd298efa Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Thu, 24 Jun 2021 15:17:21 -0500 Subject: [PATCH] [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. --- polly/lib/Transform/ScopInliner.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/polly/lib/Transform/ScopInliner.cpp b/polly/lib/Transform/ScopInliner.cpp index 83c3b8d350ba..5054b66cf6ae 100644 --- a/polly/lib/Transform/ScopInliner.cpp +++ b/polly/lib/Transform/ScopInliner.cpp @@ -78,6 +78,7 @@ public: 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 @@ public: 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 {