summaryrefslogtreecommitdiff
path: root/lib/Analysis/LazyValueInfo.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-08-22 15:37:57 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-08-22 15:37:57 +0000
commit05d96f98cbd96dab7f4ea1ea4ebe4285597e7e88 (patch)
treeb32c92e060826c319744e00e4f74a20de33ad62f /lib/Analysis/LazyValueInfo.cpp
parentfdeb9fe5e08146d9cb953000cb893eda80329a08 (diff)
downloadllvm-05d96f98cbd96dab7f4ea1ea4ebe4285597e7e88.tar.gz
llvm-05d96f98cbd96dab7f4ea1ea4ebe4285597e7e88.tar.bz2
llvm-05d96f98cbd96dab7f4ea1ea4ebe4285597e7e88.tar.xz
Reduce duplicated hash map lookups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162362 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LazyValueInfo.cpp')
-rw-r--r--lib/Analysis/LazyValueInfo.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Analysis/LazyValueInfo.cpp b/lib/Analysis/LazyValueInfo.cpp
index 9140786a1b..c2306b4e9c 100644
--- a/lib/Analysis/LazyValueInfo.cpp
+++ b/lib/Analysis/LazyValueInfo.cpp
@@ -470,8 +470,10 @@ bool LazyValueInfoCache::hasBlockValue(Value *Val, BasicBlock *BB) {
return true;
LVIValueHandle ValHandle(Val, this);
- if (!ValueCache.count(ValHandle)) return false;
- return ValueCache[ValHandle].count(BB);
+ std::map<LVIValueHandle, ValueCacheEntryTy>::iterator I =
+ ValueCache.find(ValHandle);
+ if (I == ValueCache.end()) return false;
+ return I->second.count(BB);
}
LVILatticeVal LazyValueInfoCache::getBlockValue(Value *Val, BasicBlock *BB) {