diff options
author | Owen Anderson <resistor@mac.com> | 2007-07-31 23:27:13 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2007-07-31 23:27:13 +0000 |
commit | bf7d0bc4e5ad0516c88b550945c9050920ece148 (patch) | |
tree | 654855a0cf317de947352e120669d5ce733803d3 | |
parent | 3b1f55ea2412e381e6bf2002066f6ef1f4e24c13 (diff) |
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
-rw-r--r-- | lib/Transforms/Scalar/GVN.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index ff66250244..3d04fc4fd8 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; |