[PATCH] D139603: [llvm-profdata] Add option to cap profile output size

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 8 11:56:47 PST 2022


wenlei added inline comments.


================
Comment at: llvm/tools/llvm-profdata/llvm-profdata.cpp:1089-1091
+      size_t NumToRemove = CalculateNumFunctionsToRemove(
+          OriginalFunctionCount, Functions->size(),
+          Writer->getOutputStream().tell(), OutputSizeLimit);
----------------
This heuristic can be quite inaccurate. The number of body sample + call site sample entries can be much better proxy for actual profile size and yet still easily accessible. 

`functionSamples.getBodySamples().size() + functionSamples.getCallsiteSamples().size()`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139603



More information about the llvm-commits mailing list