[LibCalls] Respect TLI.getExtAttrForI32Param() in inferLibFuncAttributes().
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>
Tue, 5 Apr 2022 07:55:43 +0000 (09:55 +0200)
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>
Tue, 5 Apr 2022 08:29:42 +0000 (10:29 +0200)
commitdbb6a75fbb3679a03edf6f4bc7e7262f751b6dfc
tree122dcafd3876eb7419aa1c0fbb1881caa6d5feb8
parentdda366ed37cec7b2f7c96a47b1b32391b514d969
[LibCalls] Respect TLI.getExtAttrForI32Param() in inferLibFuncAttributes().

getExtAttrForI32Param() is the method to be used for determining the type of
extension attribute (if any) that is to be added for a signed/unsigned
argument.

Previously, the SExt attribute was always added to the i32 ldexp* argument as
it was expected to be ignored by targets not needing it. This patch now
changes this so that it is only added for the targets that need it in the
first place.

Putchar() argument is now also extended as required by the target (SystemZ in
the test), to fix the issue below. Many more libcalls will be handled
similarly in a following patch.

Fixes https://github.com/llvm/llvm-project/issues/54532.

Differential Revision: https://reviews.llvm.org/D123030

Review: Eli Friedman
llvm/lib/Transforms/Utils/BuildLibCalls.cpp
llvm/test/Transforms/InferFunctionAttrs/annotate.ll