[llvm] [AArch64] Add @llvm.experimental.vector.match (PR #101974)

Ricardo Jesus via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 31 08:54:27 PDT 2024


================
@@ -1771,6 +1771,11 @@ class TargetTransformInfo {
   /// This should also apply to lowering for vector funnel shifts (rotates).
   bool isVectorShiftByScalarCheap(Type *Ty) const;
 
+  /// \returns True if the target has hardware support for vector match
+  /// operations between vectors of type `VT` and search vectors of `SearchSize`
+  /// elements, and false otherwise.
+  bool hasVectorMatch(VectorType *VT, unsigned SearchSize) const;
----------------
rj-jesus wrote:

I had made it a TTI hook because I thought we'd want the transformation that uses this intrinsic to kick in only if we knew we could lower it to something like the MATCH instruction, and querying the TLI hook from the transformation didn't seem very natural.

I've now moved this to TLI since @david-arm had suggested the same thing and I agree it makes more sense for it to be there.

What do you think we should do about the transformation (in terms of querying efficient support for MATCH)?

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


More information about the llvm-commits mailing list