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

Ricardo Jesus via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 08:01:24 PDT 2024


rj-jesus wrote:

Hi @david-arm, thank you for your feedback, any help to make the intrinsic more general and to simplify it is very welcome! Your example is very close to what I had in mind: in general the bounds of the `search` array don't have to be known at compile time, but other than that, that's the idea.

For such cases, indeed we don't need multiple search segments. They are currently there to facilitate the efficient lowering to MATCH, but if we wanted to remove them we could:
1. Only implement the intrinsic for fixed-length vectors.
2. Restrict the second argument (the search array) to fixed-length, but let the other vector arguments be fixed or scalable. 

The comparisons would be performed in an "all-to-all" fashion in either case.

The reason I didn't implement this to begin with is that this can make lowering slightly less efficient. For example, for the second option, we'd need to do a broadcast before doing a MATCH, but we can work around this separately if needed.

Is either of these options what you had in mind? 

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


More information about the llvm-commits mailing list