diff options
author | Dan Gohman <gohman@apple.com> | 2010-05-25 21:59:42 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-05-25 21:59:42 +0000 |
commit | b52ad0ebb4e4dcb826bd7076bf05fec738be3603 (patch) | |
tree | 3116223c7d8fd044108cd175bc5170897def2bb6 /lib/CodeGen | |
parent | bbde6db92aeb7312a96e8f58a93244615d43eb0e (diff) | |
download | external_llvm-b52ad0ebb4e4dcb826bd7076bf05fec738be3603.zip external_llvm-b52ad0ebb4e4dcb826bd7076bf05fec738be3603.tar.gz external_llvm-b52ad0ebb4e4dcb826bd7076bf05fec738be3603.tar.bz2 |
Do one map lookup instead of two.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104645 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/SelectionDAG/FastISel.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index 1996c19..95f4d07 100644 --- a/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -99,8 +99,9 @@ unsigned FastISel::getRegForValue(const Value *V) { // cache values defined by Instructions across blocks, and other values // only locally. This is because Instructions already have the SSA // def-dominates-use requirement enforced. - if (ValueMap.count(V)) - return ValueMap[V]; + DenseMap<const Value *, unsigned>::iterator I = ValueMap.find(V); + if (I != ValueMap.end()) + return I->second; unsigned Reg = LocalValueMap[V]; if (Reg != 0) return Reg; |