[llvm-remarkutil] Add an option to print out function sizes
authorJessica Paquette <jpaquette@apple.com>
Tue, 27 Sep 2022 21:26:37 +0000 (14:26 -0700)
committerJessica Paquette <jpaquette@apple.com>
Wed, 28 Sep 2022 22:45:55 +0000 (15:45 -0700)
commita4591a61df9c7d501012fa191ed8bc406836afee
tree0f7609eeeea7a0ff7fb3b9b7409bdead7ad50d50
parent704b2e162c53ab964225799106ba3a45ee888d9f
[llvm-remarkutil] Add an option to print out function sizes

This adds an `instruction-count` command to llvm-remarkutil.

```
llvm-remarkutil instruction-count --parser=<bitstream|yaml> <file>
```

This will, for now, only print out asm-printer `InstructionCount` remarks.

Frequently I need to find out things like "what are the top 10 largest
functions" in a given project.

This makes it so we can find that information quickly and easily from any
format of remarks.

I chose a CSV because I usually want to stick these into a spreadsheet, and
the data is two-dimensional.

In the future, we may want to change this to another format if we add more
complicated data.

Differential Revision: https://reviews.llvm.org/D134765
llvm/docs/CommandGuide/llvm-remarkutil.rst
llvm/test/tools/llvm-remarkutil/Inputs/instruction-count.yaml [new file with mode: 0644]
llvm/test/tools/llvm-remarkutil/Inputs/made-up-fake-remarks.yaml [new file with mode: 0644]
llvm/test/tools/llvm-remarkutil/broken-bitstream-remark.test
llvm/test/tools/llvm-remarkutil/broken-yaml-remark.test
llvm/test/tools/llvm-remarkutil/empty-file.test
llvm/test/tools/llvm-remarkutil/instruction-count.test [new file with mode: 0644]
llvm/test/tools/llvm-remarkutil/no-instruction-count.test [new file with mode: 0644]
llvm/tools/llvm-remarkutil/RemarkUtil.cpp