[PATCH] D80080: [LoopUnroll] Do not peel loop if we also completely unroll.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 17 14:23:04 PDT 2020


efriedma added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/LoopUnroll.cpp:406
+  // Try peeling, if we do not completely unroll the loop later.
+  if (!CompletelyUnroll && ULO.PeelCount) {
     Peeled = peelLoop(L, ULO.PeelCount, LI, SE, DT, AC, PreserveLCSSA);
----------------
This code looks like it needs to be reorganized.  We probably shouldn't be doing math using the TripCount, then changing the TripCount before we actually use the results of that math.

Maybe it would be more clear overall to move the peelLoop call into `tryToUnrollLoop()`, instead of calling it from UnrollLoop.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80080





More information about the llvm-commits mailing list