summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-02-27 21:43:14 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-02-27 21:43:14 +0000
commit4e3b903a957394e755dd0d3c89c17e9c46ee110e (patch)
tree932ccf9acd9ea6c85d278ed95d308882dbc3cdd0 /llvm/lib
parent47d678391321a65acf401b4bd99a318f8e217121 (diff)
downloadbcm5719-llvm-4e3b903a957394e755dd0d3c89c17e9c46ee110e.tar.gz
bcm5719-llvm-4e3b903a957394e755dd0d3c89c17e9c46ee110e.zip
Reduce double set lookups.
llvm-svn: 230798
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/LazyValueInfo.cpp3
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h3
2 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index 87c31fd9b68..d4580dcee84 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -346,11 +346,10 @@ namespace {
/// Push BV onto BlockValueStack unless it's already in there.
/// Returns true on success.
bool pushBlockValue(const std::pair<BasicBlock *, Value *> &BV) {
- if (BlockValueSet.count(BV))
+ if (!BlockValueSet.insert(BV).second)
return false; // It's already in the stack.
BlockValueStack.push(BV);
- BlockValueSet.insert(BV);
return true;
}
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
index ad7411f7775..719af410245 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
@@ -622,8 +622,7 @@ public:
void removeValue(const Value *V) {
// This is to support hack in lowerCallFromStatepoint
// Should be removed when hack is resolved
- if (NodeMap.count(V))
- NodeMap.erase(V);
+ NodeMap.erase(V);
}
void setUnusedArgValue(const Value *V, SDValue NewN) {
OpenPOWER on IntegriCloud