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

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 17 09:53:12 PDT 2021


reames 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) {
----------------
nikic wrote:
> 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.
I don't know this is Florian's answer, but mine would be: incrementalism and minimizing blast radius.  We may eventually want to generalize further, but one step at a time.  


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