X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FAnalysis%2FValueNumbering.cpp;h=53d70e84b5732704b0b70e4a541724e844ed8683;hb=c53544af06acf3fba1788613a364f1f40317869e;hp=519d9dbf97f08656b4a1d34b9be0919a53949665;hpb=c3a388143bad475aa0a565db3a2401cfc1df7273;p=oota-llvm.git diff --git a/lib/Analysis/ValueNumbering.cpp b/lib/Analysis/ValueNumbering.cpp index 519d9dbf97f..53d70e84b57 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;