[polly] 0f1e67f - [Polly] Fix possibly infinite loop.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 17 08:44:49 PDT 2021


Author: Michael Kruse
Date: 2021-08-17T10:43:04-05:00
New Revision: 0f1e67fac24b7cb49c3e4feeeadf536d27d1473d

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

LOG: [Polly] Fix possibly infinite loop.

The loop had no side-effect since first committed in 642594ae87aca.
While it is obvious what was intended, the code seems to never trigger.

Added: 
    

Modified: 
    polly/lib/Analysis/ScopBuilder.cpp

Removed: 
    


################################################################################
diff  --git a/polly/lib/Analysis/ScopBuilder.cpp b/polly/lib/Analysis/ScopBuilder.cpp
index 4351d27f193c..17907749ad71 100644
--- a/polly/lib/Analysis/ScopBuilder.cpp
+++ b/polly/lib/Analysis/ScopBuilder.cpp
@@ -706,9 +706,11 @@ isl::set ScopBuilder::getPredecessorDomainConstraints(BasicBlock *BB,
 
     // Check if there is a valid region we can use for propagation, thus look
     // for a region that contains the predecessor and has @p BB as exit block.
+    // FIXME: This was an side-effect-free (and possibly infinite) loop when
+    //        committed and seems not to be needed.
     auto *PredR = RI.getRegionFor(PredBB);
     while (PredR->getExit() != BB && !PredR->contains(BB))
-      PredR->getParent();
+      PredR = PredR->getParent();
 
     // If a valid region for propagation was found use the entry of that region
     // for propagation, otherwise the PredBB directly.


        


More information about the llvm-commits mailing list