Skip to content

Commit 0e5826e

Browse files
[IPO] Avoid repeated hash lookups (NFC) (#129467)
1 parent 178fb96 commit 0e5826e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Transforms/IPO/FunctionAttrs.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,9 @@ static FunctionSummary *calculatePrevailingSummary(
319319
function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)>
320320
IsPrevailing) {
321321

322-
if (CachedPrevailingSummary.count(VI))
323-
return CachedPrevailingSummary[VI];
322+
if (auto It = CachedPrevailingSummary.find(VI);
323+
It != CachedPrevailingSummary.end())
324+
return It->second;
324325

325326
/// At this point, prevailing symbols have been resolved. The following leads
326327
/// to returning a conservative result:

0 commit comments

Comments
 (0)