Check that the instruction isn't in the value numbering scope.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61353 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2008-12-22 22:28:56 +00:00
parent 75f02ee771
commit 6d463f2efc

View File

@ -1635,18 +1635,34 @@ void GVN::cleanupGlobalSets() {
/// verifyRemoved - Verify that the specified instruction does not occur in our
/// internal data structures.
void GVN::verifyRemoved(const Instruction *I) const {
VN.verifyRemoved(I);
void GVN::verifyRemoved(const Instruction *Inst) const {
VN.verifyRemoved(Inst);
// 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!");
I = phiMap.begin(), E = phiMap.end(); I != E; ++I) {
assert(I->first != Inst && "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!");
II = I->second.begin(), IE = I->second.end(); II != IE; ++II) {
assert(*II != Inst && "Inst is still a value in PHI map!");
}
}
// Walk through the value number scope to make sure the instruction isn't
// ferreted away in it.
for (DenseMap<BasicBlock*, ValueNumberScope*>::iterator
I = localAvail.begin(), E = localAvail.end(); I != E; ++I) {
const ValueNumberScope *VNS = I->second;
while (VNS) {
for (DenseMap<uint32_t, Value*>::iterator
II = VNS->table.begin(), IE = VNS->table.end(); II != IE; ++II) {
assert(II->second != Inst && "Inst still in value numbering scope!");
}
VNS = VNS->parent;
}
}
}