================
@@ -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
+  // point type or a short-vector type.
+  if (Ty->isFloat())
+    return true;
+
+  if (const auto *VT = dyn_cast<VectorType>(Ty)) {
+    // TODO: Reject SVE fixed-length data/predicate vectors once the type
+    // mapper can express them.
+    uint64_t EltWidth = VT->getElementType()->getSizeInBits().getFixedValue();
+    uint64_t VecSize = std::max<uint64_t>(
+        8, EltWidth * VT->getNumElements().getKnownMinValue());
+    if (VecSize & (VecSize - 1))
+      VecSize = alignTo(VecSize, bit_ceil(VecSize));
----------------
madhur13490 wrote:

Can be simplified using llvm::bit_ceil. This is now duplicated in two places. 
Can have a shared helper.

https://github.com/llvm/llvm-project/pull/218799
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to