[clang] [llvm] [Clang][ABI][X86] Do not emit zeroext/signext for return values (PR #232729)
Nikita Popov via cfe-commits
cfe-commits at lists.llvm.org
Sun Oct 18 04:10:35 PDT 2026
nikic wrote:
> Does i2~i7 follow the same rule?
Not sure if I understand what you're asking here, but the psABI specifies the `_BitInt` is never extended, including for types < 8 bit. `bool` and `unsigned _BitInt(1)` do not use the same psABI. The former zero-extends to 8 bits, the latter has all high bits unspecified.
> Does this change i32/i64 type or not? Is it limited to _BitInt(N) where N < 32?
The latter. Types >= 32 bit never used zeroext/signext.
> Sounds like if we exclude _BitInt type in the patch, it can be an NFC change?
Yes. I can split this into two changes if preferred. I thought doing these together is cleaner, as the current _BitInt behavior is just a consequence of different treatment between legal and illegal types in the backend.
> What about when passing the result immediately as an argument?
As we currently (incorrectly require extension for arguments, I'd expect passing a return value directly to an argument will insert an extension (for types < 32 bit). Though this is not new, except for the `_BitInt` case.
https://github.com/llvm/llvm-project/pull/232729
More information about the cfe-commits
mailing list