From 613b7c3337028f7647d0fbe8c230f9f09f98c016 Mon Sep 17 00:00:00 2001 From: Sanjoy Das Date: Wed, 23 Mar 2016 02:24:15 +0000 Subject: [PATCH] [StatepointLowering] Don't do two DenseMap lookups; nfci git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264130 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/StatepointLowering.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/StatepointLowering.h b/lib/CodeGen/SelectionDAG/StatepointLowering.h index 78cdc39db1f..422b634d917 100644 --- a/lib/CodeGen/SelectionDAG/StatepointLowering.h +++ b/lib/CodeGen/SelectionDAG/StatepointLowering.h @@ -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) {