Skip to content

Commit ddd1153

Browse files
committed
[InstCombine] Match poison instead of undef in binop of same-mask shuffle fold
1 parent 8a233d8 commit ddd1153

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/InstCombine/InstructionCombining.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,8 +1728,8 @@ Instruction *InstCombinerImpl::foldVectorBinop(BinaryOperator &Inst) {
17281728

17291729
// If both arguments of the binary operation are shuffles that use the same
17301730
// mask and shuffle within a single vector, move the shuffle after the binop.
1731-
if (match(LHS, m_Shuffle(m_Value(V1), m_Undef(), m_Mask(Mask))) &&
1732-
match(RHS, m_Shuffle(m_Value(V2), m_Undef(), m_SpecificMask(Mask))) &&
1731+
if (match(LHS, m_Shuffle(m_Value(V1), m_Poison(), m_Mask(Mask))) &&
1732+
match(RHS, m_Shuffle(m_Value(V2), m_Poison(), m_SpecificMask(Mask))) &&
17331733
V1->getType() == V2->getType() &&
17341734
(LHS->hasOneUse() || RHS->hasOneUse() || LHS == RHS)) {
17351735
// Op(shuffle(V1, Mask), shuffle(V2, Mask)) -> shuffle(Op(V1, V2), Mask)

0 commit comments

Comments
 (0)