[PATCH] D103992: [InstCombine / BuildLibCalls] Add parameter attributes from the prototype.

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 20 12:24:16 PDT 2021


jonpa added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:199
+static void takeAttributesFrom(CallInst *NewCI, CallInst *OrigCI) {
+  NewCI->setAttributes(OrigCI->getAttributes());
+  NewCI->removeAttributes(AttributeList::ReturnIndex,
----------------
rnk wrote:
> This seems questionable. Why not take the parameter attributes from `NewCI`'s callee? What is the value of merging in the attributes from the old call?
Not sure if there could be any value of taking parameter attributes from the old call... It seems though that the call to CreateMemCpy already passes on explicit attributes (alignment), so I suppose that might be enough to do in that place?

Is there anything similar to inferLibFuncAttributes() for these intrinsics that we should use?


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

https://reviews.llvm.org/D103992



More information about the llvm-commits mailing list