[PATCH] D83852: [llvm-profdata] Implement llvm-profdata overlap for sample profiles

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 1 10:14:11 PDT 2020


wmi accepted this revision.
wmi added a comment.
This revision is now accepted and ready to land.

Thanks. Another suggestion about comment. Other than that, LGTM.



================
Comment at: llvm/tools/llvm-profdata/llvm-profdata.cpp:1053-1054
+  /// score from FS scores of functions.
+  double weightByImportance(double FuncSimilarity, uint64_t BaseFuncSample,
+                            uint64_t TestFuncSample) const;
+};
----------------
Both weightFuncSimilarity and weightByImportance considers the weight of the function in the profile, so at the beginning I felt confused what are their difference. I find out the difference is  weightFuncSimilarity absorbs the weight difference into the similarity so the similarity is still in the range of 0~1, while weightByImportance multiplies the similarity by weight ratio of the function in the profile (the average ratio of the two profiles), so the aggregate similarity of all the functions in the profiles will be in the range of 0~1. Please correct me if I am wrong. But it is better to make the intention of these two functions more clear in the comments.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83852



More information about the llvm-commits mailing list