[llvm] [AArch64] Add cost model for @experimental.vector.match (PR #118512)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 10:10:52 PST 2024


================
@@ -905,6 +905,23 @@ AArch64TTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
     }
     break;
   }
+  case Intrinsic::experimental_vector_match: {
+    EVT SearchVT = getTLI()->getValueType(DL, ICA.getArgTypes()[0]);
+    unsigned SearchSize =
+        cast<FixedVectorType>(ICA.getArgTypes()[1])->getNumElements();
+    // If we can't lower to MATCH, return an invalid cost.
+    if (getTLI()->shouldExpandVectorMatch(SearchVT, SearchSize))
+      return InstructionCost::getInvalid();
----------------
paulwalker-arm wrote:

Continuing from the above, It would be nicer to call onto the base class from here.

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


More information about the llvm-commits mailing list