[PATCH] D58192: [LoopUnrollPeel] Add case where we should forget the peeled loop from SCEV.

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 13 21:11:44 PST 2019


mkazantsev added a comment.

LGTM, but use `forgetTopmostLoop` instead.



================
Comment at: llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp:668
   // If the loop is nested, we changed the parent loop, update SE.
-  if (Loop *ParentLoop = L->getParentLoop()) {
-    SE->forgetLoop(ParentLoop);
-
-    // FIXME: Incrementally update loop-simplify
-    simplifyLoop(ParentLoop, DT, LI, SE, AC, PreserveLCSSA);
-  } else {
-    // FIXME: Incrementally update loop-simplify
-    simplifyLoop(L, DT, LI, SE, AC, PreserveLCSSA);
-  }
+  if (Loop *ParentLoop = L->getParentLoop())
+    L = ParentLoop;
----------------
The correct way of doing this is `L->forgetTopmostLoop()`. Please us it to avoid potential sneaky bugs with containing loops in the future.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58192/new/

https://reviews.llvm.org/D58192





More information about the llvm-commits mailing list