1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

Use new isCommutative interface, which gives us SetEQ and SetNE for free.

Thanks fly out to Casey Carter for this fix.

llvm-svn: 4460
This commit is contained in:
Chris Lattner 2002-10-31 04:20:07 +00:00
parent 2ce9a55285
commit d4c9998d7a

View File

@ -129,16 +129,12 @@ static inline bool isIdenticalBinaryInst(const Instruction &I1,
I1.getOperand(1) == I2->getOperand(1))
return true;
// If the instruction is commutative and associative, the instruction can
// match if the operands are swapped!
// If the instruction is commutative, the instruction can match if the
// operands are swapped!
//
if ((I1.getOperand(0) == I2->getOperand(1) &&
I1.getOperand(1) == I2->getOperand(0)) &&
(I1.getOpcode() == Instruction::Add ||
I1.getOpcode() == Instruction::Mul ||
I1.getOpcode() == Instruction::And ||
I1.getOpcode() == Instruction::Or ||
I1.getOpcode() == Instruction::Xor))
I1.isCommutative())
return true;
return false;