@@ -234,11 +234,10 @@ static cl::opt<unsigned> ProfileICPRelativeHotnessSkip(
234
234
cl::desc(
235
235
" Skip relative hotness check for ICP up to given number of targets." ));
236
236
237
- static cl::opt<unsigned > ChecksumMismatchFuncHotBlockSkip (
238
- " checksum-mismatch-func-hot-block-skip" , cl::Hidden, cl::init(100 ),
239
- cl::desc(" For checksum-mismatch error check, skip checking the function "
240
- " whose num of hot(on average) blocks is smaller than the "
241
- " given number." ));
237
+ static cl::opt<unsigned > HotFuncCutoffForStalenessError (
238
+ " hot-func-cutoff-for-staleness-error" , cl::Hidden, cl::init(999000 ),
239
+ cl::desc(" Hot function cutoff for staleness error. It's percentile value "
240
+ " (multiplied by 10000), e.g. 995000 for 99.5 percentile." ));
242
241
243
242
static cl::opt<unsigned > MinfuncsForStalenessError (
244
243
" min-functions-for-staleness-error" , cl::Hidden, cl::init(50 ),
@@ -647,7 +646,7 @@ class SampleProfileLoader final : public SampleProfileLoaderBaseImpl<Function> {
647
646
std::unique_ptr<ProfiledCallGraph> buildProfiledCallGraph (Module &M);
648
647
void generateMDProfMetadata (Function &F);
649
648
bool rejectHighStalenessProfile (Module &M, ProfileSummaryInfo *PSI,
650
- const SampleProfileMap &Profiles);
649
+ const SampleProfileMap &Profiles);
651
650
652
651
// / Map from function name to Function *. Used to find the function from
653
652
// / the function name. If the function name contains suffix, additional
@@ -2214,7 +2213,7 @@ bool SampleProfileLoader::doInitialization(Module &M,
2214
2213
// big set of functions that are supposed to be globally performance
2215
2214
// significant, only compute and check the mismatch within those functions. The
2216
2215
// function selection is based on two criteria: 1) The function is "hot" enough,
2217
- // which is tuned by a hotness-based flag(ChecksumMismatchFuncHotBlockSkip ). 2)
2216
+ // which is tuned by a hotness-based flag(HotFuncCutoffForStalenessError ). 2)
2218
2217
// The num of function is large enough which is tuned by the
2219
2218
// MinfuncsForStalenessError flag.
2220
2219
bool SampleProfileLoader::rejectHighStalenessProfile (
@@ -2234,8 +2233,8 @@ bool SampleProfileLoader::rejectHighStalenessProfile(
2234
2233
// checksum-mismatched and dropped, the whole binary will likely be
2235
2234
// impacted, so here we use a hotness-based threshold to control the
2236
2235
// selection.
2237
- if (FS. getTotalSamples () <
2238
- ChecksumMismatchFuncHotBlockSkip * PSI-> getOrCompHotCountThreshold ( ))
2236
+ if (!PSI-> isHotCountNthPercentile (HotFuncCutoffForStalenessError,
2237
+ FS. getTotalSamples () ))
2239
2238
continue ;
2240
2239
2241
2240
TotalHotFunc++;
0 commit comments