1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/lib/ProfileData
Wei Mi 51d4708437 Supplement instr profile with sample profile.
PGO profile is usually more precise than sample profile. However, PGO profile
needs to be collected from loadtest and loadtest may not be representative
enough to the production workload. Sample profile collected from production
can be used as a supplement -- for functions cold in loadtest but warm/hot
in production, we can scale up the related function in PGO profile if the
function is warm or hot in sample profile.

The implementation contains changes in compiler side and llvm-profdata side.
Given an instr profile and a sample profile, for a function cold in PGO
profile but warm/hot in sample profile, llvm-profdata will either mark
all the counters in the profile to be -1 or scale up the max count in the
function to be above hot threshold, depending on the zero counter ratio in
the profile. The assumption is if there are too many counters being zero
in the function profile, the profile is more likely to cause harm than good,
then llvm-profdata will mark all the counters to be -1 indicating the
function is hot but the profile is unaccountable. In compiler side, if a
function profile with all -1 counters is seen, the function entry count will
be set to be above hot threshold but its internal profile will be dropped.

In the long run, it may be useful to let compiler support using PGO profile
and sample profile at the same time, but that requires more careful design
and more substantial changes to make two profiles work seamlessly. The patch
here serves as a simple intermediate solution.

Differential Revision: https://reviews.llvm.org/D81981
2020-07-27 20:17:40 -07:00
..
Coverage
CMakeLists.txt
GCOV.cpp [llvm-cov gcov] Don't require NUL terminator when reading files 2020-07-19 00:31:52 -07:00
InstrProf.cpp Supplement instr profile with sample profile. 2020-07-27 20:17:40 -07:00
InstrProfReader.cpp [PGO] Supporting code for always instrumenting entry block 2020-07-22 15:01:53 -07:00
InstrProfWriter.cpp Supplement instr profile with sample profile. 2020-07-27 20:17:40 -07:00
LLVMBuild.txt
ProfileSummaryBuilder.cpp Supplement instr profile with sample profile. 2020-07-27 20:17:40 -07:00
SampleProf.cpp
SampleProfReader.cpp [gcov] Fix .gcda decoding and support GCC 8, 9 and 10 2020-05-10 09:55:23 -07:00
SampleProfWriter.cpp