[BOLT] Avoid repeated hash lookups (NFC) (#112822)

This commit is contained in:
Kazu Hirata
2024-10-18 08:39:31 -07:00
committed by GitHub
parent 397707f718
commit 9f264e4d2f

View File

@@ -73,12 +73,12 @@ Error VeneerElimination::runOnFunctions(BinaryContext &BC) {
continue;
const MCSymbol *TargetSymbol = BC.MIB->getTargetSymbol(Instr, 0);
if (VeneerDestinations.find(TargetSymbol) == VeneerDestinations.end())
auto It = VeneerDestinations.find(TargetSymbol);
if (It == VeneerDestinations.end())
continue;
VeneerCallers++;
BC.MIB->replaceBranchTarget(Instr, VeneerDestinations[TargetSymbol],
BC.Ctx.get());
BC.MIB->replaceBranchTarget(Instr, It->second, BC.Ctx.get());
}
}
}