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

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 16 15:14:48 PDT 2021


nickdesaulniers added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:3275-3280
       NewCI->setAttributes(CI->getAttributes());
       NewCI->removeAttributes(
           AttributeList::ReturnIndex,
           AttributeFuncs::typeIncompatible(NewCI->getType()));
+      if (CI->isTailCall())
+        NewCI->setTailCall();
----------------
if this pattern of:
1. set attributes from new to old
2. remove type incompatible attributes
3. copy over tail flag (maybe musttail)

Then perhaps this should be a helper function; `copyAttributesFlags(const CallInst *From, CallInst *To)`? Though I'd like @efriedma 's input on this approach of redoing work another pass does, vs inserting another run of `TailCallElim` after instcombine?


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