commuteInstruction should preserve dead markers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53060 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2008-07-03 00:04:51 +00:00
parent f660c171c8
commit 457b88fb95

View File

@ -1214,6 +1214,7 @@ X86InstrInfo::commuteInstruction(MachineInstr *MI, bool NewMI) const {
unsigned A = MI->getOperand(0).getReg();
unsigned B = MI->getOperand(1).getReg();
unsigned C = MI->getOperand(2).getReg();
bool AisDead = MI->getOperand(0).isDead();
bool BisKill = MI->getOperand(1).isKill();
bool CisKill = MI->getOperand(2).isKill();
// If machine instrs are no longer in two-address forms, update
@ -1225,7 +1226,8 @@ X86InstrInfo::commuteInstruction(MachineInstr *MI, bool NewMI) const {
A = C;
CisKill = false;
}
return BuildMI(get(Opc), A).addReg(C, false, false, CisKill)
return BuildMI(get(Opc)).addReg(A, true, false, false, AisDead)
.addReg(C, false, false, CisKill)
.addReg(B, false, false, BisKill).addImm(Size-Amt);
}
case X86::CMOVB16rr: