mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-14 15:28:20 +00:00
Use new isCommutative interface, which gives us SetEQ and SetNE for free.
Thanks fly out to Casey Carter for this fix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4460 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -129,16 +129,12 @@ static inline bool isIdenticalBinaryInst(const Instruction &I1,
|
|||||||
I1.getOperand(1) == I2->getOperand(1))
|
I1.getOperand(1) == I2->getOperand(1))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// If the instruction is commutative and associative, the instruction can
|
// If the instruction is commutative, the instruction can match if the
|
||||||
// match if the operands are swapped!
|
// operands are swapped!
|
||||||
//
|
//
|
||||||
if ((I1.getOperand(0) == I2->getOperand(1) &&
|
if ((I1.getOperand(0) == I2->getOperand(1) &&
|
||||||
I1.getOperand(1) == I2->getOperand(0)) &&
|
I1.getOperand(1) == I2->getOperand(0)) &&
|
||||||
(I1.getOpcode() == Instruction::Add ||
|
I1.isCommutative())
|
||||||
I1.getOpcode() == Instruction::Mul ||
|
|
||||||
I1.getOpcode() == Instruction::And ||
|
|
||||||
I1.getOpcode() == Instruction::Or ||
|
|
||||||
I1.getOpcode() == Instruction::Xor))
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user