diff options
author | Chris Lattner <sabre@nondot.org> | 2002-10-31 04:20:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-10-31 04:20:07 +0000 |
commit | d1998c4aeae8dfb5ae4d1f416a1f8c105787c597 (patch) | |
tree | 61ae008dc1010d9c4441139949d605362175853b /llvm/lib/Analysis/ValueNumbering.cpp | |
parent | cab6c33811fa7ab32cc5e830f97cd79d666f83a2 (diff) | |
download | bcm5719-llvm-d1998c4aeae8dfb5ae4d1f416a1f8c105787c597.tar.gz bcm5719-llvm-d1998c4aeae8dfb5ae4d1f416a1f8c105787c597.zip |
Use new isCommutative interface, which gives us SetEQ and SetNE for free.
Thanks fly out to Casey Carter for this fix.
llvm-svn: 4460
Diffstat (limited to 'llvm/lib/Analysis/ValueNumbering.cpp')
-rw-r--r-- | llvm/lib/Analysis/ValueNumbering.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/ValueNumbering.cpp b/llvm/lib/Analysis/ValueNumbering.cpp index 519d9dbf97f..53d70e84b57 100644 --- a/llvm/lib/Analysis/ValueNumbering.cpp +++ b/llvm/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; |