[PATCH] D133646: Add a utility for converting between different types of remarks

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 10 11:27:14 PDT 2022


paquette created this revision.
paquette added reviewers: thegameg, jroelofs, anemet, fhahn.
Herald added subscribers: arphaman, mgorny.
Herald added a project: All.
paquette requested review of this revision.
Herald added a project: LLVM.

This adds llvm-remarkutil. This is intended to be a general tool for doing stuff with/to remark files.

This patch gives it the following powers:

- `bitstream2yaml` - To convert bitstream remarks to YAML
- `yaml2bitstream` - To convert YAML remarks to bitstream remarks

These are both implemented as subcommands, like

`llvm-remarkutil bitstream2yaml <input_file> -o -`

I ran into an issue where I had some bitstream remarks coming from CI, and I wanted to be able to do stuff with them (e.g. visualize them) But then I noticed we didn't have any tooling for doing that, so I decided to write this thing.

Being able to output YAML as a start seemed like a good idea, since it would allow people to reuse any tooling they may have written based around YAML remarks.

Hopefully it can grow into a more featureful remark utility. :)

Currently there are is an outstanding performance issue (see the TODO) with the bitstream2yaml case. I decided that I'd keep the tool small to start with and have the yaml2bitstream and bitstream2yaml cases be symmetric.

Also I moved the remarks documentation to its own header because it seems a little out of place with "basic commands" and "developer tools"; it's really kind of its own thing.


https://reviews.llvm.org/D133646

Files:
  llvm/docs/CommandGuide/LLVMRemarkUtil.rst
  llvm/docs/CommandGuide/index.rst
  llvm/test/CMakeLists.txt
  llvm/test/lit.cfg.py
  llvm/test/tools/llvm-remarkutil/Inputs/broken-remark
  llvm/test/tools/llvm-remarkutil/Inputs/broken-remark.bitstream
  llvm/test/tools/llvm-remarkutil/Inputs/empty-file
  llvm/test/tools/llvm-remarkutil/Inputs/two-remarks.bitstream
  llvm/test/tools/llvm-remarkutil/Inputs/two-remarks.yaml
  llvm/test/tools/llvm-remarkutil/broken-bitstream-remark.test
  llvm/test/tools/llvm-remarkutil/broken-yaml-remark.test
  llvm/test/tools/llvm-remarkutil/convert.test
  llvm/test/tools/llvm-remarkutil/empty-file.test
  llvm/test/tools/llvm-remarkutil/file-does-not-exist.test
  llvm/test/tools/llvm-remarkutil/missing-subcommand.test
  llvm/tools/llvm-remarkutil/CMakeLists.txt
  llvm/tools/llvm-remarkutil/RemarkUtil.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133646.459299.patch
Type: text/x-patch
Size: 15659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220910/aabee88e/attachment.bin>


More information about the llvm-commits mailing list