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

Chris Lattner lattner at cs.uiuc.edu
Tue Jan 3 22:48:00 PST 2006



Changes in directory llvm/lib/CodeGen:

PHIElimination.cpp updated: 1.39 -> 1.40
VirtRegMap.cpp updated: 1.42 -> 1.43
---
Log message:

Add an assertion, update DefInst even though no one uses it (dangling pointers
don't help anyone)


---
Diffs of the changes:  (+5 -0)

 PHIElimination.cpp |    4 ++++
 VirtRegMap.cpp     |    1 +
 2 files changed, 5 insertions(+)


Index: llvm/lib/CodeGen/PHIElimination.cpp
diff -u llvm/lib/CodeGen/PHIElimination.cpp:1.39 llvm/lib/CodeGen/PHIElimination.cpp:1.40
--- llvm/lib/CodeGen/PHIElimination.cpp:1.39	Mon Oct  3 02:22:07 2005
+++ llvm/lib/CodeGen/PHIElimination.cpp	Wed Jan  4 00:47:48 2006
@@ -145,6 +145,10 @@
       LV->addVirtualRegisterDead(DestReg, PHICopy);
       LV->removeVirtualRegistersDead(MPhi);
     }
+    
+    // Realize that the destination register is defined by the PHI copy now, not
+    // the PHI itself.
+    LV->getVarInfo(DestReg).DefInst = PHICopy;
   }
 
   // Adjust the VRegPHIUseCount map to account for the removal of this PHI


Index: llvm/lib/CodeGen/VirtRegMap.cpp
diff -u llvm/lib/CodeGen/VirtRegMap.cpp:1.42 llvm/lib/CodeGen/VirtRegMap.cpp:1.43
--- llvm/lib/CodeGen/VirtRegMap.cpp:1.42	Thu Oct  6 12:19:06 2005
+++ llvm/lib/CodeGen/VirtRegMap.cpp	Wed Jan  4 00:47:48 2006
@@ -393,6 +393,7 @@
       
       // Otherwise, reload it and remember that we have it.
       PhysReg = VRM.getPhys(VirtReg);
+      assert(PhysReg && "Must map virtreg to physreg!");
       const TargetRegisterClass* RC =
         MBB.getParent()->getSSARegMap()->getRegClass(VirtReg);
 






More information about the llvm-commits mailing list