[PATCH] D103026: [LoopUnroll] Explicitly specify exit to unroll against (NFCI)

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 25 22:11:38 PDT 2021


mkazantsev added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/LoopUnroll.cpp:352
       // so we do not worry about them.
-      BasicBlock *ExitingBlock = L->getLoopLatch();
+      ExitingBlock = L->getLoopLatch();
       assert(ExitingBlock && "Loop without exiting block?");
----------------
I don't really understand the implications of this change. We'll process a different exit in case of non-zero peeled count than passed in param. Is this intentional? Could you please explain?

According to the comment, it looks like we can just assert that `ExitingBlock == L->getLoopLatch()`, but I never understood subtleties of unrolling code.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103026



More information about the llvm-commits mailing list