[clang] [AMDGPU] Stop coercing structs with FP and int fields to integer arrays (PR #185083)

Shilei Tian via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 15 08:23:58 PDT 2026


================
@@ -246,21 +312,28 @@ ABIArgInfo AMDGPUABIInfo::classifyArgumentType(QualType Ty, bool Variadic,
         RD && RD->hasFlexibleArrayMember())
       return DefaultABIInfo::classifyArgumentType(Ty);
 
-    // Pack aggregates <= 8 bytes into single VGPR or pair.
+    // Pack aggregates <= 8 bytes into single VGPR or pair, but only if they
+    // contain sub-32-bit integer types. Aggregates with floats or full-sized
+    // integers (i32, i64) should preserve their original types.
     uint64_t Size = getContext().getTypeSize(Ty);
     if (Size <= 64) {
-      unsigned NumRegs = (Size + 31) / 32;
-      NumRegsLeft -= std::min(NumRegsLeft, NumRegs);
+      const auto *RD = Ty->getAsRecordDecl();
----------------
shiltian wrote:

same here

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


More information about the cfe-commits mailing list