[clang] [llvm] [SystemZ] Do not extend integer arguments in z/OS XPLINK64 ABI (PR #206833)
Ulrich Weigand via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 10 07:02:18 PDT 2026
================
@@ -825,9 +822,17 @@ ABIArgInfo ZOSXPLinkABIInfo::classifyArgumentType(QualType Ty, bool IsNamedArg,
return getNaturalAlignIndirect(Ty, getDataLayout().getAllocaAddrSpace(),
RAA == CGCXXABI::RAA_DirectInMemory);
- // Integers and enums are extended to full register width.
- if (isPromotableIntegerTypeForABI(Ty))
- return ABIArgInfo::getExtend(Ty, CGT.ConvertType(Ty));
+ // Sub-64-bit integer arguments undergo normal C integer promotion (8/16-bit
+ // types are widened to 32 bits) but are NOT sign- or zero-extended to 64
----------------
uweigand wrote:
I'm not sure I understand this comment. "C integer promotion" only applies to unnamed arguments in a variable argument list. Named arguments are not promoted as such during argument passing (they may *get* promoted later when the argument is *used*).
In particular "char" and "short" will be passed at the IR level as `i8` and `i16`, which are *not* guaranteed to be extended to 32 bits. (Often they will happen to be, but it's not actually guaranteed.) So the real question is whether the XPLINK API *requires* that "char" and "short" are extended to 32 bit when passed as argument, or not.
https://github.com/llvm/llvm-project/pull/206833
More information about the cfe-commits
mailing list