[llvm] [BuildLibCalls] Apply ABI attributes to call-sites as well (PR #222675)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 13 12:11:13 PDT 2026


================
@@ -1663,6 +1678,7 @@ static Value *emitLibCall(LibFunc TheLibFunc, Type *ReturnType,
   FunctionCallee Callee = getOrInsertLibFunc(M, *TLI, TheLibFunc, FuncType);
   inferNonMandatoryLibFuncAttrs(M, FuncName, *TLI);
----------------
nikic wrote:

This is what I was going to do initially, but I think copying the attributes is simpler and generalizes more easily.

Otherwise the attribute inference needs to be generic over Function and CallBase, which effectively means working directly on AttributeList -- which makes things awkward if you also need to merge these attributes with other attributes, like we do for some libcalls.

Happy to go in that direction if it's preferred though.

https://github.com/llvm/llvm-project/pull/222675


More information about the llvm-commits mailing list