[llvm] [IR][NFC] Introduce Constant::containsMatchingVectorElement and corresponding matcher (PR #200502)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 5 09:16:50 PDT 2026


================

----------------
artagnon wrote:

Okay, so if the mask is Constant, and of either FixedVector or ScalableVector types (it cannot be of any other type in the usages), it must be a splat value -- in the case of FixedVectorType, checking each value is equivalent to checking splat, and it is non-functional, and in the case of ScalableVectorType, there is no way to check each element, and checking the splat would be equivalent to casting it to a constant and performing a widened check. In all the callsites, we only check zero/allones/undef, which would hold identically for the splat value or the widened constant of type ConstantData?

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


More information about the llvm-commits mailing list