[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:31:31 PDT 2026


================
@@ -390,15 +388,19 @@ Instruction *InstCombinerImpl::simplifyMaskedScatter(IntrinsicInst &II) {
   if (!ConstMask)
     return nullptr;
 
-  // If the mask is all zeros or poison, a scatter does nothing.
-  if (match(ConstMask, m_ZeroOrPoison()))
+  // If the mask is all zeros, a scatter does nothing.
+  if (maskIsAllZeroOrUndef(ConstMask))
     return eraseInstFromFunction(II);
 
   // Vector splat address -> scalar store
   if (auto *SplatPtr = getSplatValue(II.getArgOperand(1))) {
     // scatter(splat(value), splat(ptr), non-zero-mask) -> store value, ptr
     if (auto *SplatValue = getSplatValue(II.getArgOperand(0))) {
-      if (maskContainsAllOneOrUndef(ConstMask)) {
+      // non-zero-mask if at least one lane of the mask can be assumed active
----------------
artagnon wrote:

Hm, seems like a stray change?

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


More information about the llvm-commits mailing list