TBLGEN(1)
๐ TBLGEN(1) โ Description to C++ Code ๐
bestie, welcome to the LLVM manual page for TBLGEN(1) โ aka the *-tblgen family. this page is long, so here's the first chunk, and every single flag is coming with us. ๐
๐ NAME ๐
tblgen โ Description to C++ Code ๐
๐ฆ SYNOPSIS ๐ฆ
clang-tblgen [options] [filename]
lldb-tblgen [options] [filename]
llvm-tblgen [options] [filename]
mlir-tblgen [options] [filename]
๐ธ DESCRIPTION ๐ธ
okay so *-tblgen is a whole little family of programs, and the way that they work is: they translate target description files โ the .td files โ into C++ code and other output formats. slay. most users of LLVM will not need to use this program, no cap: it's only for writing parts of the compiler, debugger, and LLVM target backends.
the details of the input and output of the *-tblgen programs are beyond the scope of this short introduction. peep the TableGen Overview for an introduction and for references to additional TableGen documents. ๐
the filename argument specifies the name of the Target Description (.td) file that TableGen processes.
okay but fr, if you're not building a compiler/debugger/backend, this is probably not your main character moment. ๐
๐ OPTIONS ๐
๐ธ General Options ๐ธ
-helpโ prints a description of the command line options. ๐ซถ-help-listโ prints a description of the command line options in a simple list format.-D=macronameโ names a macro to define. the name gets defined, but it has no particular value. ๐-d=filenameโ names the dependency filename.-debugโ turns debug output on.-dump-jsonโ dumps a JSON representation of all records, suitable for further automated processing. โจ-I directoryโ tells TableGen where to find other target description files for inclusion. directory should be a full or partial path to a directory that contains target description files.-null-backendโ parses the source files and builds the records, but runs no backend at all. useful for timing the frontend. โฑ๏ธ-o filenameโ sets the output file name. if filename is-, then*-tblgensends its output to standard output.-print-recordsโ prints all classes and records to standard output. this is the default backend option, bestie. ๐-print-detailed-recordsโ prints a detailed report of all global variables, classes, and records to standard output.-statsโ prints a report with any statistics collected by the backend. ๐-time-phasesโ times the parser and backend phases and prints a report.-versionโ shows the version number of the program. ๐ท๏ธ-write-if-changedโ writes the output file only if it is new or has changed. iconic.
๐ clang-tblgen Options ๐
here's the clang-tblgen menu, bestie โ every single flag, in the order the page gives them. ๐
-gen-clang-attr-classesโ makes Clang attribute classes. ๐-gen-clang-attr-parser-string-switchesโ emits all parser-related attribute string switches.-gen-clang-attr-subject-match-rules-parser-string-switchesโ emits all parser-related attribute subject match rule string switches.-gen-clang-attr-implโ makes Clang attribute implementations.-gen-clang-attr-list"โ makes a Clang attribute list. ๐-gen-clang-attr-subject-match-rule-listโ makes a Clang attribute subject match rule list.-gen-clang-attr-pch-readโ makes a Clang PCH attribute reader.-gen-clang-attr-pch-writeโ makes a Clang PCH attribute writer.-gen-clang-attr-has-attribute-implโ makes a Clang attribute spelling list.-gen-clang-attr-spelling-indexโ makes a Clang attribute spelling index.-gen-clang-attr-ast-visitorโ makes a recursive AST visitor for Clang attributes.-gen-clang-attr-template-instantiateโ makes a Clang template instantiate code.-gen-clang-attr-parsed-attr-listโ makes a Clang parsed attribute list.-gen-clang-attr-parsed-attr-implโ makes the Clang parsed attribute helpers.-gen-clang-attr-parsed-attr-kindsโ makes a Clang parsed attribute kinds.-gen-clang-attr-text-node-dumpโ makes a Clang attribute text node dumper.-gen-clang-attr-node-traverseโ makes a Clang attribute traverser.-gen-clang-diags-defsโ makes Clang diagnostics definitions.-clang-component componentโ only use warnings from the specified component.-gen-clang-diag-groupsโ makes Clang diagnostic groups.-gen-clang-diags-index-nameโ makes a Clang diagnostic name index.-gen-clang-basic-readerโ makes ClangBasicReaderclasses.-gen-clang-basic-writerโ makes ClangBasicWriterclasses.-gen-clang-comment-nodesโ makes Clang AST comment nodes.-gen-clang-decl-nodesโ makes Clang AST declaration nodes.-gen-clang-stmt-nodesโ makes Clang AST statement nodes.-gen-clang-type-nodesโ makes Clang AST type nodes.-gen-clang-type-readerโ makes the ClangAbstractTypeReaderclass.-gen-clang-type-writerโ makes the ClangAbstractTypeWriterclass.-gen-clang-opcodesโ makes Clang constexpr interpreter opcodes.-gen-clang-sa-checkersโ makes Clang static analyzer checkers. ๐-gen-clang-comment-html-tagsโ makes efficient matchers for HTML tag names that are used in documentation comments.-gen-clang-comment-html-tags-propertiesโ makes efficient matchers for HTML tag properties.-gen-clang-comment-html-named-character-referencesโ makes a function to translate named character references to UTF-8 sequences.-gen-clang-comment-command-infoโ makes command properties for commands that are used in documentation comments.-gen-clang-comment-command-listโ makes a list of commands that are used in documentation comments.-gen-clang-opencl-builtinsโ makes OpenCL builtin declaration handlers.-gen-arm-neonโ writesarm_neon.hfor Clang.-gen-arm-fp16โ writesarm_fp16.hfor Clang.-gen-arm-bf16โ writesarm_bf16.hfor Clang.-gen-arm-neon-semaโ makes ARM NEON sema support for Clang.-gen-arm-neon-testโ makes ARM NEON tests for Clang.-gen-arm-immcheck-typesโ writesarm_immcheck_types.incfor Clang.-gen-arm-sve-headerโ writesarm_sve.hfor Clang.-gen-arm-sve-builtinsโ writesarm_sve_builtins.incfor Clang.-gen-arm-sve-builtin-codegenโ writesarm_sve_builtin_cg_map.incfor Clang.-gen-arm-sve-typeflagsโ writesarm_sve_typeflags.incfor Clang.-gen-arm-sve-sema-rangechecksโ writesarm_sve_sema_rangechecks.incfor Clang.-gen-arm-mve-headerโ writesarm_mve.hfor Clang.-gen-arm-mve-builtin-defโ makes ARM MVE builtin definitions for Clang.-gen-arm-mve-builtin-semaโ makes ARM MVE builtin sema checks for Clang.-gen-arm-mve-builtin-codegenโ makes ARM MVE builtin code-generator for Clang.-gen-arm-mve-builtin-aliasesโ makes a list of valid ARM MVE builtin aliases for Clang.-gen-arm-cde-headerโ writesarm_cde.hfor Clang.-gen-arm-cde-builtin-defโ makes ARM CDE builtin definitions for Clang.-gen-arm-cde-builtin-semaโ makes ARM CDE builtin sema checks for Clang.-gen-arm-cde-builtin-codegenโ makes ARM CDE builtin code-generator for Clang.-gen-arm-cde-builtin-aliasesโ makes a list of valid ARM CDE builtin aliases for Clang.-gen-riscv-vector-headerโ writesriscv_vector.hfor Clang.-gen-riscv-vector-builtinsโ writesriscv_vector_builtins.incfor Clang.-gen-riscv-vector-builtin-codegenโ writesriscv_vector_builtin_cg.incfor Clang.-gen-riscv-sifive-vector-builtinsโ writesriscv_sifive_vector_builtins.incfor Clang.-gen-riscv-sifive-vector-builtin-codegenโ writesriscv_sifive_vector_builtin_cg.incfor Clang.-gen-attr-docsโ makes attribute documentation.-gen-diag-docsโ makes diagnostic documentation.-gen-opt-docsโ makes option documentation.-gen-clang-data-collectorsโ makes data collectors for AST nodes.-gen-clang-test-pragma-attribute-supported-attributesโ makes a list of attributes supported by#pragma Clang attributefor testing purposes. ๐งช
๐ซถ lldb-tblgen Options ๐ซถ
three options, and bestie, these are written without a leading dash in the page โ keeping them exactly like that. ๐
gen-lldb-option-defsโ makes lldbOptionDefinitionvalues.gen-lldb-property-defsโ makes lldbPropertyDefinitionvalues.gen-lldb-property-enum-defsโ makes lldbPropertyDefinitionenum values.
๐ฅ llvm-tblgen Options ๐ฅ
-gen-asm-matcherโ makes the assembly instruction matcher.-match-prefix=prefixโ makes-gen-asm-matchermatch only instructions with the given prefix.-gen-asm-parserโ makes the assembly instruction parser.-asmparsernum=nโ makes-gen-asm-parseremit assembly parser number n.-gen-asm-writerโ makes the assembly writer.-asmwriternum=nโ makes-gen-asm-writeremit assembly writer number n.-gen-attrsโ makes attributes.-gen-automataโ makes generic automata.-gen-callingconvโ makes calling convention descriptions.-gen-compress-inst-emitterโ makes RISC-V compressed instructions.-gen-ctagsโ makes a ctags-compatible index.-gen-dag-iselโ makes a DAG (directed acyclic graph) instruction selector.-instrument-coverageโ makes-gen-dag-iselgenerate tables to help identify the patterns matched.-omit-commentsโ makes-gen-dag-iselomit comments; the default isfalse.-gen-dfa-packetizerโ makes a DFA Packetizer for VLIW targets.-gen-directive-declโ makes directive related declaration code (header file).-gen-directive-genโ makes the directive related implementation code part.-gen-directive-implโ makes directive related implementation code.-gen-disassemblerโ makes the disassembler.-gen-emitterโ makes the machine code emitter.-gen-exegesisโ makesllvm-exegesistables.-gen-fast-iselโ makes a"fast"instruction selector.-gen-global-iselโ makes the GlobalISel selector.-gisel-coverage-file=filenameโ sets the file from which to retrieve coverage information.-instrument-gisel-coverageโ makes-gen-global-iselgenerate coverage instrumentation.-optimize-match-tableโ makes-gen-global-iselgenerate an optimized version of the match table.-warn-on-skipped-patternsโ makes-gen-global-iselexplain why a pattern was skipped for inclusion. ๐-gen-global-isel-combinerโ bestie this one generates the GlobalISel combiner, that's it, that's the whole vibe โจ-combiners=listโ tells-gen-global-isel-combinerwhich combiners to actually emit, like handing it a guest list ๐-gicombiner-debug-cxxpredsโ adds debug comments to every single C++ predicate that-gen-global-isel-combinerspits out. living for the documentation crumbs ngl ๐-gicombiner-stop-after-parseโ makes-gen-global-isel-combinerstop processing right after it parses the rules, then dumps the state. quitting while you're ahead, iconic ๐ซถ-gen-instr-infoโ generates instruction descriptions ๐-gen-instr-docsโ generates instruction documentation ๐-gen-intrinsic-enumsโ generates intrinsic enums ๐ธ-intrinsic-prefix=prefixโ makes-gen-intrinsic-enumsgenerate intrinsics using this target prefix ๐ฏ-gen-intrinsic-implโ generates intrinsic information ๐-gen-opt-parser-defsโ generates options definitions โ๏ธ-gen-opt-rstโ generates option RST ๐-gen-pseudo-loweringโ generates pseudo instruction lowering ๐-gen-register-bankโ generates register bank descriptions ๐ฆ-gen-register-infoโ generates registers and register classes info ๐-register-info-debugโ makes-gen-register-infodump register information for debugging. detective mode fr ๐-gen-searchable-tablesโ generates generic searchable tables. the page says see TableGen BackEnds for a detailed description โ go read that bestie, iykyk ๐-gen-subtargetโ generates subtarget enumerations ๐ง-gen-x86-EVEX2VEX-tablesโ generates X86 EVEX to VEX compress tables. yes the casing is exactly like that, don't come for me ๐-gen-x86-fold-tablesโ generates X86 fold tables ๐๏ธ-long-string-literalsโ when emitting large string tables, prefer string literals over comma-separated char literals. the page says this can be a readability and compile-time performance win, but it upsets some compilers ๐ญ so like. proceed with caution babes-print-enumsโ prints enumeration values for a class ๐ข-class=classnameโ makes-print-enumsprint the enumeration list for the specified class. tell it which one or it's just guessing ๐-print-setsโ prints expanded sets for testing DAG exprs. testing only, main character energy for a debug flag honestly ๐ฆ
๐ง mlir-tblgen Options ๐ง
okay so these are the mlir-tblgen ones, different menu, same girlboss ๐
-gen-avail-interface-declsโ generates availability interface declarations โจ-gen-avail-interface-defsโ generates op interface definitions. (that's what the page says, yes, op interface โ not my words, don't shoot the messenger ๐)-gen-dialect-docโ generates dialect documentation ๐-dialectโ the dialect to generate. you gotta tell it which dialect, it's not a mind reader ๐ฎ-gen-directive-declโ generates declarations for directives (OpenMP, etc.) ๐งต-gen-enum-declsโ generates enum utility declarations ๐ค-gen-enum-defsโ generates enum utility definitions ๐ก-gen-enum-from-llvmir-conversionsโ generates conversions of EnumAttrs from LLVM IR โฌ ๏ธ-gen-enum-to-llvmir-conversionsโ generates conversions of EnumAttrs to LLVM IR โก๏ธ โ see what they did there, cute little pair ๐ฅบ-gen-llvmir-conversionsโ generates LLVM IR conversions ๐-gen-llvmir-intrinsicsโ generates LLVM IR intrinsics โก-llvmir-intrinsics-filterโ only keeps the intrinsics with the specified substring in their record name. filtering, we love a curated feed ๐-dialect-opclass-baseโ the base class for the ops in the dialect we are to emit ๐๏ธ-gen-op-declsโ generates operation declarations ๐ฃ-gen-op-defsโ generates operation definitions ๐งฑ-asmformat-error-is-fatalโ emits a fatal error if format parsing fails. dramatic? yes. correct? also yes ๐-op-exclude-regexโ regular expression of name of ops to exclude (no filter if empty) ๐ซ-op-include-regexโ regular expression of name of ops to include (no filter if empty) โ-gen-op-docโ generates operation documentation ๐-gen-pass-declsโ the page literally says "Generate operation documentation." for this one. it is what it is, i'm not fixing the manpage bestie ๐ญ-name namestringโ the name of this group of passes ๐ท๏ธ-gen-pass-docโ generates pass documentation ๐-gen-rewritersโ generates pattern rewriters ๐-gen-spirv-avail-implsโ generates SPIR-V operation utility definitions ๐-gen-spirv-capability-implicationโ generates a utility function to return implied capabilities for a given capability ๐ง-gen-spirv-enum-avail-declsโ generates SPIR-V enum availability declarations ๐-gen-spirv-enum-avail-defsโ generates SPIR-V enum availability definitions ๐-gen-spirv-op-utilsโ generates SPIR-V operation utility definitions ๐ ๏ธ-gen-spirv-serializationโ generates SPIR-V (de)serialization utilities and functions ๐ฆ-gen-struct-attr-declsโ generates struct utility declarations ๐งฉ-gen-struct-attr-defsโ generates struct utility definitions ๐งฎ-gen-typedef-declsโ generates TypeDef declarations ๐๏ธ-gen-typedef-defsโ generates TypeDef definitions ๐งฑ-typedefs-dialect nameโ generates types for this dialect ๐
๐ซถ EXIT STATUS ๐ซถ
if *-tblgen succeeds, it exits with 0. slay, clean exit, no notes ๐
otherwise, if an error occurs, it will exit with a non-zero value. so if the number isn't zero, something went sideways babe, go read the output ๐ญ
๐ AUTHOR ๐
maintained by the LLVM Team (https://llvm.org/). shoutout the maintainers fr fr ๐
๐ COPYRIGHT ๐
2003-2026, LLVM Project
and that's the whole page bestie ๐ TBLGEN(1), LLVM version 23, dated 2026-10-06 โ go forth and generate some tables, i believe in you ๐ โจ
๐ฆ where this page comes from
- centos-stream 9: llvm 23.1.3-1.el9 ยท Apache-2.0 WITH LLVM-exception OR NCSA
- centos-stream 9: llvm 23.1.3-1.el9 ยท Apache-2.0 WITH LLVM-exception OR NCSA
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms