forked from OSchip/llvm-project
[CSSPGO] Skip dangling probe value when computing profile summary
Recently we switched to use InvalidProbeCount = UINT64_MAX (instead of 0) to represent dangling probe, but UINT64_MAX is not excluded when computing profile summary. This caused profile summary to produce incorrect hot/cold threshold. The change fixed it by excluding UINT64_MAX from summary builder. Differential Revision: https://reviews.llvm.org/D99788
This commit is contained in:
parent
438b6dd3e5
commit
c5605857bb
|
@ -68,8 +68,12 @@ void SampleProfileSummaryBuilder::addRecord(
|
||||||
if (FS.getHeadSamples() > MaxFunctionCount)
|
if (FS.getHeadSamples() > MaxFunctionCount)
|
||||||
MaxFunctionCount = FS.getHeadSamples();
|
MaxFunctionCount = FS.getHeadSamples();
|
||||||
}
|
}
|
||||||
for (const auto &I : FS.getBodySamples())
|
for (const auto &I : FS.getBodySamples()) {
|
||||||
addCount(I.second.getSamples());
|
uint64_t Count = I.second.getSamples();
|
||||||
|
if (!sampleprof::FunctionSamples::ProfileIsProbeBased ||
|
||||||
|
(Count != sampleprof::FunctionSamples::InvalidProbeCount))
|
||||||
|
addCount(Count);
|
||||||
|
}
|
||||||
for (const auto &I : FS.getCallsiteSamples())
|
for (const auto &I : FS.getCallsiteSamples())
|
||||||
for (const auto &CS : I.second)
|
for (const auto &CS : I.second)
|
||||||
addRecord(CS.second, true);
|
addRecord(CS.second, true);
|
||||||
|
|
Loading…
Reference in New Issue