Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions llvm/lib/IR/Instruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -942,14 +942,13 @@ bool Instruction::isIdenticalToWhenDefined(const Instruction *I,

// We have two instructions of identical opcode and #operands. Check to see
// if all operands are the same.
if (!std::equal(op_begin(), op_end(), I->op_begin()))
if (!equal(operands(), I->operands()))
return false;

// WARNING: this logic must be kept in sync with EliminateDuplicatePHINodes()!
if (const PHINode *thisPHI = dyn_cast<PHINode>(this)) {
const PHINode *otherPHI = cast<PHINode>(I);
return std::equal(thisPHI->block_begin(), thisPHI->block_end(),
otherPHI->block_begin());
if (const PHINode *Phi = dyn_cast<PHINode>(this)) {
const PHINode *OtherPhi = cast<PHINode>(I);
return equal(Phi->blocks(), OtherPhi->blocks());
}

return this->hasSameSpecialState(I, /*IgnoreAlignment=*/false,
Expand Down