/// verifyRemoved - Verify that the value is removed from all internal data
/// structures.
void GVNPass::ValueTable::verifyRemoved(const Value *V) const {
- for (DenseMap<Value*, uint32_t>::const_iterator
- I = valueNumbering.begin(), E = valueNumbering.end(); I != E; ++I) {
- assert(I->first != V && "Inst still occurs in value numbering map!");
- }
+ assert(!valueNumbering.contains(V) &&
+ "Inst still occurs in value numbering map!");
}
//===----------------------------------------------------------------------===//
replaceValuesPerBlockEntry(ValuesPerBlock, OldLoad, NewLoad);
if (uint32_t ValNo = VN.lookup(OldLoad, false))
removeFromLeaderTable(ValNo, OldLoad, OldLoad->getParent());
+ VN.erase(OldLoad);
removeInstruction(OldLoad);
}
}
PREInstr = CurInst->clone();
if (!performScalarPREInsertion(PREInstr, PREPred, CurrentBlock, ValNo)) {
// If we failed insertion, make sure we remove the instruction.
- LLVM_DEBUG(verifyRemoved(PREInstr));
+#ifndef NDEBUG
+ verifyRemoved(PREInstr);
+#endif
PREInstr->deleteValue();
return false;
}
if (MD) MD->removeInstruction(I);
if (MSSAU)
MSSAU->removeMemoryAccess(I);
- LLVM_DEBUG(verifyRemoved(I));
+#ifndef NDEBUG
+ verifyRemoved(I);
+#endif
ICF->removeInstruction(I);
I->eraseFromParent();
}