From 27aadb14562e119eadc24374c670e67fe9620917 Mon Sep 17 00:00:00 2001 From: Daniel Berlin Date: Sun, 19 Mar 2017 00:07:32 +0000 Subject: [PATCH] NewGVN: Now that we have a better verifier, we can prove that we can erase the predicateuser set each time we mark it touched git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298199 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/NewGVN.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Transforms/Scalar/NewGVN.cpp b/lib/Transforms/Scalar/NewGVN.cpp index e7a14e23fa9..5aa8c5cdcab 100644 --- a/lib/Transforms/Scalar/NewGVN.cpp +++ b/lib/Transforms/Scalar/NewGVN.cpp @@ -1328,9 +1328,11 @@ void NewGVN::addPredicateUsers(const PredicateBase *PB, Instruction *I) { // Touch all the predicates that depend on this instruction. void NewGVN::markPredicateUsersTouched(Instruction *I) { const auto Result = PredicateToUsers.find(I); - if (Result != PredicateToUsers.end()) + if (Result != PredicateToUsers.end()) { for (auto *User : Result->second) TouchedInstructions.set(InstrDFS.lookup(User)); + PredicateToUsers.erase(Result); + } } // Touch the instructions that need to be updated after a congruence class has a -- 2.50.1