[PATCH] D110922: [LoopPeel] Peel loops with deoptimizing exits
Max Kazantsev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 1 05:25:43 PDT 2021
mkazantsev added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/BasicBlockUtils.cpp:504
+ if (Succ->getTerminatingDeoptimizeCall() ||
+ isa<UnreachableInst>(Succ->getTerminator())) {
+ DeoptimizingBlocks.push_back(Succ);
----------------
lebedev.ri wrote:
> Nice, i was about to ask for that.
> But doesn't this lead to the issues with branch weights discussed in D108108?
Well, it doesn't introduce a new bug, it just expands the scope of the existing problem. I'm pretty sure it's relatively safe to always set "many:1" metadata for unreached blocks, but need more digging to understand the impact of this.
================
Comment at: llvm/lib/Transforms/Utils/BasicBlockUtils.cpp:512
+ Succ = NextSucc;
+ }
+ return false;
----------------
Compile time-wise, I'd prefer to have traversal limit set by an option. In worst case, you'll need to walk dozens blocks for each exit, and here is where things may go astray.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110922/new/
https://reviews.llvm.org/D110922
More information about the llvm-commits
mailing list