From bf11cc79f27f007dc76456f57b93b73c3f51f77c Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Sat, 16 Jul 2016 18:20:26 +0000 Subject: [PATCH] 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 --- lib/CodeGen/RegisterUsageInfo.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } -- 2.50.1