summaryrefslogtreecommitdiffstats
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
parent4ab4f7f41649518a684ef340ccd77874fb56bc6e (diff)
downloadbcm5719-llvm-c59cd9bcd094683529f63fde55589454fa0f7ce1.tar.gz
bcm5719-llvm-c59cd9bcd094683529f63fde55589454fa0f7ce1.zip
Never add a kill flag to a constrained physical register in a two-addr instruction.
llvm-svn: 77906
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp3
-rw-r--r--llvm/test/CodeGen/Blackfin/cmp-small-imm.ll3
-rw-r--r--llvm/test/CodeGen/Blackfin/promote-setcc.ll3
3 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 4ac2896d370..006a10a0ce6 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;
}
diff --git a/llvm/test/CodeGen/Blackfin/cmp-small-imm.ll b/llvm/test/CodeGen/Blackfin/cmp-small-imm.ll
index 7d87cb07f3b..ed285a76036 100644
--- a/llvm/test/CodeGen/Blackfin/cmp-small-imm.ll
+++ b/llvm/test/CodeGen/Blackfin/cmp-small-imm.ll
@@ -1,7 +1,4 @@
; RUN: llvm-as < %s | llc -march=bfin > %t
-; XFAIL: *
-; Assertion failed: (isUsed(Reg) && "Using an undefined register!")
-; function forward, file RegisterScavenging.cpp, line 259.
define i1 @cmp3(i32 %A) {
%R = icmp uge i32 %A, 2
diff --git a/llvm/test/CodeGen/Blackfin/promote-setcc.ll b/llvm/test/CodeGen/Blackfin/promote-setcc.ll
index b686c542717..585532521e7 100644
--- a/llvm/test/CodeGen/Blackfin/promote-setcc.ll
+++ b/llvm/test/CodeGen/Blackfin/promote-setcc.ll
@@ -1,7 +1,4 @@
; RUN: llvm-as < %s | llc -march=bfin > %t
-; XFAIL: *
-; Assertion failed: (isUsed(Reg) && "Using an undefined register!"),
-; function forward, file RegisterScavenging.cpp, line 259.
; The DAG combiner may sometimes create illegal i16 SETCC operations when run
; after LegalizeOps. Try to tease out all the optimizations in
OpenPOWER on IntegriCloud