[PATCH] D45278: [LoopInterchange] Preserve LoopInfo after interchanging.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 4 14:57:58 PDT 2018


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

LGTM



================
Comment at: lib/Transforms/Scalar/LoopInterchange.cpp:1221
+    if (BB == InnerHeader || BB == InnerLatch)
+      OuterLoop->removeBlockFromLoop(BB);
+    else
----------------
fhahn wrote:
> efriedma wrote:
> > This looks weird; you're removing the block from the outer loop, but it's still in the inner loop?
> In this version, the variable OuterLoop refers to the original outer loop, which becomes the inner loop and InnerLoop refers to the loop that becomes the outer loop. I have renamed the variables to NewInner and NewOuter. Do you think it's clearer now?
Yes, that helps.


https://reviews.llvm.org/D45278





More information about the llvm-commits mailing list