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

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 6 03:14:21 PDT 2021


mkazantsev accepted this revision.
mkazantsev added a comment.
This revision is now accepted and ready to land.

In that case everything since done; @dmakogon pls add one more test with single-exit non-throwing unreachable exit and I think we can go with it, unless someone has cons.



================
Comment at: llvm/lib/Transforms/Utils/BasicBlockUtils.cpp:502
+        isa<UnreachableInst>(BB->getTerminator()))
+      return true;
+    BB = BB->getSingleSuccessor();
----------------
lebedev.ri wrote:
> mkazantsev wrote:
> > 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"? :)
> "let's peel it"
Ok, we peel it now. :)


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