[PATCH] D110449: [llvm-profdata] Extend support of --topn to sample profiles

Di Mo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 24 15:27:09 PDT 2021


modimo added a comment.

In D110449#3021837 <https://reviews.llvm.org/D110449#3021837>, @wenlei wrote:

> `hot-func-list` of sample pgo is the equivalent of `topn` for instr pgo. Sample pgo diverged from instr pgo here in the sense we use `hot-func-list` to print a hot function list where "hot" is defined by the dyn-instr percentile based threshold. So simply adding topn might be confusing, as using topn alone for sample pgo won't print the hot function list, unlike instr pgo.
>
> if you want to grow or trim the hot function list, you could use the threshold cutoff switches. Ideally we should unify the switches for both instr pgo and sample pgo.

My usage of `topn` was to be able to compare and analyze a fixed number of functions rather than defining different cut-off values to get similar effects across many different binaries. That being said, this was all running in a script so I could've also had the script do this pruning instead of llvm-profdata.

Unifying switches was the main reason I added this to prof-data, since `topn` being documented but being a complete no-op in sample profile threw me off.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110449



More information about the llvm-commits mailing list