OSDN Git Service

[CSSPGO] Use merged base profile for hot threshold calculation
authorWenlei He <aktoon@gmail.com>
Wed, 3 Feb 2021 21:27:35 +0000 (13:27 -0800)
committerTom Stellard <tstellar@redhat.com>
Sat, 20 Feb 2021 05:21:12 +0000 (21:21 -0800)
commit10712791a9affbea8e6fa474d8a857ea6dfbb955
tree010cb8f6ab723ff0fd191632a1fb6a70bb2b4bec
parentdb88d92217f185d9ab5b8f0a0eddc5dc9ad30659
[CSSPGO] Use merged base profile for hot threshold calculation

Context-sensitive profile effectively split a function profile into many copies each representing the CFG profile of a particular calling context. That makes the count distribution looks more flat as we now have more function profiles each with lower counts, which in turn leads to lower hot thresholds. Now we tells threshold computation to merge context profile first before calculating percentile based cutoffs to compensate for seemingly flat context profile. This can be controlled by swtich `sample-profile-contextless-threshold`.

Earlier measurement showed ~0.4% perf boost with this tuning on spec2k6 for CSSPGO (with pseudo-probe and new inliner).

Differential Revision: https://reviews.llvm.org/D95980
llvm/include/llvm/ProfileData/ProfileCommon.h
llvm/lib/ProfileData/ProfileSummaryBuilder.cpp
llvm/lib/ProfileData/SampleProfReader.cpp
llvm/lib/ProfileData/SampleProfWriter.cpp
llvm/test/Transforms/SampleProfile/csspgo-inline.ll
llvm/test/Transforms/SampleProfile/csspgo-summary.ll [new file with mode: 0644]