aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/ValueNumbering.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-10-31 04:20:07 +0000
committerChris Lattner <sabre@nondot.org>2002-10-31 04:20:07 +0000
commitf37c34430dd72b1d38c2207cce436ed1612b9995 (patch)
tree0d0f9c0d4f382b567a1c47d91ff69f83b5f0574b /lib/Analysis/ValueNumbering.cpp
parentf2da7241f590aaae128ecce7732c6094084df2b6 (diff)
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
Diffstat (limited to 'lib/Analysis/ValueNumbering.cpp')
-rw-r--r--lib/Analysis/ValueNumbering.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/Analysis/ValueNumbering.cpp b/lib/Analysis/ValueNumbering.cpp
index 519d9dbf97..53d70e84b5 100644
--- a/lib/Analysis/ValueNumbering.cpp
+++ b/lib/Analysis/ValueNumbering.cpp
@@ -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;