Skip to content

Commit 7cd3047

Browse files
[IPO] Avoid repeated hash lookups (NFC) (#130462)
1 parent 2d1634f commit 7cd3047

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Transforms/IPO/FunctionAttrs.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,15 +406,16 @@ static FunctionSummary *calculatePrevailingSummary(
406406
}
407407
}
408408

409+
auto &CPS = CachedPrevailingSummary[VI];
409410
if (Local) {
410411
assert(!Prevailing);
411-
CachedPrevailingSummary[VI] = Local;
412+
CPS = Local;
412413
} else if (Prevailing) {
413414
assert(!Local);
414-
CachedPrevailingSummary[VI] = Prevailing;
415+
CPS = Prevailing;
415416
}
416417

417-
return CachedPrevailingSummary[VI];
418+
return CPS;
418419
}
419420

420421
bool llvm::thinLTOPropagateFunctionAttrs(

0 commit comments

Comments
 (0)