[llvm] r264130 - [StatepointLowering] Don't do two DenseMap lookups; nfci

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 22 19:24:16 PDT 2016


Author: sanjoy
Date: Tue Mar 22 21:24:15 2016
New Revision: 264130

URL: http://llvm.org/viewvc/llvm-project?rev=264130&view=rev
Log:
[StatepointLowering] Don't do two DenseMap lookups; nfci

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.h

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.h?rev=264130&r1=264129&r2=264130&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.h (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.h Tue Mar 22 21:24:15 2016
@@ -47,9 +47,10 @@ public:
   /// spilled.  Otherwise, the value has already been spilled and no
   /// further action is required by the caller.
   SDValue getLocation(SDValue Val) {
-    if (!Locations.count(Val))
+    auto I = Locations.find(Val);
+    if (I == Locations.end())
       return SDValue();
-    return Locations[Val];
+    return I->second;
   }
 
   void setLocation(SDValue Val, SDValue Location) {




More information about the llvm-commits mailing list