[clang] [Clang][AArch64] Fix Pure Scalables Types argument passing and return (PR #112747)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 23 13:29:33 PDT 2024


================
@@ -303,6 +368,20 @@ AArch64ABIInfo::classifyArgumentType(QualType Ty, bool IsVariadic,
       if (EIT->getNumBits() > 128)
         return getNaturalAlignIndirect(Ty, false);
 
+    if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) {
+      if (BT->isSVEBool() || BT->isSVECount())
+        NPRN = std::min(NPRN + 1, 4u);
+      else if (BT->getKind() == BuiltinType::SveBoolx2)
+        NPRN = std::min(NPRN + 2, 4u);
+      else if (BT->getKind() == BuiltinType::SveBoolx4)
+        NPRN = std::min(NPRN + 4, 4u);
+      else if (BT->isFloatingPoint() || BT->isVectorType())
----------------
efriedma-quic wrote:

`BT->isVectorType()` is always false, by definition: it's just `isa<VectorType>()`, and a BuiltinType can't be a VectorType.

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


More information about the cfe-commits mailing list