[PATCH] D107872: [SimplifyLibCalls] propagate tail flag on FORTIFY calls

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 12 14:08:21 PDT 2021


efriedma added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:3516
+    if (CI->isTailCall() && !SimplifiedCI->isTailCall())
+      SimplifiedCI->setTailCall();
+
----------------
xbolva00 wrote:
> nickdesaulniers wrote:
> > efriedma wrote:
> > > This isn't the right call in some cases, I think.  For example, for memmove, this is the operand to the memmove, not the memmove itself.
> > Yeah, I don't quite understand not returning the newly constructed call instruction.  Does that mean that the call to `replaceAllUsesWith` on line 3041 wont actually insert the new call instruction, or rather replace the old instruction? 
> memmove/fortified memmove returns a pointer, llvm.memmove and friends return “void”
The code at line 3041 is probably not working as intended, yes.

Actually, I'm not sure what that code is trying to do; not sure why we don't want to just let the instcombine worklist do its normal thing.


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