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 | 3193a689db3de8640d412ccd9482301647359a4e (patch) | |
tree | 84c6f1956f1a8a5702106bd00811882f96bce613 | |
parent | 37db6cdaea47d0637bdbe624f7b10ff8f82928ad (diff) |
Do one lookup instead of two.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106415 91177308-0d34-0410-b5e6-96231b3b80d8
-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 58d8344479..cc8c3c70ac 100644 --- a/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/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]; } |