[llvm] [AArch64] Add @llvm.experimental.vector.match (PR #101974)
Ricardo Jesus via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 27 08:58:55 PDT 2024
================
@@ -1352,6 +1352,11 @@ bool TargetTransformInfo::hasActiveVectorLength(unsigned Opcode, Type *DataType,
return TTIImpl->hasActiveVectorLength(Opcode, DataType, Alignment);
}
+bool TargetTransformInfo::hasVectorMatch(VectorType *VT,
+ unsigned SegSize) const {
----------------
rj-jesus wrote:
> Have you taken this approach because you believe it's simply not worth providing generic lowering due to the cost or because there is no easy way to lower this using generic ISD nodes?
The latter, in particular providing generic lowering for scalable vectors.
For fixed-length vectors we can compare the elements one by one (for example), but for scalable vectors we can't, and I couldn't find a way of lowering it easily. So whilst we could provide generic lowering for _some_ types, I don't think we could do so for _all_ types, and so we would still need to query the target for type support. In this scenario, I thought it would be reasonable to avoid the generic lowering altogether and let the targets control what types they support directly.
Do you have any better ideas for this? Can you think of a good strategy to lower this for scalable vectors?
https://github.com/llvm/llvm-project/pull/101974
More information about the llvm-commits
mailing list