From: Owen Anderson Date: Tue, 31 Jul 2007 23:27:13 +0000 (+0000) Subject: Don't let the memory allocator outsmart GVN. ;-) X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=bf7d0bc4e5ad0516c88b550945c9050920ece148;p=oota-llvm.git 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 --- diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index ff66250244e..3d04fc4fd81 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -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;