Do one lookup instead of two.
[oota-llvm.git] / lib / CodeGen / SelectionDAG / FastISel.cpp
index 58d8344479ca2d6ef20aac2984d143096f41e6df..cc8c3c70ac29c380c21e295af979b4adb2757759 100644 (file)
@@ -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];
 }