|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | - | - |
| Basic/ | H | - | - | 736 | 489 |
| Common/ | H | - | - | 26,793 | 18,383 |
| jupyter/ | H | - | - | 4,912 | 4,384 |
| AsmMatcherEmitter.cpp | H A D | 19-Jan-2025 | 158.3 KiB | 4,135 | 2,947 |
| AsmWriterEmitter.cpp | H A D | 16-Jan-2025 | 48.5 KiB | 1,345 | 1,006 |
| CMakeLists.txt | H A D | 22-Jan-2025 | 2.2 KiB | 85 | 78 |
| CTagsEmitter.cpp | H A D | 29-Oct-2024 | 2.7 KiB | 94 | 65 |
| CallingConvEmitter.cpp | H A D | 22-Dec-2024 | 15.9 KiB | 440 | 369 |
| CodeEmitterGen.cpp | H A D | 16-Jan-2025 | 21.1 KiB | 614 | 476 |
| CodeGenMapTable.cpp | H A D | 29-Oct-2024 | 23.8 KiB | 609 | 327 |
| CompressInstEmitter.cpp | H A D | 14-Jan-2025 | 39.3 KiB | 909 | 645 |
| DAGISelEmitter.cpp | H A D | 13-Dec-2024 | 7.3 KiB | 201 | 133 |
| DAGISelMatcherEmitter.cpp | H A D | 11-Dec-2024 | 47.2 KiB | 1,380 | 1,150 |
| DAGISelMatcherGen.cpp | H A D | 16-Jan-2025 | 43.6 KiB | 1,096 | 636 |
| DAGISelMatcherOpt.cpp | H A D | 16-Jan-2025 | 18.2 KiB | 499 | 311 |
| DFAEmitter.cpp | H A D | 16-Jan-2025 | 12.6 KiB | 372 | 272 |
| DFAEmitter.h | H A D | 16-Feb-2023 | 4 KiB | 110 | 40 |
| DFAPacketizerEmitter.cpp | H A D | 29-Oct-2024 | 13.1 KiB | 359 | 266 |
| DXILEmitter.cpp | H A D | 22-Jan-2025 | 23.5 KiB | 498 | 355 |
| DecoderEmitter.cpp | H A D | 16-Jan-2025 | 92.8 KiB | 2,665 | 1,869 |
| DisassemblerEmitter.cpp | H A D | 29-Oct-2024 | 6.1 KiB | 138 | 38 |
| ExegesisEmitter.cpp | H A D | 11-Sep-2024 | 9 KiB | 255 | 195 |
| FastISelEmitter.cpp | H A D | 16-Jan-2025 | 30 KiB | 886 | 657 |
| GlobalISelCombinerEmitter.cpp | H A D | 16-Jan-2025 | 97.6 KiB | 2,716 | 1,918 |
| GlobalISelEmitter.cpp | H A D | 27-Jan-2025 | 97.2 KiB | 2,529 | 1,837 |
| InstrDocsEmitter.cpp | H A D | 21-Nov-2024 | 7.2 KiB | 230 | 167 |
| InstrInfoEmitter.cpp | H A D | 24-Jan-2025 | 48.1 KiB | 1,364 | 1,095 |
| MacroFusionPredicatorEmitter.cpp | H A D | 01-Oct-2024 | 11.3 KiB | 290 | 219 |
| OptionParserEmitter.cpp | H A D | 28-Jan-2025 | 19.7 KiB | | |
| OptionRSTEmitter.cpp | H A D | 29-Oct-2024 | 3.2 KiB | | |
| PseudoLoweringEmitter.cpp | H A D | 29-Oct-2024 | 12.7 KiB | 320 | 234 |
| README.md | H A D | 13-Dec-2023 | 2.5 KiB | 58 | 46 |
| RegisterBankEmitter.cpp | H A D | 04-Oct-2024 | 16.2 KiB | 352 | 247 |
| RegisterInfoEmitter.cpp | H A D | 29-Jan-2025 | 68.7 KiB | 1,897 | 1,493 |
| SDNodeInfoEmitter.cpp | H A D | 28-Jan-2025 | 12.1 KiB | | |
| SearchableTableEmitter.cpp | H A D | 21-Jan-2025 | 31.9 KiB | 872 | 712 |
| SubtargetEmitter.cpp | H A D | 22-Jan-2025 | 80.9 KiB | 2,173 | 1,628 |
| TableGenBackends.h | H A D | 20-Sep-2024 | 3 KiB | 73 | 11 |
| WebAssemblyDisassemblerEmitter.cpp | H A D | 16-Jan-2025 | 6.5 KiB | 178 | 134 |
| WebAssemblyDisassemblerEmitter.h | H A D | 18-Sep-2024 | 945 | 31 | 11 |
| X86DisassemblerShared.h | H A D | 09-Feb-2024 | 1.9 KiB | 56 | 28 |
| X86DisassemblerTables.cpp | H A D | 16-Jan-2025 | 44.4 KiB | 1,130 | 991 |
| X86DisassemblerTables.h | H A D | 09-Feb-2024 | 11.7 KiB | 287 | 51 |
| X86FoldTablesEmitter.cpp | H A D | 18-Oct-2024 | 28.6 KiB | 765 | 553 |
| X86InstrMappingEmitter.cpp | H A D | 16-Jan-2025 | 13.2 KiB | 352 | 266 |
| X86ManualFoldTables.def | H A D | 20-Nov-2024 | 8.4 KiB | 298 | 295 |
| X86ManualInstrMapping.def | H A D | 22-Nov-2024 | 11.4 KiB | 352 | 347 |
| X86MnemonicTables.cpp | H A D | 18-Sep-2024 | 3.2 KiB | 92 | 62 |
| X86ModRMFilters.cpp | H A D | 09-Feb-2024 | 630 | 24 | 8 |
| X86ModRMFilters.h | H A D | 09-Feb-2024 | 4.5 KiB | 143 | 59 |
| X86RecognizableInstr.cpp | H A D | 13-Jan-2025 | 49.5 KiB | 1,420 | 1,222 |
| X86RecognizableInstr.h | H A D | 03-Aug-2024 | 17 KiB | 386 | 238 |
| llvm-min-tblgen.cpp | H A D | 02-Jan-2025 | 840 | | |
| llvm-tblgen.cpp | H A D | 02-Jan-2025 | 840 | | |
| tdtags | H A D | 19-Jan-2019 | 10.7 KiB | 453 | 350 |
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