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

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 28 07:54:50 PDT 2024


paulwalker-arm wrote:

Sorry I'm late to the conversation but please can you elaborate on the need for a dedicated intrinsic?  The default expansion for the ISD node shows LLVM IR can already represent the logic using a handful of existing operations.  I concede "handful" starts to breakdown as the needle vector grows but are you anticipating such larger needle vectors that would make the IR matching hard?

A better path forward is to add the LLVM transformation you're interested in first using stock LLVM IR and let the existing optimisers at it, which will provide the necessary context for any next steps.  For example, the proposed intrinsic requires a fixed length needle vector and my immediate thought was if making the needle a scalar would be sufficient to simplify the IR so that it can be matched to the desired instruction (assuming the IR from step 1 isn't already simple enough to match).

My worry here is that it looks like we're starting with the desired instruction and working backwards in a way that, to my eye,  still looks target specific. So whilst I'm not against having a dedicated intrinsic I'd like to ensure it is absolutely necessary and is as relaxed/simple as possible.

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


More information about the llvm-commits mailing list