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

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 3 10:40:59 PDT 2017


davide accepted this revision.
davide added a comment.
This revision is now accepted and ready to land.

LGTM.



================
Comment at: lib/Transforms/Utils/LoopUnrollRuntime.cpp:515-521
+  // 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!");
----------------
This seems like a natural extension of what I did.
I think the fact that the other successor is the header is given by the definition of a latch, so we should be fine with this.


https://reviews.llvm.org/D32801





More information about the llvm-commits mailing list