aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-07-03 00:04:51 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-07-03 00:04:51 +0000
commit457b88fb95be895d914e52f3b44014a82e645e4a (patch)
treef689984fff1f4ae2521fb65982e98efd99e88448
parentf660c171c838793b87b7e58e91609cecf256378d (diff)
downloadexternal_llvm-457b88fb95be895d914e52f3b44014a82e645e4a.zip
external_llvm-457b88fb95be895d914e52f3b44014a82e645e4a.tar.gz
external_llvm-457b88fb95be895d914e52f3b44014a82e645e4a.tar.bz2
commuteInstruction should preserve dead markers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53060 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/X86InstrInfo.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Target/X86/X86InstrInfo.cpp b/lib/Target/X86/X86InstrInfo.cpp
index 969a05c..2a3f1cb 100644
--- a/lib/Target/X86/X86InstrInfo.cpp
+++ b/lib/Target/X86/X86InstrInfo.cpp
@@ -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: