[PATCH] D33001: [RuntimeUnrolling] Add logic for loops with multiple exit blocks

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 23 07:35:06 PDT 2017


anna marked an inline comment as done.
anna added inline comments.


================
Comment at: lib/Transforms/Utils/LoopUnrollRuntime.cpp:429
+  // tree info.
+  for (auto *BB : OtherExits) {
+
----------------
reames wrote:
> Ok, I'm missing something.  Why do we need this?  Is it just to preserve the dedicated exit property?  If so, wouldn't simply splitting the edge and inserting a trivial edge (without duplication) be a lot simpler?
You mean splitting the edge (which would create this new exits) and add a trivial edge to the original exits, to avoid duplicating the code? We won't be able to do that because we need to preserve the dedicated exit property on *both* loops: the remainder loop and the original loop.
Adding this edge breaks the dedicated exit property for the original loop. 



================
Comment at: lib/Transforms/Utils/LoopUnrollRuntime.cpp:519
+
   BasicBlock *Exit = L->getUniqueExitBlock(); // successor out of loop
+  // These are exit blocks other than the target of the latch exiting block.
----------------
reames wrote:
> It looks like you're re-purposing this as the Latch Exit.  Can you rename this and check it in?  It'll make the diff smaller and easier to read.
Moved the assert that checks for it closer to the definition as well. 


https://reviews.llvm.org/D33001





More information about the llvm-commits mailing list