[PATCH] D107872: [SimplifyLibCalls] propagate tail/musttail/notail flags on CallInsts

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 10:55:00 PDT 2021


efriedma added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:1162
 Value *LibCallSimplifier::optimizeMemPCpy(CallInst *CI, IRBuilderBase &B) {
+  if (CI->isMustTailCall())
+    return nullptr;
----------------
nickdesaulniers wrote:
> efriedma wrote:
> > xbolva00 wrote:
> > > Is it worth it at all?
> > > 
> > > I would just bail out libcall simplifier for musttail CIs
> > I agree; musttail calls should be rare enough that it isn't a big deal to just skip libcall simplification completely
> So just completely skipping the call to `LibCallSimplifier::optimizeCall` from `InstCombinerImpl::tryOptimizeCall` if the call is must tail?  That's going to require me to rewrite a lot of the newly added test cases here; please confirm we're in mutual understanding before I go and make such invasive changes to this patch.
Yes, this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107872



More information about the llvm-commits mailing list