[clang] [llvm] [LLVMAABI][AARCH64] Handle homogeneous aggregate return types (PR #218799)

Madhur Amilkanthwar via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 3 21:55:27 PDT 2026


================
@@ -127,13 +145,61 @@ ArgInfo AArch64TargetInfo::classifyArgumentType(
   }
 
   reportNYI("Aggregate argument type handling");
-  return ArgInfo::getDirect();
+  return ArgInfo::getIgnore();
 }
 
 bool AArch64TargetInfo::passAsAggregateType(const Type *Ty) const {
   // TODO: Handle SVE types. For now, they don't get through the type mapper.
   return isAggregateTypeForABI(Ty);
 }
 
+bool AArch64TargetInfo::isHomogeneousAggregateBaseType(const Type *Ty) const {
+  // Soft-float ABI: no types are homogeneous aggregates.
+  if (isSoftFloat())
+    return false;
+
+  // Homogeneous aggregates for AAPCS64 must have base types of a floating
----------------
madhur13490 wrote:

In QualTypeMapper.cpp Ln 100–101:
```
case Type::Atomic:
  return convertType(cast<AtomicType>(QT)->getValueType());
```
The mapper strips _Atomic, so `struct { _Atomic(float) a, b; }` reaches `isHomogeneousAggregateBaseType` as two plain floats and is classified as a 2-member HFA. Classic CodeGen rejects `_Atomic(float)` as an HFA base (`AtomicType` isn't a `BuiltinType`) and returns the struct as `i64.` The atomic-ness needs to be preserved (or the record rejected) so the classifier can distinguish it.



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


More information about the cfe-commits mailing list