aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-04 06:47:48 +0000
committerChris Lattner <sabre@nondot.org>2006-01-04 06:47:48 +0000
commit0511055276e36fa23421495cb790b17496909dfe (patch)
tree0d7a15cf237aaa988c6f427d2c8a3eda1a3b75bf /llvm/lib/CodeGen
parentbe45b5e9484421c4620bd1e42f8cbf0b9bb76b1e (diff)
downloadllvm-0511055276e36fa23421495cb790b17496909dfe.zip
llvm-0511055276e36fa23421495cb790b17496909dfe.tar.gz
llvm-0511055276e36fa23421495cb790b17496909dfe.tar.bz2
Add an assertion, update DefInst even though no one uses it (dangling pointers
don't help anyone) llvm-svn: 25081
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/PHIElimination.cpp4
-rw-r--r--llvm/lib/CodeGen/VirtRegMap.cpp1
2 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/PHIElimination.cpp b/llvm/lib/CodeGen/PHIElimination.cpp
index 91805a9..8441e49 100644
--- a/llvm/lib/CodeGen/PHIElimination.cpp
+++ b/llvm/lib/CodeGen/PHIElimination.cpp
@@ -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
diff --git a/llvm/lib/CodeGen/VirtRegMap.cpp b/llvm/lib/CodeGen/VirtRegMap.cpp
index 26498b7..f27ae2a 100644
--- a/llvm/lib/CodeGen/VirtRegMap.cpp
+++ b/llvm/lib/CodeGen/VirtRegMap.cpp
@@ -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);