summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2007-07-31 23:27:13 +0000
committerOwen Anderson <resistor@mac.com>2007-07-31 23:27:13 +0000
commit10ffa860d80b302de2ec974999e8dea704601bbc (patch)
treeeb6622bed57d742121d0aaf218784d1266f7ec09 /llvm/lib
parente02b2d7e69d8c3f36f0600992b168df729ac64ae (diff)
downloadbcm5719-llvm-10ffa860d80b302de2ec974999e8dea704601bbc.tar.gz
bcm5719-llvm-10ffa860d80b302de2ec974999e8dea704601bbc.zip
Don't let the memory allocator outsmart GVN. ;-)
llvm-svn: 40655
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/GVN.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index ff66250244e..3d04fc4fd81 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud