[PATCH] D156869: Remark Util intoduce remark count

Zain Jaffal via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 11 08:25:09 PDT 2023


zjaffal marked 6 inline comments as done.
zjaffal added inline comments.


================
Comment at: llvm/tools/llvm-remarkutil/RemarkCounter.h:126
+  /// item in the row is the count for a specified key.
+  std::map<std::string, SmallVector<int, 4>> CountByKeysMap;
+  /// A set of all the keys found in the remark file. The second argument is the
----------------
paquette wrote:
> - can this be a DenseMap?
> - also why map strings and not the GroupBy enum?
Because I am using `std::string` DenseMap won't work. 

The reason for why it is not the GroupBy enum is because this map acts as the columns for the collection so first we collect all the keys that match the specified keys and then based on GroupBy we decide what the rows will be 
for example of `GroupBy` is by source you will get something like 

| source        | key1 | key2 | key3 |
|---------------|------|------|------|
| path/to/file1 | 0    | 1    | 3    |
| path/to/file2 |     1 | 0    | 2    |
| path/to/file3 | 2    | 3    | 1    |

if `GroupBy` is function you will get 

| function        | key1 | key2 | key3 |
|---------------|------|------|------|
| func1 | 0    | 1    | 3    |
| func2 | 1     | 0    | 2    |
| func3 | 2    | 3    | 1    |


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156869



More information about the llvm-commits mailing list