diff options
author | Dan Gohman <gohman@apple.com> | 2010-06-21 14:21:47 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-06-21 14:21:47 +0000 |
commit | f91aff5f13f75caf5e8366a944d8bc4e19630290 (patch) | |
tree | 6624ac1655ce1c91c6fd1b0b1d8a4790d3ab2f84 /llvm/lib/CodeGen | |
parent | 7c58cf75facdadaf943cfbfeae9d3cfded4d3b7d (diff) | |
download | bcm5719-llvm-f91aff5f13f75caf5e8366a944d8bc4e19630290.tar.gz bcm5719-llvm-f91aff5f13f75caf5e8366a944d8bc4e19630290.zip |
Do one lookup instead of two.
llvm-svn: 106415
Diffstat (limited to 'llvm/lib/CodeGen')
-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 58d8344479c..cc8c3c70ac2 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -185,8 +185,9 @@ unsigned FastISel::lookUpRegForValue(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; return LocalValueMap[V]; } |