aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-03-03 01:03:18 -0800
committerGitHub <noreply@github.com>2025-03-03 01:03:18 -0800
commit0e5826ea07b17d05d6ea5a397288e9cc96f1d8cd (patch)
treea33ebcde756e88a724ab80cebc9aa0c206a04e56 /llvm/lib/Transforms/IPO/FunctionAttrs.cpp
parent178fb96f72b95b9df87227832b3dd495d9b9f91c (diff)
downloadllvm-0e5826ea07b17d05d6ea5a397288e9cc96f1d8cd.zip
llvm-0e5826ea07b17d05d6ea5a397288e9cc96f1d8cd.tar.gz
llvm-0e5826ea07b17d05d6ea5a397288e9cc96f1d8cd.tar.bz2
[IPO] Avoid repeated hash lookups (NFC) (#129467)
Diffstat (limited to 'llvm/lib/Transforms/IPO/FunctionAttrs.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/FunctionAttrs.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
index 5c17b9e..6fe81f7b 100644
--- a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
@@ -319,8 +319,9 @@ static FunctionSummary *calculatePrevailingSummary(
function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)>
IsPrevailing) {
- if (CachedPrevailingSummary.count(VI))
- return CachedPrevailingSummary[VI];
+ if (auto It = CachedPrevailingSummary.find(VI);
+ It != CachedPrevailingSummary.end())
+ return It->second;
/// At this point, prevailing symbols have been resolved. The following leads
/// to returning a conservative result: