mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-06 04:09:04 +00:00
Give Instruction::isSameOperationAs a corresponding comment to note
the relationship with MergeFunctions.cpp's isEquivalentOperation, and make a trivial code reordering so that the two functions are easier to compare. Fix the name of Instruction::isSameOperationAs in MergeFunction.cpp's isEquivalentOperation's comment, and fix a nearby 80-column violation. llvm-svn: 73241
This commit is contained in:
parent
b5be21ef41
commit
43f66023c3
@ -180,8 +180,9 @@ static bool isEquivalentType(const Type *Ty1, const Type *Ty2) {
|
|||||||
|
|
||||||
/// isEquivalentOperation - determine whether the two operations are the same
|
/// isEquivalentOperation - determine whether the two operations are the same
|
||||||
/// except that pointer-to-A and pointer-to-B are equivalent. This should be
|
/// except that pointer-to-A and pointer-to-B are equivalent. This should be
|
||||||
/// kept in sync with Instruction::isSameOperandAs.
|
/// kept in sync with Instruction::isSameOperationAs.
|
||||||
static bool isEquivalentOperation(const Instruction *I1, const Instruction *I2) {
|
static bool
|
||||||
|
isEquivalentOperation(const Instruction *I1, const Instruction *I2) {
|
||||||
if (I1->getOpcode() != I2->getOpcode() ||
|
if (I1->getOpcode() != I2->getOpcode() ||
|
||||||
I1->getNumOperands() != I2->getNumOperands() ||
|
I1->getNumOperands() != I2->getNumOperands() ||
|
||||||
!isEquivalentType(I1->getType(), I2->getType()))
|
!isEquivalentType(I1->getType(), I2->getType()))
|
||||||
|
@ -218,9 +218,12 @@ bool Instruction::isIdenticalTo(const Instruction *I) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// isSameOperationAs
|
// isSameOperationAs
|
||||||
|
// This should be kept in sync with isEquivalentOperation in
|
||||||
|
// lib/Transforms/IPO/MergeFunctions.cpp.
|
||||||
bool Instruction::isSameOperationAs(const Instruction *I) const {
|
bool Instruction::isSameOperationAs(const Instruction *I) const {
|
||||||
if (getOpcode() != I->getOpcode() || getType() != I->getType() ||
|
if (getOpcode() != I->getOpcode() ||
|
||||||
getNumOperands() != I->getNumOperands())
|
getNumOperands() != I->getNumOperands() ||
|
||||||
|
getType() != I->getType())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// We have two instructions of identical opcode and #operands. Check to see
|
// We have two instructions of identical opcode and #operands. Check to see
|
||||||
|
Loading…
x
Reference in New Issue
Block a user