[PATCH] D127026: [CSSPGO][llvm-profgen] Reimplement computeSummaryAndThreshold using context trie
Hongtao Yu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 10 09:34:47 PDT 2022
hoy accepted this revision.
hoy added a comment.
This revision is now accepted and ready to land.
LGTM, thanks for addressing the feedbacks!
================
Comment at: llvm/tools/llvm-profgen/ProfileGenerator.cpp:1037
+ bool OldOpt = UseContextLessSummary;
+ UseContextLessSummary = true;
+ ContextTracker.createContextLessProfileMap(ContextLessProfiles);
----------------
wlei wrote:
> hoy wrote:
> > Should this be set to false? We want to avoid merging ContextLessProfiles again in computeSummaryForProfiles?
> Oops, it should be false. I also found that set `UseContextLessSummary` false is not enough, I have to set FunctionSamples::ProfileIsCS to false as well, because the `UseContextLessSummary.getNumOccurrences()` is 0 here.
>
> ```
> if (UseContextLessSummary || (sampleprof::FunctionSamples::ProfileIsCS &&
> !UseContextLessSummary.getNumOccurrences())) {
> ...
> ```
Good catch. A comment about why setting the two variables (e.g, "to avoid re-merging profiles") would be good.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D127026/new/
https://reviews.llvm.org/D127026
More information about the llvm-commits
mailing list