[TableGen] Add a !listremove() bang operator
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 9 Dec 2022 15:03:11 +0000 (15:03 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 9 Dec 2022 15:03:18 +0000 (15:03 +0000)
commitd5765371092d0f3a6fa72f8f130bb75d1d90de08
treec44965f2ddebdb1429a488a563a82039957ecba2
parentf3379feabe38fd3711b13ffcf6de4aab03b7ccdc
[TableGen] Add a !listremove() bang operator

This patch proposes to add a !listremove() bang operator to allow us to prune list entries by removing any entries from the first list arg that are also contained in the second list arg.

The particular use case I have in mind is for improved analysis of x86 scheduler models for which I'm hoping to start using the CodeGenProcModel 'Unsupported' features lists, which lists the ISA features a particular model DOESN'T support - with such a diverse and growing list of x86 ISAs, I don't want to have to update all these lists with every ISA change to every model - so I'm intending to keep a single central list of all x86 features, and then have the each model "remove" the features that it supports via a !listremove() - leaving just the unsupported ones.

Differential Revision: https://reviews.llvm.org/D139642
llvm/docs/TableGen/ProgRef.rst
llvm/include/llvm/TableGen/Record.h
llvm/lib/TableGen/Record.cpp
llvm/lib/TableGen/TGLexer.cpp
llvm/lib/TableGen/TGLexer.h
llvm/lib/TableGen/TGParser.cpp
llvm/test/TableGen/listremove.td [new file with mode: 0644]
llvm/utils/kate/llvm-tablegen.xml