[PATCH] D147812: [InstrProf] Use BalancedPartitioning to order temporal profiling trace data

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 11 13:27:03 PDT 2023


davidxl added a comment.

A few high level questions:

Different types of traces don't have the same frequency, so it might be useful to support weighting. The frequency certain trace pattern appear in the profile data does not necessarily match to their frequency in real world usage. To support this, some kind of symbolic id may be needed to annotate the trace data.

The cost metric is entropy like. Have you tried other metrics such as gini impurity?



================
Comment at: llvm/lib/Support/BalancedPartitioning.cpp:201
+  // Initialize signatures. Empirically the number of corresponding UtilityNodes
+  // is 4x larger than the number of FunctionNodes.
+  SignatureMapT Signatures;
----------------
why 4x larger? Is the number of utility nodes the same as 'the number of traces * number of cutoffs" ?


================
Comment at: llvm/tools/llvm-profdata/llvm-profdata.cpp:3038
 
+static int order_main(int argc, const char *argv[]) {
+  cl::opt<std::string> Filename(cl::Positional, cl::desc("<profdata-file>"));
----------------
Need to document it in commandline guide.


================
Comment at: llvm/tools/llvm-profdata/llvm-profdata.cpp:3046
+      "cutoffs", cl::CommaSeparated,
+      cl::desc("Timestamp cutoff values used to initialize function nodes for "
+               "ordering functions"),
----------------
How are the default values selected?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147812



More information about the llvm-commits mailing list