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

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 11 15:33:41 PDT 2021


xbolva00 added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:630
   return Dst;
 }
 
----------------
nickdesaulniers wrote:
> jdoerfert wrote:
> > Mostly this makes sense but doesn't this violate tail properties now? The old call result was return but it is not anymore.
> perhaps we should be avoiding libcall transforms that don't return the new `CallInst` if the `CallInst` to be replaced is marked `musttail`? Let me add `musttail` tests.
You mean eg musttail on strncpy?

Well yeah, but anyway there are many other libcall simplifications which break “musttail” contract (so if CI is musttail, we should not perform some simplifications).

But yeah, now with propagated tail kind, some IR verifier or backend may fail.

Nick, can you try it please?


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