Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions llvm/lib/Transforms/IPO/SampleProfileProbe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
if (std::abs(CurProbeFactor - PrevProbeFactor) >
DistributionFactorVariance) {
Expand All @@ -163,7 +164,7 @@ void PseudoProbeVerifier::verifyProbeFactors(
}

// Update
PrevProbeFactors[I.first] = I.second;
It->second = I.second;
}
}

Expand Down