[PATCH] D82355: Add --hot-func-list to llvm-profdata show for sample profiles

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 23 23:57:31 PDT 2020


hoyFB added inline comments.


================
Comment at: llvm/tools/llvm-profdata/llvm-profdata.cpp:1088-1099
+    if (ColNum > 1) {
+      FOS.PadToColumn(ColumnOffset[1]);
+      FOS << R.MaxCount;
+      if (ColNum > 2) {
+        FOS.PadToColumn(ColumnOffset[2]);
+        FOS << R.EntryCount;
+        if (ColNum > 3) {
----------------
wenlei wrote:
> I think we can just assume `ColNum` is `ColumnOffset .size()`, then remove the nested ifs.
yeah, or to loop on `min(ColNum, ColumnOffset.size())` if `ColNum` can ever be greater than `ColumnOffset.size()`. When could that happen?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82355





More information about the llvm-commits mailing list