summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2009-08-02 19:13:03 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2009-08-02 19:13:03 +0000
commitc59cd9bcd094683529f63fde55589454fa0f7ce1 (patch)
treedbaa045bcdd05eacba0a1a6513104e45b0224c7b /llvm/lib/CodeGen/MachineInstr.cpp
parent4ab4f7f41649518a684ef340ccd77874fb56bc6e (diff)
Never add a kill flag to a constrained physical register in a two-addr instruction.
llvm-svn: 77906
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 4ac2896d370e..006a10a0ce69 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -1041,6 +1041,9 @@ bool MachineInstr::addRegisterKilled(unsigned IncomingReg,
if (MO.isKill())
// The register is already marked kill.
return true;
+ if (isPhysReg && isRegTiedToDefOperand(i))
+ // Two-address uses of physregs must not be marked kill.
+ return true;
MO.setIsKill();
Found = true;
}