[llvm] r275689 - IPRA: avoid double query to the map (NFC)
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 16 11:20:26 PDT 2016
Author: mehdi_amini
Date: Sat Jul 16 13:20:26 2016
New Revision: 275689
URL: http://llvm.org/viewvc/llvm-project?rev=275689&view=rev
Log:
IPRA: avoid double query to the map (NFC)
Modified:
llvm/trunk/lib/CodeGen/RegisterUsageInfo.cpp
Modified: llvm/trunk/lib/CodeGen/RegisterUsageInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterUsageInfo.cpp?rev=275689&r1=275688&r2=275689&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterUsageInfo.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterUsageInfo.cpp Sat Jul 16 13:20:26 2016
@@ -54,8 +54,9 @@ void PhysicalRegisterUsageInfo::storeUpd
const std::vector<uint32_t> *
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;
}
More information about the llvm-commits
mailing list