From ece48185168ab130b1777feb86d9e3fe80eb87d2 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Sun, 2 Aug 2009 19:13:03 +0000 Subject: Never add a kill flag to a constrained physical register in a two-addr instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77906 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MachineInstr.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/CodeGen/MachineInstr.cpp') diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 4ac2896d37..006a10a0ce 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/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; } -- cgit v1.2.3-70-g09d2