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

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 14 12:28:53 PST 2021


wlei added inline comments.


================
Comment at: llvm/test/tools/llvm-profgen/merge-cold-profile.test:6
+; Test --csprof-keep-cold
+; RUN: llvm-profgen --perfscript=%S/Inputs/recursion-compression.perfscript --binary=%S/Inputs/recursion-compression.perfbin --output=%t --compress-recursion=-1 --csprof-cold-thres=100 --csprof-keep-cold
+; RUN: FileCheck %s --input-file %t --check-prefix=CHECK-KEEP-COLD
----------------
wmi wrote:
> wlei wrote:
> > wmi wrote:
> > > I see "[main:2 @ foo:5 @ fa:8 @ fa:7 @ fb:5 @ fb]:9:4" is trimmed but [fa]:14:4 is kept, so the threshold should be 10?
> > The second test is for `--csprof-keep-cold`, which means we only merge the cold profile but don't remove it.
> > So I intended to use a very high threshold(100) to let all the profiles merge together and keep it.
> Ok, I see. Thanks for explaining it.
> 
> It means if the total count of a profile with context is smaller than the csprof-cold-thres, it will be merged into its base profile. If the total count of the base profile after all merge is done is still smaller than the csprof-cold-thres, it will be trimmed unless csprof-keep-cold flag is specified. Is it correct? Better document it more clearly in the flag desc.
Yes, that's exactly what I mean. Will update the flag desc, thanks for your feedback.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94111/new/

https://reviews.llvm.org/D94111



More information about the llvm-commits mailing list