When opcodes like ADD were split into reg. and immed. versions (ADDi and ADDr),

this code wasn't fixed correctly so it missed copy operations that used ADDi.

llvm-svn: 9318
This commit is contained in:
Vikram S. Adve 2003-10-21 12:29:45 +00:00
parent abf40e897c
commit b289dff9a8

View File

@ -63,7 +63,8 @@ static bool IsUselessCopy(const TargetMachine &target, const MachineInstr* MI) {
return (/* both operands are allocated to the same register */
MI->getOperand(0).getAllocatedRegNum() ==
MI->getOperand(1).getAllocatedRegNum());
} else if (MI->getOpCode() == V9::ADDr || MI->getOpCode() == V9::ORr) {
} else if (MI->getOpCode() == V9::ADDr || MI->getOpCode() == V9::ORr ||
MI->getOpCode() == V9::ADDi || MI->getOpCode() == V9::ORi) {
unsigned srcWithDestReg;
for (srcWithDestReg = 0; srcWithDestReg < 2; ++srcWithDestReg)