//===- ValueNumbering.cpp - Value #'ing Implementation ----------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
//
// This file implements the non-abstract Value Numbering methods as well as a
// default implementation for the analysis group.
// Check to see if this new cast is not I, but has the same operand...
if (Other != &I && Other->getOpcode() == I.getOpcode() &&
Other->getOperand(0) == Op && // Is the operand the same?
- // Is it embeded in the same function? (This could be false if LHS
+ // Is it embedded in the same function? (This could be false if LHS
// is a constant or global!)
Other->getParent()->getParent() == F &&
//
static inline bool isIdenticalBinaryInst(const Instruction &I1,
const Instruction *I2) {
- // Is it embeded in the same function? (This could be false if LHS
+ // Is it embedded in the same function? (This could be false if LHS
// is a constant or global!)
if (I1.getOpcode() != I2->getOpcode() ||
I1.getParent()->getParent() != I2->getParent()->getParent())
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;