[llvm-commits] CVS: llvm/lib/CodeGen/VirtRegMap.cpp

Evan Cheng evan.cheng at apple.com
Fri Feb 23 13:48:07 PST 2007



Changes in directory llvm/lib/CodeGen:

VirtRegMap.cpp updated: 1.98 -> 1.99
---
Log message:

Reuse extends the liveness of a register. Transfer the kill to the operand that reuse it.

---
Diffs of the changes:  (+6 -1)

 VirtRegMap.cpp |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)


Index: llvm/lib/CodeGen/VirtRegMap.cpp
diff -u llvm/lib/CodeGen/VirtRegMap.cpp:1.98 llvm/lib/CodeGen/VirtRegMap.cpp:1.99
--- llvm/lib/CodeGen/VirtRegMap.cpp:1.98	Thu Feb 22 19:13:26 2007
+++ llvm/lib/CodeGen/VirtRegMap.cpp	Fri Feb 23 15:47:50 2007
@@ -665,8 +665,13 @@
           // 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






More information about the llvm-commits mailing list