Skip to content

Commit 0b99a2a

Browse files
[IPO] Avoid repeated hash lookups (NFC) (#130546)
1 parent 15762ea commit 0b99a2a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/lib/Transforms/IPO/LowerTypeTests.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2207,9 +2207,9 @@ bool LowerTypeTestsModule::lower() {
22072207
bool IsExported = false;
22082208
if (Function *F = dyn_cast<Function>(&GO)) {
22092209
IsJumpTableCanonical = isJumpTableCanonical(F);
2210-
if (ExportedFunctions.count(F->getName())) {
2211-
IsJumpTableCanonical |=
2212-
ExportedFunctions[F->getName()].Linkage == CFL_Definition;
2210+
if (auto It = ExportedFunctions.find(F->getName());
2211+
It != ExportedFunctions.end()) {
2212+
IsJumpTableCanonical |= It->second.Linkage == CFL_Definition;
22132213
IsExported = true;
22142214
// TODO: The logic here checks only that the function is address taken,
22152215
// not that the address takers are live. This can be updated to check
@@ -2407,9 +2407,9 @@ bool LowerTypeTestsModule::lower() {
24072407
cast<MDString>(AliasMD->getOperand(0))->getString();
24082408
StringRef Aliasee = cast<MDString>(AliasMD->getOperand(1))->getString();
24092409

2410-
if (!ExportedFunctions.count(Aliasee) ||
2411-
ExportedFunctions[Aliasee].Linkage != CFL_Definition ||
2412-
!M.getNamedAlias(Aliasee))
2410+
if (auto It = ExportedFunctions.find(Aliasee);
2411+
It == ExportedFunctions.end() ||
2412+
It->second.Linkage != CFL_Definition || !M.getNamedAlias(Aliasee))
24132413
continue;
24142414

24152415
GlobalValue::VisibilityTypes Visibility =

0 commit comments

Comments
 (0)