diff options
author | Kazu Hirata <kazu@google.com> | 2025-03-03 01:03:18 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-03 01:03:18 -0800 |
commit | 0e5826ea07b17d05d6ea5a397288e9cc96f1d8cd (patch) | |
tree | a33ebcde756e88a724ab80cebc9aa0c206a04e56 /llvm/lib/Transforms/IPO/FunctionAttrs.cpp | |
parent | 178fb96f72b95b9df87227832b3dd495d9b9f91c (diff) | |
download | llvm-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.cpp | 5 |
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: |