[llvm] [AArch64] Add costs of Promoted types for compressstore (PR #220257)

Jack Styles via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 14 05:43:55 PDT 2026


================
@@ -356,6 +356,20 @@ class AArch64TTIImpl final : public BasicTTIImplBase<AArch64TTIImpl> {
         DataType->getPrimitiveSizeInBits() < 128)
       return false;
 
+    if (!isa<VectorType>(DataType))
+      return isElementTypeLegalForScalableVector(DataType);
+
+    // For types where Promotion is possible to i32/i64 types and SME2p2/SVE2p2
+    // is not available, ensure the promoted scalar type is legal.
+    if (is_contained({8u, 16u}, DataType->getScalarSizeInBits()) &&
+        !(ST->hasSVE2p2() && ST->hasSME2p2()) &&
+        DataType->getPrimitiveSizeInBits().getKnownMinValue() < 128) {
+      auto LT = getTypeLegalizationCost(DataType);
+      if (!LT.first.isValid())
+        return false;
+      DataType = EVT(LT.second).getTypeForEVT(DataType->getContext());
----------------
Stylie777 wrote:

I've updated this to allow for these lowering paths.

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


More information about the llvm-commits mailing list