[llvm] [Transforms] Avoid repeated hash lookups (NFC) (PR #130708)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 11 01:04:29 PDT 2025
================
@@ -148,7 +148,8 @@ void PseudoProbeVerifier::verifyProbeFactors(
auto &PrevProbeFactors = FunctionProbeFactors[F->getName()];
for (const auto &I : ProbeFactors) {
float CurProbeFactor = I.second;
- if (PrevProbeFactors.count(I.first)) {
+ auto [It, Inserted] = PrevProbeFactors.try_emplace(I.first);
+ if (!Inserted) {
float PrevProbeFactor = PrevProbeFactors[I.first];
----------------
nikic wrote:
Another use here?
https://github.com/llvm/llvm-project/pull/130708
More information about the llvm-commits
mailing list