[LVI] Remove count/erase idiom in favor of checking result value of erase

Minor compile time win.  Avoids an additional O(N) scan in the case where we are removing an element and costs nothing when we aren't.

llvm-svn: 290768
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index cd1f250..4f63552 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -462,8 +462,7 @@
   SmallVector<AssertingVH<BasicBlock>, 4> ToErase;
   for (auto &I : OverDefinedCache) {
     SmallPtrSetImpl<Value *> &ValueSet = I.second;
-    if (ValueSet.count(V))
-      ValueSet.erase(V);
+    ValueSet.erase(V);
     if (ValueSet.empty())
       ToErase.push_back(I.first);
   }
@@ -533,12 +532,9 @@
 
     bool changed = false;
     for (Value *V : ValsToClear) {
-      // TODO: count and erase can be converted to a find/erase(itr) pattern
-      if (!ValueSet.count(V))
+      if (!ValueSet.erase(V))
         continue;
 
-      ValueSet.erase(V);
-
       // If we removed anything, then we potentially need to update
       // blocks successors too.
       changed = true;