[polly] r249272 - [FIX] Check loop latches for valid control too.

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 4 07:53:18 PDT 2015


Author: jdoerfert
Date: Sun Oct  4 09:53:18 2015
New Revision: 249272

URL: http://llvm.org/viewvc/llvm-project?rev=249272&view=rev
Log:
[FIX] Check loop latches for valid control too.

  This patch cannot be tested on its own as the isValidCFG currently
  hides the fact that control is actually non-affine with
  over-approximation. This will be corrected in the next patch and a
  test for non-affine latches will be added.

Modified:
    polly/trunk/lib/Analysis/ScopDetection.cpp

Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=249272&r1=249271&r2=249272&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Sun Oct  4 09:53:18 2015
@@ -729,12 +729,13 @@ bool ScopDetection::isValidInstruction(I
 
 bool ScopDetection::canUseISLTripCount(Loop *L,
                                        DetectionContext &Context) const {
-  // Ensure the loop has valid exiting blocks, otherwise we need to
-  // overapproximate it as a boxed loop.
-  SmallVector<BasicBlock *, 4> ExitingBlocks;
-  L->getExitingBlocks(ExitingBlocks);
-  for (BasicBlock *ExitingBB : ExitingBlocks) {
-    if (!isValidCFG(*ExitingBB, Context))
+  // Ensure the loop has valid exiting blocks as well as latches, otherwise we
+  // need to overapproximate it as a boxed loop.
+  SmallVector<BasicBlock *, 4> LoopControlBlocks;
+  L->getLoopLatches(LoopControlBlocks);
+  L->getExitingBlocks(LoopControlBlocks);
+  for (BasicBlock *ControlBB : LoopControlBlocks) {
+    if (!isValidCFG(*ControlBB, Context))
       return false;
   }
 




More information about the llvm-commits mailing list