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 | ce3269b815d98d8193cfc327918b5cd33a1f28c3 (patch) | |
| tree | 4e056e4b8df7aadb37c3f72ef46e07a7db30e1ab /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | |
| parent | a4abd035ea7b704632317f45711c897a46b0abf5 (diff) | |
| download | bcm5719-llvm-ce3269b815d98d8193cfc327918b5cd33a1f28c3.tar.gz bcm5719-llvm-ce3269b815d98d8193cfc327918b5cd33a1f28c3.zip | |
Do one map lookup instead of two.
llvm-svn: 104645
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index 1996c192ec7..95f4d072e01 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/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; |

