[all-commits] [llvm/llvm-project] e10b73: [CSSPGO][llvm-profgen] Merge and trim profile for ...

ictwanglei via All-commits all-commits at lists.llvm.org
Thu Feb 4 11:06:09 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e10b73f6463fca53155ee7cc88ffa87ee96fb1b9
      https://github.com/llvm/llvm-project/commit/e10b73f6463fca53155ee7cc88ffa87ee96fb1b9
  Author: wlei <wlei at fb.com>
  Date:   2021-02-04 (Thu, 04 Feb 2021)

  Changed paths:
    M llvm/test/tools/llvm-profgen/inline-cs-noprobe.test
    M llvm/test/tools/llvm-profgen/inline-cs-pseudoprobe.test
    A llvm/test/tools/llvm-profgen/merge-cold-profile.test
    M llvm/test/tools/llvm-profgen/noinline-cs-noprobe.test
    M llvm/test/tools/llvm-profgen/noinline-cs-pseudoprobe.test
    M llvm/test/tools/llvm-profgen/recursion-compression-noprobe.test
    M llvm/test/tools/llvm-profgen/recursion-compression-pseudoprobe.test
    M llvm/tools/llvm-profgen/ProfileGenerator.cpp
    M llvm/tools/llvm-profgen/ProfileGenerator.h

  Log Message:
  -----------
  [CSSPGO][llvm-profgen] Merge and trim profile for cold context to reduce profile size

This change allows merging and trimming cold context profile in llvm-profgen to solve profile size bloat problem. Currently when the profile's total sample is below threshold(supported by a switch), it will be considered cold and merged into a base context-less profile, which will at least keep the profile quality as good as the baseline(non-cs).

For example, two input profiles:
 [main @ foo @ bar]:60
 [main @ bar]:50
Under threshold = 100, the two profiles will be merge into one with the base context, get result:
 [bar]:110

Added two switches:
`--csprof-cold-thres=<value>`: Specified the total samples threshold for a context profile to be considered cold, with 100 being the default. Any cold context profiles will be merged into context-less base profile by default.
`--csprof-keep-cold`: Force profile generation to keep cold context profiles instead of dropping them. By default, any cold context will not be written to output profile.

Results:
Though not yet evaluating it with the latest CSSPGO, our internal branch shows neutral on performance but significantly reduce the profile size. Detailed evaluation on llvm-profgen with CSSPGO will come later.

Differential Revision: https://reviews.llvm.org/D94111




More information about the All-commits mailing list