On 04/12/25 20:43, Jan Hubicka wrote:
External email: Use caution opening links or attachments


From: Dhruv Chawla <[email protected]>

This patch aims to implement summary support in auto-profile, similar to
LLVM. The summary information stores various information about the
profile being read such as the number of functions, the maximum sample
count, the total number of samples and so on.

It also adds a section called the "detailed summary" which contains a
histogram-based calculation of the minimum execution count for a sample
needed to belong to a specific percentile of samples. This is used to
decide the hot count threshold (which can be controlled with a command
line parameter). The default is any sample belonging to the 99th percentile
being marked as hot.

Signed-off-by: Dhruv Chawla <[email protected]>

gcc/ChangeLog:

       * auto-profile.cc (AUTO_PROFILE_VERSION): Update to 3 from 2.
       (maybe_hot_afdo_count_p): Fix typo
       afdo_hot_bb_threshod -> afdo_hot_bb_threshold.
       (struct summary_info): New struct.
       (summary_info::read): New function.
       (summary_info::get_threshold_count): Likewise.
       (function_instance::read_function_instance): Read
       afdo_profile_info->sum_max directly from summary info.
       (autofdo_source_profile::read): Set afdo_hot_bb_threshold from
       param_hot_bb_count_ws_permille.
       (read_profile): Call summary_info->read.
       (end_auto_profile): Free afdo_summary_info.
       * gcov-io.h (GCOV_TAG_AFDO_SUMMARY): New define.

gcc/c/ChangeLog:

       * Make-lang.in: Update GCOV version to 3.

gcc/cp/ChangeLog:

       * Make-lang.in: Update GCOV version to 3.

gcc/lto/ChangeLog:

       * Make-lang.in: Update GCOV version to 3.

gcc/testsuite/ChangeLog:

       * lib/profopt.exp: Update GCOV version to 3.
---
  gcc/auto-profile.cc           | 135 ++++++++++++++++++++++++++++------
  gcc/c/Make-lang.in            |   4 +-
  gcc/cp/Make-lang.in           |   4 +-
  gcc/gcov-io.h                 |   2 +
  gcc/lto/Make-lang.in          |   4 +-
  gcc/testsuite/lib/profopt.exp |   2 +-
  6 files changed, 123 insertions(+), 28 deletions(-)


OK,
Honza

Committed as r16-6349-gdbe8e0efb7b029.

--
Regards,
Dhruv

Reply via email to