[llvm-commits] [llvm] r106415 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp

Dan Gohman gohman at apple.com
Mon Jun 21 07:21:47 PDT 2010


Author: djg
Date: Mon Jun 21 09:21:47 2010
New Revision: 106415

URL: http://llvm.org/viewvc/llvm-project?rev=106415&view=rev
Log:
Do one lookup instead of two.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=106415&r1=106414&r2=106415&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Mon Jun 21 09:21:47 2010
@@ -185,8 +185,9 @@
   // 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];
 }
 





More information about the llvm-commits mailing list