summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/LazyValueInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/LazyValueInfo.cpp')
-rw-r--r--llvm/lib/Analysis/LazyValueInfo.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index cd1f25090d6..4f635523687 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -462,8 +462,7 @@ void LazyValueInfoCache::eraseValue(Value *V) {
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 @@ void LazyValueInfoCache::threadEdgeImpl(BasicBlock *OldSucc,
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;
OpenPOWER on IntegriCloud