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

Chris Lattner lattner at cs.uiuc.edu
Sat Sep 2 17:06:22 PDT 2006



Changes in directory llvm/lib/CodeGen:

RegAllocLocal.cpp updated: 1.86 -> 1.87
---
Log message:

When deleting a machine instruction, make sure to remove it from the 
livevariables information.  This fixes several regalloc=local failures on x86


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

 RegAllocLocal.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)


Index: llvm/lib/CodeGen/RegAllocLocal.cpp
diff -u llvm/lib/CodeGen/RegAllocLocal.cpp:1.86 llvm/lib/CodeGen/RegAllocLocal.cpp:1.87
--- llvm/lib/CodeGen/RegAllocLocal.cpp:1.86	Sun Aug 27 07:54:01 2006
+++ llvm/lib/CodeGen/RegAllocLocal.cpp	Sat Sep  2 19:06:08 2006
@@ -659,8 +659,11 @@
     
     // Finally, if this is a noop copy instruction, zap it.
     unsigned SrcReg, DstReg;
-    if (TII.isMoveInstr(*MI, SrcReg, DstReg) && SrcReg == DstReg)
+    if (TII.isMoveInstr(*MI, SrcReg, DstReg) && SrcReg == DstReg) {
+      LV->removeVirtualRegistersKilled(MI);
+      LV->removeVirtualRegistersDead(MI);
       MBB.erase(MI);
+    }
   }
 
   MachineBasicBlock::iterator MI = MBB.getFirstTerminator();






More information about the llvm-commits mailing list