Skip to content

Commit ae586ec

Browse files
committed
Use m_BinOp instead of m_CommutativeBinOp
Because the way we match it, it doesn't matter whether it's commutative or not.
1 parent c05fd18 commit ae586ec

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7078,9 +7078,8 @@ bool CombinerHelper::matchSimplifyNegMinMax(MachineInstr &MI,
70787078
if (mi_match(DestReg, MRI,
70797079
m_Neg(m_OneUse(m_any_of(
70807080
m_GSMin(m_Reg(X), m_Reg(Y)), m_GSMax(m_Reg(X), m_Reg(Y)),
7081-
m_CommutativeBinOp(TargetOpcode::G_UMIN, m_Reg(X), m_Reg(Y)),
7082-
m_CommutativeBinOp(TargetOpcode::G_UMAX, m_Reg(X),
7083-
m_Reg(Y)))))) &&
7081+
m_BinOp(TargetOpcode::G_UMIN, m_Reg(X), m_Reg(Y)),
7082+
m_BinOp(TargetOpcode::G_UMAX, m_Reg(X), m_Reg(Y)))))) &&
70847083
(mi_match(Y, MRI, m_all_of(m_Neg(m_SpecificReg(X)), m_Reg(Sub0))) ||
70857084
mi_match(X, MRI, m_all_of(m_Neg(m_SpecificReg(Y)), m_Reg(Sub0))))) {
70867085
MachineInstr *MinMaxMI = MRI.getVRegDef(MI.getOperand(2).getReg());

0 commit comments

Comments
 (0)