summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegisterUsageInfo.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-07-16 18:20:26 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-07-16 18:20:26 +0000
commite203b610fa965187e1c3fbbd5a8c153374adab76 (patch)
tree46437ac739246c8603d0272dea505da94492daaf /llvm/lib/CodeGen/RegisterUsageInfo.cpp
parenteb50476f77796ae9ea00754cca7bc12f72f9d638 (diff)
downloadbcm5719-llvm-e203b610fa965187e1c3fbbd5a8c153374adab76.tar.gz
bcm5719-llvm-e203b610fa965187e1c3fbbd5a8c153374adab76.zip
IPRA: avoid double query to the map (NFC)
llvm-svn: 275689
Diffstat (limited to 'llvm/lib/CodeGen/RegisterUsageInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/RegisterUsageInfo.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/RegisterUsageInfo.cpp b/llvm/lib/CodeGen/RegisterUsageInfo.cpp
index 9eeb3b9d8cc..5cf3e57eb3d 100644
--- a/llvm/lib/CodeGen/RegisterUsageInfo.cpp
+++ b/llvm/lib/CodeGen/RegisterUsageInfo.cpp
@@ -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;
}
OpenPOWER on IntegriCloud