Add an assertion, update DefInst even though no one uses it (dangling pointers
don't help anyone)
llvm-svn: 25081
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 @@
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