[PATCH] D32801: [RuntimeLoopUnroller] Add assert that we dont unroll non-rotated loops

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 3 10:57:13 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL302058: [RuntimeLoopUnroller] Add assert that we dont unroll non-rotated loops (authored by annat).

Changed prior to commit:
  https://reviews.llvm.org/D32801?vs=97628&id=97690#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D32801

Files:
  llvm/trunk/lib/Transforms/Utils/LoopUnrollRuntime.cpp


Index: llvm/trunk/lib/Transforms/Utils/LoopUnrollRuntime.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Utils/LoopUnrollRuntime.cpp
+++ llvm/trunk/lib/Transforms/Utils/LoopUnrollRuntime.cpp
@@ -512,6 +512,13 @@
 
   BasicBlock *Latch = L->getLoopLatch();
 
+  // Cloning the loop basic blocks (`CloneLoopBlocks`) requires that one of the
+  // targets of the Latch be the single exit block out of the loop. This needs
+  // to be guaranteed by the callers of UnrollRuntimeLoopRemainder.
+  BranchInst *LatchBR = cast<BranchInst>(Latch->getTerminator());
+  assert(LatchBR->getSuccessor(0) == Exit ||
+         LatchBR->getSuccessor(1) == Exit && "loop latch successor should be "
+                                             "exit block!");
   // Loop structure is the following:
   //
   // PreHeader


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32801.97690.patch
Type: text/x-patch
Size: 858 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170503/ff915e62/attachment.bin>


More information about the llvm-commits mailing list