OSDN Git Service

Reuse extends the liveness of a register. Transfer the kill to the operand that reuse it.
authorEvan Cheng <evan.cheng@apple.com>
Fri, 23 Feb 2007 21:47:50 +0000 (21:47 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 23 Feb 2007 21:47:50 +0000 (21:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34536 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/VirtRegMap.cpp

index c1d6ee7..4f1230c 100644 (file)
@@ -665,8 +665,13 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM) {
           // Extend the live range of the MI that last kill the register if
           // necessary.
           MachineOperand *MOK = SSMI->findRegisterUseOperand(PhysReg, true);
-          if (MOK)
+          if (MOK) {
             MOK->unsetIsKill();
+            if (ti == -1)
+              // Unless it's the use of a two-address code, transfer the kill
+              // of the reused register to this use.
+              MI.getOperand(i).setIsKill();
+          }
 
           // The only technical detail we have is that we don't know that
           // PhysReg won't be clobbered by a reloaded stack slot that occurs