Never add a kill flag to a constrained physical register in a two-addr instruction.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Sun, 2 Aug 2009 19:13:03 +0000 (19:13 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Sun, 2 Aug 2009 19:13:03 +0000 (19:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77906 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineInstr.cpp
test/CodeGen/Blackfin/cmp-small-imm.ll
test/CodeGen/Blackfin/promote-setcc.ll

index 4ac2896d370e3b226aed0a5e5451cba6d9854bd4..006a10a0ce69110b40d0529ec8d68e4276140efa 100644 (file)
@@ -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;
       }
index 7d87cb07f3bb62c5671e86d10895e15a805d97ea..ed285a7603648fbcaa1fd582120d994683f44eae 100644 (file)
@@ -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
index b686c542717ca46dafff539d3e335f6a9ee5e36b..585532521e7157fcc6e13e2cdaa7146b8dbe74c0 100644 (file)
@@ -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