[PATCH] D28073: Preserve domtree and loop-simplify for runtime unrolling.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 27 11:40:53 PST 2016


efriedma added inline comments.


================
Comment at: lib/Transforms/Utils/LoopUnroll.cpp:55
+static cl::opt<bool>
+UnrollVerifyDomtree("unroll-verify-domtree", cl::init(false), cl::Hidden,
+                    cl::desc("Verify domtree after unrolling"));
----------------
mkuper wrote:
> We want to enforce this being on in new tests too, I assume?
We probably want this on in new tests, yes, but I have no idea how we would enforce it.  


================
Comment at: lib/Transforms/Utils/LoopUnroll.cpp:619
+      if (BB == LatchBlock) {
+        // The latch is special because we emit unconditional branches in
+        // some cases.  Since the latch is always at the bottom of the loop,
----------------
mkuper wrote:
> Isn't it the case that when the latch ends with an unconditional branch, that branch is towards the header block?
> If so, we should not have any children outside the loop.
Maybe this is more clear?  "The latch is special because we can emit an unconditional branch in the unrolled loop even if the original latch block ends in a conditional branch."


Repository:
  rL LLVM

https://reviews.llvm.org/D28073





More information about the llvm-commits mailing list