[PATCH] D16005: Display detailed profile summary in llvm-profdata tool

David Li via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 11 16:16:09 PST 2016


davidxl added inline comments.

================
Comment at: tools/llvm-profdata/llvm-profdata.cpp:82
@@ +81,3 @@
+  if (Count > MaxBlockCount)
+    MaxBlockCount = Count;
+  NumBlocks++;
----------------
This is reasonable -- the benefit of allowing computing summary of different cutoffs with the same PS is minimal.

================
Comment at: tools/llvm-profdata/llvm-profdata.cpp:83
@@ +82,3 @@
+    MaxBlockCount = Count;
+  NumBlocks++;
+  CountFrequencies[Count]++;
----------------
so -- for option part, using float is fine. What I am concerned is PorgramSummaryEntry has a float member. Eventually, I will need to write those entries to Indexed Profile header, so an integer representation there is better.

================
Comment at: tools/llvm-profdata/llvm-profdata.cpp:109
@@ +108,3 @@
+  // CountFrequencies is sorted in the descending order of keys (counts).
+  for (auto Entry : CountFrequencies) {
+    uint64_t Count = Entry.first;
----------------
current accumuated count can be passed to the Accumator methods. I think vsk's suggestion makes the code slightly more readable.


http://reviews.llvm.org/D16005





More information about the llvm-commits mailing list