[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
Fri Oct 16 06:02:08 PDT 2026


================
@@ -2385,8 +2397,8 @@ ABIArgInfo X86_64ABIInfo::getIndirectReturnResult(QualType Ty) const {
       return getNaturalAlignIndirect(Ty, getDataLayout().getAllocaAddrSpace());
 
     llvm::Type *IRTy = CGT.ConvertType(Ty);
-    return (isPromotableIntegerTypeForABI(Ty) ? ABIArgInfo::getExtend(Ty, IRTy)
-                                              : ABIArgInfo::getDirect(IRTy));
+    return shouldExtendReturnType(*this, Ty) ? ABIArgInfo::getExtend(Ty, IRTy)
+                                             : ABIArgInfo::getDirect(IRTy);
----------------
nikic wrote:

If you're wondering how a promotable integer type could possibly end up on the indirect return code path, the answer is https://github.com/llvm/llvm-project/issues/232670.

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


More information about the cfe-commits mailing list