The common profile usage is to collect profile from a target and then use the profile to guide the optimized build for the same target dedicatedly. There are some cases that no profile can be collected for a target. In those cases, although no dedicated profile is available, it is possible to have some generic profile to optimize common libraries and utilities. A flag is needed to tell the non-dedicated profile from the dedicated profile apart, so compiler can use different strategy for them.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/include/llvm/IR/ProfileSummary.h | ||
---|---|---|
54 | --> If 'Dedicated' is false, it means the profile is for common/shared code. The common profile is merged from profiles collected from running other targets. | |
llvm/include/llvm/ProfileData/SampleProf.h | ||
174 | SecFlagPartial or SecFlagShared? | |
llvm/include/llvm/ProfileData/SampleProfWriter.h | ||
223 | setPartialProfile or setSharedProfile? | |
llvm/lib/ProfileData/SampleProfReader.cpp | ||
850 | partial or shared? |
llvm/include/llvm/ProfileData/SampleProf.h | ||
---|---|---|
174 | Change to SecFlagPartial here. |
Thanks for the patch! We're also thinking about differentiating default profile (from other targets) vs custom profile (from same target) for optimizations, so very curious about your compiler heuristic changes after this. :) I am guessing ProfileSampleAccurate and ProfileAccurateForSymsInList will one of those changes?
ProfileSampleAccurate and ProfileAccurateForSymsInList are already off by default so it is not urgent to guard the logic with the partial profile flag unless ProfileSampleAccurate and ProfileAccurateForSymsInList will be enabled by default.
An example for compiler heuristic to change is ProfileSummaryInfo::hasLargeWorkingSetSize/hasHugeWorkingSetSize. If the profile is a partial profile, those functions should return false in any case because there is no way to know the actual working set size from a partial profile.
--> If 'Dedicated' is false, it means the profile is for common/shared code. The common profile is merged from profiles collected from running other targets.