From: Mehdi Amini Date: Sat, 16 Jul 2016 18:20:26 +0000 (+0000) Subject: IPRA: avoid double query to the map (NFC) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bf11cc79f27f007dc76456f57b93b73c3f51f77c;p=llvm IPRA: avoid double query to the map (NFC) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275689 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/RegisterUsageInfo.cpp b/lib/CodeGen/RegisterUsageInfo.cpp index 9eeb3b9d8cc..5cf3e57eb3d 100644 --- a/lib/CodeGen/RegisterUsageInfo.cpp +++ b/lib/CodeGen/RegisterUsageInfo.cpp @@ -54,8 +54,9 @@ void PhysicalRegisterUsageInfo::storeUpdateRegUsageInfo( const std::vector * PhysicalRegisterUsageInfo::getRegUsageInfo(const Function *FP) { - if (RegMasks.find(FP) != RegMasks.end()) - return &(RegMasks.find(FP)->second); + auto It = RegMasks.find(FP); + if (It != RegMasks.end()) + return &(It->second); return nullptr; }