TBLGEN(1)

๐Ÿ“ฆ version 23.1.3, in centos-stream 9

๐Ÿ’… 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 *-tblgen sends 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 Clang BasicReader classes.
  • -gen-clang-basic-writer โ€” makes Clang BasicWriter classes.
  • -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 Clang AbstractTypeReader class.
  • -gen-clang-type-writer โ€” makes the Clang AbstractTypeWriter class.
  • -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 โ€” writes arm_neon.h for Clang.
  • -gen-arm-fp16 โ€” writes arm_fp16.h for Clang.
  • -gen-arm-bf16 โ€” writes arm_bf16.h for 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 โ€” writes arm_immcheck_types.inc for Clang.
  • -gen-arm-sve-header โ€” writes arm_sve.h for Clang.
  • -gen-arm-sve-builtins โ€” writes arm_sve_builtins.inc for Clang.
  • -gen-arm-sve-builtin-codegen โ€” writes arm_sve_builtin_cg_map.inc for Clang.
  • -gen-arm-sve-typeflags โ€” writes arm_sve_typeflags.inc for Clang.
  • -gen-arm-sve-sema-rangechecks โ€” writes arm_sve_sema_rangechecks.inc for Clang.
  • -gen-arm-mve-header โ€” writes arm_mve.h for 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 โ€” writes arm_cde.h for 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 โ€” writes riscv_vector.h for Clang.
  • -gen-riscv-vector-builtins โ€” writes riscv_vector_builtins.inc for Clang.
  • -gen-riscv-vector-builtin-codegen โ€” writes riscv_vector_builtin_cg.inc for Clang.
  • -gen-riscv-sifive-vector-builtins โ€” writes riscv_sifive_vector_builtins.inc for Clang.
  • -gen-riscv-sifive-vector-builtin-codegen โ€” writes riscv_sifive_vector_builtin_cg.inc for 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 attribute for 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 lldb OptionDefinition values.
  • gen-lldb-property-defs โ€” makes lldb PropertyDefinition values.
  • gen-lldb-property-enum-defs โ€” makes lldb PropertyDefinition enum values.

๐Ÿ”ฅ llvm-tblgen Options ๐Ÿ”ฅ

  • -gen-asm-matcher โ€” makes the assembly instruction matcher.
  • -match-prefix=prefix โ€” makes -gen-asm-matcher match only instructions with the given prefix.
  • -gen-asm-parser โ€” makes the assembly instruction parser.
  • -asmparsernum=n โ€” makes -gen-asm-parser emit assembly parser number n.
  • -gen-asm-writer โ€” makes the assembly writer.
  • -asmwriternum=n โ€” makes -gen-asm-writer emit 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-isel generate tables to help identify the patterns matched.
  • -omit-comments โ€” makes -gen-dag-isel omit comments; the default is false.
  • -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 โ€” makes llvm-exegesis tables.
  • -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-isel generate coverage instrumentation.
  • -optimize-match-table โ€” makes -gen-global-isel generate an optimized version of the match table.
  • -warn-on-skipped-patterns โ€” makes -gen-global-isel explain 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-combiner which 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-combiner spits out. living for the documentation crumbs ngl ๐Ÿ’…
  • -gicombiner-stop-after-parse โ€” makes -gen-global-isel-combiner stop 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-enums generate 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-info dump 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-enums print 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 ๐Ÿ’œ


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