[llvm] [InstCombine] Don't reuse a sibling binop with extra flags via demanded elts (#199782) (PR #201545)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 4 09:21:48 PDT 2026


================
@@ -1993,7 +2013,7 @@ Value *InstCombinerImpl::SimplifyDemandedVectorElts(Value *V,
                         ? match(U, m_BinOp(Opcode, Shuf, m_Specific(OtherOp)))
                         : match(U, m_BinOp(Opcode, m_Specific(OtherOp), Shuf)))
             if (match(Mask, m_ZeroMask()) && Mask[0] != PoisonMaskElem)
-              if (DT.dominates(U, I))
+              if (DT.dominates(U, I) && flagsSubsumedByBO(U))
----------------
dtcxzyw wrote:

Can we use `andIRFlags` to mask out poison-generating flags? I don't like to introduce a new place to maintain the list of flags :(


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


More information about the llvm-commits mailing list