]> granicus.if.org Git - llvm/commitdiff
NewGVN: Now that we have a better verifier, we can prove that we can erase the predic...
authorDaniel Berlin <dberlin@dberlin.org>
Sun, 19 Mar 2017 00:07:32 +0000 (00:07 +0000)
committerDaniel Berlin <dberlin@dberlin.org>
Sun, 19 Mar 2017 00:07:32 +0000 (00:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298199 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/NewGVN.cpp

index e7a14e23fa92ff4e40e070ad619cd932703d1ac8..5aa8c5cdcab002fefa91a13230fd0156817ffe85 100644 (file)
@@ -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