[clang] [Sparc][clang] Match GCC's SPARC V8 vector argument passing (PR #222254)

Folkert de Vries via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 20 15:10:06 PDT 2026


================
@@ -83,6 +83,13 @@ ABIArgInfo SparcV8ABIInfo::classifyArgumentType(QualType Ty) const {
   if (const auto *CT = Ty->getAs<ComplexType>())
     return classifyComplexType(CT, /*IsRet=*/false);
 
+  // Pass floating-point vectors and vectors larger than 64 bits by reference.
+  if (const auto *VT = Ty->getAs<VectorType>()) {
+    uint64_t SizeInBits = getContext().getTypeSize(Ty);
+    if (VT->getElementType()->isRealFloatingType() || SizeInBits > 64)
+      return getNaturalAlignIndirect(Ty, getDataLayout().getAllocaAddrSpace());
+  }
+
----------------
folkertdev wrote:

This matches (my understanding of) the GCC code exactly

https://github.com/gcc-mirror/gcc/blob/549ec717abb79c26186af06e01c937b4613c79ba/gcc/config/sparc/sparc.cc#L6755-L6765

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


More information about the cfe-commits mailing list