Name Date Size #Lines LOC

..--

Basic/H--736489

Common/H--26,79318,383

jupyter/H--4,9124,384

AsmMatcherEmitter.cppH A D19-Jan-2025158.3 KiB4,1352,947

AsmWriterEmitter.cppH A D16-Jan-202548.5 KiB1,3451,006

CMakeLists.txtH A D22-Jan-20252.2 KiB8578

CTagsEmitter.cppH A D29-Oct-20242.7 KiB9465

CallingConvEmitter.cppH A D22-Dec-202415.9 KiB440369

CodeEmitterGen.cppH A D16-Jan-202521.1 KiB614476

CodeGenMapTable.cppH A D29-Oct-202423.8 KiB609327

CompressInstEmitter.cppH A D14-Jan-202539.3 KiB909645

DAGISelEmitter.cppH A D13-Dec-20247.3 KiB201133

DAGISelMatcherEmitter.cppH A D11-Dec-202447.2 KiB1,3801,150

DAGISelMatcherGen.cppH A D16-Jan-202543.6 KiB1,096636

DAGISelMatcherOpt.cppH A D16-Jan-202518.2 KiB499311

DFAEmitter.cppH A D16-Jan-202512.6 KiB372272

DFAEmitter.hH A D16-Feb-20234 KiB11040

DFAPacketizerEmitter.cppH A D29-Oct-202413.1 KiB359266

DXILEmitter.cppH A D22-Jan-202523.5 KiB498355

DecoderEmitter.cppH A D16-Jan-202592.8 KiB2,6651,869

DisassemblerEmitter.cppH A D29-Oct-20246.1 KiB13838

ExegesisEmitter.cppH A D11-Sep-20249 KiB255195

FastISelEmitter.cppH A D16-Jan-202530 KiB886657

GlobalISelCombinerEmitter.cppH A D16-Jan-202597.6 KiB2,7161,918

GlobalISelEmitter.cppH A D27-Jan-202597.2 KiB2,5291,837

InstrDocsEmitter.cppH A D21-Nov-20247.2 KiB230167

InstrInfoEmitter.cppH A D24-Jan-202548.1 KiB1,3641,095

MacroFusionPredicatorEmitter.cppH A D01-Oct-202411.3 KiB290219

OptionParserEmitter.cppH A D28-Jan-202519.7 KiB

OptionRSTEmitter.cppH A D29-Oct-20243.2 KiB

PseudoLoweringEmitter.cppH A D29-Oct-202412.7 KiB320234

README.mdH A D13-Dec-20232.5 KiB5846

RegisterBankEmitter.cppH A D04-Oct-202416.2 KiB352247

RegisterInfoEmitter.cppH A D29-Jan-202568.7 KiB1,8971,493

SDNodeInfoEmitter.cppH A D28-Jan-202512.1 KiB

SearchableTableEmitter.cppH A D21-Jan-202531.9 KiB872712

SubtargetEmitter.cppH A D22-Jan-202580.9 KiB2,1731,628

TableGenBackends.hH A D20-Sep-20243 KiB7311

WebAssemblyDisassemblerEmitter.cppH A D16-Jan-20256.5 KiB178134

WebAssemblyDisassemblerEmitter.hH A D18-Sep-2024945 3111

X86DisassemblerShared.hH A D09-Feb-20241.9 KiB5628

X86DisassemblerTables.cppH A D16-Jan-202544.4 KiB1,130991

X86DisassemblerTables.hH A D09-Feb-202411.7 KiB28751

X86FoldTablesEmitter.cppH A D18-Oct-202428.6 KiB765553

X86InstrMappingEmitter.cppH A D16-Jan-202513.2 KiB352266

X86ManualFoldTables.defH A D20-Nov-20248.4 KiB298295

X86ManualInstrMapping.defH A D22-Nov-202411.4 KiB352347

X86MnemonicTables.cppH A D18-Sep-20243.2 KiB9262

X86ModRMFilters.cppH A D09-Feb-2024630 248

X86ModRMFilters.hH A D09-Feb-20244.5 KiB14359

X86RecognizableInstr.cppH A D13-Jan-202549.5 KiB1,4201,222

X86RecognizableInstr.hH A D03-Aug-202417 KiB386238

llvm-min-tblgen.cppH A D02-Jan-2025840

llvm-tblgen.cppH A D02-Jan-2025840

tdtagsH A D19-Jan-201910.7 KiB453350

README.md

1# LLVM TableGen
2
3The purpose of TableGen is to generate complex output files based on information
4from source files that are significantly easier to code than the output files would be, and also easier to maintain and modify over time.
5
6The information is coded in a declarative style involving classes and records,
7which are then processed by TableGen.
8
9```
10class Hello <string _msg> {
11  string msg = !strconcat("Hello ", _msg);
12}
13
14def HelloWorld: Hello<"world!"> {}
15```
16```
17------------- Classes -----------------
18class Hello<string Hello:_msg = ?> {
19  string msg = !strconcat("Hello ", Hello:_msg);
20}
21------------- Defs -----------------
22def HelloWorld {        // Hello
23  string msg = "Hello world!";
24}
25```
26[Try this example on Compiler Explorer.](https://godbolt.org/z/13xo1P5oz)
27
28The internalized records are passed on to various backends, which extract
29information from a subset of the records and generate one or more output files.
30
31These output files are typically .inc files for C++, but may be any type of file
32that the backend developer needs.
33
34Resources for learning the language:
35* [TableGen Overview](https://llvm.org/docs/TableGen/index.html)
36* [Programmer's reference guide](https://llvm.org/docs/TableGen/ProgRef.html)
37* [Tutorial](jupyter/tablegen_tutorial_part_1.ipynb)
38* [Tools for Learning LLVM TableGen](https://blog.llvm.org/posts/2023-12-07-tools-for-learning-llvm-tablegen/)
39* [Lessons in TableGen](https://www.youtube.com/watch?v=45gmF77JFBY) (video),
40  [slides](https://archive.fosdem.org/2019/schedule/event/llvm_tablegen/attachments/slides/3304/export/events/attachments/llvm_tablegen/slides/3304/tablegen.pdf)
41* [Improving Your TableGen Descriptions](https://www.youtube.com/watch?v=dIEVUlsiktQ)
42  (video), [slides](https://llvm.org/devmtg/2019-10/slides/Absar-ImprovingYourTableGenDescription.pdf)
43
44Writing TableGen backends:
45* [TableGen Backend Developer's Guide](https://llvm.org/docs/TableGen/BackGuide.html)
46* [How to write a TableGen backend](https://www.youtube.com/watch?v=UP-LBRbvI_U)
47  (video), [slides](https://llvm.org/devmtg/2021-11/slides/2021-how-to-write-a-tablegen-backend.pdf), also available as a
48	[notebook](jupyter/sql_query_backend.ipynb).
49
50TableGen in MLIR:
51* [Operation Definition Specification](https://mlir.llvm.org/docs/DefiningDialects/Operations/)
52* [Defining Dialect Attributes and Types](https://mlir.llvm.org/docs/DefiningDialects/AttributesAndTypes/)
53
54Useful tools:
55* [TableGen Jupyter Kernel](jupyter/)
56* [TableGen LSP Language Server](https://mlir.llvm.org/docs/Tools/MLIRLSP/#tablegen-lsp-language-server--tblgen-lsp-server)
57
58