Add an assertion, update DefInst even though no one uses it (dangling pointers
authorChris Lattner <sabre@nondot.org>
Wed, 4 Jan 2006 06:47:48 +0000 (06:47 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 4 Jan 2006 06:47:48 +0000 (06:47 +0000)
don't help anyone)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25081 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/PHIElimination.cpp
lib/CodeGen/VirtRegMap.cpp

index 91805a93edf3d909b43aa48cb92229b227c4a042..8441e49bbc66cfac1958cdd004140bfe6e51025f 100644 (file)
@@ -145,6 +145,10 @@ void PNE::LowerAtomicPHINode(MachineBasicBlock &MBB,
       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 26498b7ec1fcb0c3d73cdcafecfdb84f58e3adb2..f27ae2a8212a2a5518ff5360c3c11abfc966f7a9 100644 (file)
@@ -393,6 +393,7 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, const VirtRegMap &VRM) {
       
       // 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);