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

Ricardo Jesus via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 10 03:32:17 PST 2024


================
@@ -905,6 +905,24 @@ AArch64TTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
     }
     break;
   }
+  case Intrinsic::experimental_vector_match: {
+    if (auto *NeedleTy = dyn_cast<FixedVectorType>(ICA.getArgTypes()[1])) {
----------------
rj-jesus wrote:

Without the type check that line was running into a segfault when called from [here](https://github.com/llvm/llvm-project/blob/53e9eee0e2c9587fc7a1e7b5f64ba2a935f58e0a/llvm/include/llvm/CodeGen/BasicTTIImpl.h#L2024-L2026). It wasn't obvious to me I was missing anything elsewhere, so I thought guarding the case was the correct way of approaching this. Did I miss anything elsewhere?

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


More information about the llvm-commits mailing list