This change allows to trim the profile if it's considered to be cold for baseline AutoFDO. We reuse the cold threshold from ProfileSummaryBuilder::getColdCountThreshold(..) which can be set by percent(--profile-summary-cutoff-cold) or by value(--profile-summary-cold-count).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| llvm/tools/llvm-profgen/ProfileGenerator.cpp | ||
|---|---|---|
| 62–63 | How about merge the new switch with this one? | |
| llvm/tools/llvm-profgen/ProfileGenerator.cpp | ||
|---|---|---|
| 62–63 | Yeah, let's merge them. And this may also mean we need to put it on afdo-specific path, instead having it in ProfileGenerator::postProcessProfiles. | |
lgtm, thanks.
| llvm/test/tools/llvm-profgen/merge-cold-profile.test | ||
|---|---|---|
| 9 | nit: this should not change? | |
None of the tests cover trim vs no-trim difference, it'd be good to have one, so we check trimming is actually making a difference.
| llvm/test/tools/llvm-profgen/inline-noprobe2.test | ||
|---|---|---|
| 111 |
@wenlei We do have a test case for the trimming here which checked the function won't appear if its total sample is smaller than --profile-summary-cold-count=100 | |
| llvm/test/tools/llvm-profgen/inline-noprobe2.test | ||
|---|---|---|
| 111 | But we don't have a check to make sure main/quick_sort actually appears without trimming, right? If for whatever reason these two never appears even without trimming (--trim-cold-profile=0), this test could be doing nothing. | |
| llvm/test/tools/llvm-profgen/inline-noprobe2.test | ||
|---|---|---|
| 111 | Thanks, looks good now. | |
Here