[PATCH] D110922: [LoopPeel] Peel loops with deoptimizing exits

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 5 20:29:42 PDT 2021


mkazantsev added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/BasicBlockUtils.cpp:502
+        isa<UnreachableInst>(BB->getTerminator()))
+      return true;
+    BB = BB->getSingleSuccessor();
----------------
lebedev.ri wrote:
> mkazantsev wrote:
> > There is one thing that bugs me. Imagine a sutiation:
> > ```
> > loop_exit:
> >   call foo() // will not return, but is not a deopt
> >   unreachable
> > ```
> > 
> > I'm not sure if it's bad actually. But maybe we should consider checking all other (non deopt) instruction with `isGuaranteedToTransferExecutionToSuccessor`. Opinions?
> This is actually exactly the situation would have wanted to ask to be supported.
Do you mean "supported" as "let's peel it" or "let's NOT peel it unless we know unreachable WILL execute"? :)


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