[RFC] TableGen on Compiler Explorer

I have proposed adding TableGen to Compiler Explorer: Add the LLVM TableGen language by DavidSpickett · Pull Request #5629 · compiler-explorer/compiler-explorer · GitHub

This is a few less steps than the notebooks we have right now, and of course we can share snippets much more easily. I’m sure many of you have used Compiler Explorer already.

The change is pretty straight forward but if anyone has any comments please leave them on the review there or here.

If anyone is an expert with the syntax highlighting (it uses Monaco) I’d appreciate any tips there. I’ve got something basic working for now.

The first change only has 17.0.1’s llvm-tblegen, my first follow up will be to add the “trunk” / “main” version as well so we can use new features as they come in.

11 Likes

This is great! Thanks for doing this! :smile:

Aside from adding more versions of tblgen, can we provide a method to include infrastructure TableGens (for example, SearchableTable.td in llvm/include/llvm/TableGen/ basicly and those in llvm/include/llvm/Target/*.td optionally)? And if we have added clang-tblgen in the future, we may include the infrastructure TableGens in clang project too.

…and it’s live! Compiler Explorer

Didn’t expect that so soon.

For now, some of these are in the install dir if you know where to look: https://godbolt.org/z/nor5j3rdh

Anything found in a normal install at include/llvm/ is there.

For the others yes, we’d need to get those installed. Perhaps adding <install>/include/ as a default -I option is a good idea to go with that.

The existing llvm install includes clang-tblgen as well so that could be added pretty easily. The others potentially we can update how the Compiler Explorer packages llvm to include them (not sure if it already customises it).

1 Like

This has been done, example: Compiler Explorer

Reminder that if you include something like Target.td you will get a whole ton of output and we don’t have a way to filter that right now.

I’m hoping that [RFC][TableGen] New llvm-tblgen backend to print records/classes hierarchy as a dot graph may provide a way to do that for Compiler Explorer and Notebooks in the future.

Also we have the latest version of llvm-tblgen available now, in addition to 17.0.1.