[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
Tue Jan 12 13:53:42 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:
> 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.


================
Comment at: llvm/tools/llvm-profgen/ProfileGenerator.cpp:349
+      continue;
+    ToRemoveVec.emplace_back(std::make_pair(I.getKey(), &I.second));
+  }
----------------
wmi wrote:
> emplace_back(I.getKey(), &I.second)?
Good catch, fixed


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