Add verification that deleted instruction isn't hiding in the PHI map.

llvm-svn: 61350
This commit is contained in:
Bill Wendling 2008-12-22 22:14:07 +00:00
parent ac1c0d7f13
commit e42e5a263b

View File

@ -1581,6 +1581,7 @@ bool GVN::performPRE(Function& F) {
// are not value numbered precisely.
if (!success) {
delete PREInstr;
DEBUG(verifyRemoved(PREInstr));
continue;
}
@ -1659,4 +1660,16 @@ void GVN::cleanupGlobalSets() {
/// internal data structures.
void GVN::verifyRemoved(const Instruction *I) const {
VN.verifyRemoved(I);
// Walk through the PHI map to make sure the instruction isn't hiding in there
// somewhere.
for (PhiMapType::iterator
II = phiMap.begin(), IE = phiMap.end(); II != IE; ++II) {
assert(II->first != I && "Inst is still a key in PHI map!");
for (SmallPtrSet<Instruction*, 4>::iterator
SI = II->second.begin(), SE = II->second.end(); SI != SE; ++SI) {
assert(*SI != I && "Inst is still a value in PHI map!");
}
}
}