Don't let the memory allocator outsmart GVN. ;-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40655 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson 2007-07-31 23:27:13 +00:00
parent 3b1f55ea24
commit bf7d0bc4e5

View File

@ -558,6 +558,11 @@ void ValueTable::clear() {
nextValueNumber = 1;
}
/// erase - Remove a value from the value numbering
void ValueTable::erase(Value* V) {
valueNumbering.erase(V);
}
//===----------------------------------------------------------------------===//
// ValueNumberedSet Class
//===----------------------------------------------------------------------===//
@ -871,6 +876,7 @@ bool GVN::processInstruction(Instruction* I,
if (currAvail.test(num)) {
Value* repl = find_leader(currAvail, num);
VN.erase(I);
I->replaceAllUsesWith(repl);
toErase.push_back(I);
return true;