Skip to content

Commit 506b31e

Browse files
[IPO] Avoid repeated hash lookups (NFC) (#127957)
1 parent c0c1722 commit 506b31e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

llvm/lib/Transforms/IPO/PartialInlining.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,9 +1393,12 @@ bool PartialInlinerImpl::tryPartialInline(FunctionCloner &Cloner) {
13931393
CallerORE.emit(OR);
13941394

13951395
// Now update the entry count:
1396-
if (CalleeEntryCountV && CallSiteToProfCountMap.count(User)) {
1397-
uint64_t CallSiteCount = CallSiteToProfCountMap[User];
1398-
CalleeEntryCountV -= std::min(CalleeEntryCountV, CallSiteCount);
1396+
if (CalleeEntryCountV) {
1397+
if (auto It = CallSiteToProfCountMap.find(User);
1398+
It != CallSiteToProfCountMap.end()) {
1399+
uint64_t CallSiteCount = It->second;
1400+
CalleeEntryCountV -= std::min(CalleeEntryCountV, CallSiteCount);
1401+
}
13991402
}
14001403

14011404
AnyInline = true;

0 commit comments

Comments
 (0)