From 6cae7409b1a108e14de61fe2a0e6b050cff3d8e7 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Tue, 19 Jun 2007 04:32:55 +0000 Subject: [PATCH] Remember to clear the maximal sets between functions. Thanks to Nicholas for valgrinding this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37646 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/GVNPRE.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Scalar/GVNPRE.cpp b/lib/Transforms/Scalar/GVNPRE.cpp index 91c1cd4d47b..05a28b3f7db 100644 --- a/lib/Transforms/Scalar/GVNPRE.cpp +++ b/lib/Transforms/Scalar/GVNPRE.cpp @@ -297,6 +297,8 @@ ValueTable::Expression ValueTable::create_expression(CmpInst* C) { void ValueTable::clear() { valueNumbering.clear(); expressionNumbering.clear(); + maximalExpressions.clear(); + maximalValues.clear(); nextValueNumber = 1; } @@ -306,10 +308,9 @@ namespace { bool runOnFunction(Function &F); public: static char ID; // Pass identification, replacement for typeid - GVNPRE() : FunctionPass((intptr_t)&ID) { nextValueNumber = 1; } + GVNPRE() : FunctionPass((intptr_t)&ID) { } private: - uint32_t nextValueNumber; ValueTable VN; std::vector createdExpressions;