[PATCH] D108108: [LoopPeel] Allow peeling with multiple unreachable-terminated exit blocks.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 17 09:47:18 PDT 2021


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/LoopPeel.cpp:105
+  // The latch must either be the only exiting block or all non-latch exit
+  // blocks are either have an deopt or unreachable terminator.
+  return all_of(Exits, [](const BasicBlock *BB) {
----------------
reames wrote:
> Can you add something to this comment to indicate that a) this is a proxy for a strong profile prediction of untaken, and b) this is a profitability check not a legality check?
I would really appreciate an explanation of why we want this heuristic... it's not really obvious to me why this is only beneficial if the other exits are likely not taken.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108108



More information about the llvm-commits mailing list