[PATCH] D81981: [PGO] Supplement PGO profile with Sample profile
David Li via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 22 15:57:03 PDT 2020
davidxl added a comment.
Inlining won't be helped unless there is a hot callsite to the all-zero count function -- but this should not exist. I think the major performance hit comes from 1) text.unlikely which may not be mlocked; and 2) all unbiased branches due to zero weights. So doing this depending it on entry count existence is fine, but we still to teach PGOUse to drop the body. I think a simpler design would be
At llvm_profdata side:
1. if the instrumentation cold function has enough internal counts, just scale up the max internal counts to be a multiple of hot threshold
2. if the cold function has all zero counts or we believe all their internal counts are not trustworthy (basically ignore step 1) with an option), we can simply discard the function entry completely (to signal this function is actually hot, but we don't know internal counts)
At PGOUse side:
if we don't find counters for a function, set the function's entry value to be above hot threshold (a function statically linked in should always have counts. If there are not counts, it means it is corrected by llvm-profdata).
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81981/new/
https://reviews.llvm.org/D81981
More information about the llvm-commits
mailing list