[llvm-commits] CVS: llvm/lib/Analysis/ValueNumbering.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Oct 30 22:21:00 PST 2002


Changes in directory llvm/lib/Analysis:

ValueNumbering.cpp updated: 1.3 -> 1.4

---
Log message:

Use new isCommutative interface, which gives us SetEQ and SetNE for free.
Thanks fly out to Casey Carter for this fix.


---
Diffs of the changes:

Index: llvm/lib/Analysis/ValueNumbering.cpp
diff -u llvm/lib/Analysis/ValueNumbering.cpp:1.3 llvm/lib/Analysis/ValueNumbering.cpp:1.4
--- llvm/lib/Analysis/ValueNumbering.cpp:1.3	Wed Sep 25 17:27:25 2002
+++ llvm/lib/Analysis/ValueNumbering.cpp	Wed Oct 30 22:20:07 2002
@@ -129,16 +129,12 @@
       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;





More information about the llvm-commits mailing list