[PATCH] D123198: [LibCalls] Add argument extension attributes to more functions.

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 9 02:56:20 PDT 2022


jonpa added a comment.

In D123198#3440759 <https://reviews.llvm.org/D123198#3440759>, @xbolva00 wrote:

>>> 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.
>
> So required? required for correctness? Then is this right place to add them? With -O0, you will not get these attributes, no?

Yes, required for correctness. The SystemZ ABI says that any integer argument less than 64 bits should be extended as appropriate (sext/zext) by the caller. If this is not done, wrong-code may result, and it has nothing to do with optimization levels.
See https://reviews.llvm.org/D112942 with (link to) discussion.


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

https://reviews.llvm.org/D123198



More information about the llvm-commits mailing list