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
This commit is contained in:
Mehdi Amini 2016-07-16 18:20:26 +00:00
parent 5de5eb94ef
commit bf11cc79f2

View File

@ -54,8 +54,9 @@ void PhysicalRegisterUsageInfo::storeUpdateRegUsageInfo(
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;
}