TBLGEN(1)

🌈 TBLGEN(1) β€” the LLVM manual, bestie edition 🌈

Okay so this is TBLGEN(1), the LLVM manual page for the whole tablegen family. Grab a strawberry drink πŸ“ and let’s get into it, because this is lowkey iconic compiler-nerd territory.


πŸ’– NAME πŸ’–

tblgen β€” literally β€œDescription to C++ Code.” That’s the assignment, no cap. πŸ’…

✨ SYNOPSIS ✨

clang-tblgen [options] [filename]

lldb-tblgen [options] [filename]

llvm-tblgen [options] [filename]

mlir-tblgen [options] [filename]

🧚 DESCRIPTION 🧚

*-tblgen is a whole family of programs that translates target description (.td) files into C++ code and other output formats. Slay, honestly. Most users of LLVM will not need to use this program β€” it’s used only for writing parts of the compiler, debugger, and LLVM target backends. So if you’re just vibing with LLVM normally, this is probably not your main-character tool. 🫢

The full tea on the input and output of the *-tblgen programs is beyond the scope of this short introduction; please see the TableGen Overview <> for an introduction and for references to additional TableGen documents. Yes bestie, there are more docs. πŸ’–

The filename argument specifies the name of the Target Description (.td) file that TableGen processes. That’s the file it’s gonna chew on. πŸ“

πŸ’… OPTIONS πŸ’…

🌸 General Options 🌸

  • -help β€” Print a description of the command line options. Helpful queen behavior. πŸ‘‘
  • -help-list β€” Print a description of the command line options in a simple list format. Same info, listified. ✨
  • -D=macroname β€” Specify the name of a macro to be defined. The name is defined, but it has no particular value. It’s giving β€œname only, no notes.” πŸ’€
  • -d=filename β€” Specify the name of the dependency filename.
  • -debug β€” Enable debug output. Turn on the little debug goblin mode. πŸ™ˆ
  • -dump-json β€” Print a JSON representation of all records, suitable for further automated processing. JSON girlies rise. 🌸
  • -I directory β€” Specify where to find other target description files for inclusion. The directory value should be a full or partial path to a directory that contains target description files. So it’s like β€œlook here for more .td files.” πŸŽ€
  • -null-backend β€” Parse the source files and build the records, but do not run any backend. This is useful for timing the frontend. Frontend timing era. ⏱️
  • -o filename β€” Specify the output file name. If filename is -, then *-tblgen sends its output to standard output. Classic dash-to-stdout slay. πŸ’…
  • -print-records β€” Print all classes and records to standard output (default backend option). The default backend option, periodt. 🫢
  • -print-detailed-records β€” Print a detailed report of all global variables, classes, and records to standard output. Detailed records, detailed vibes. πŸ”₯
  • -stats β€” Print a report with any statistics collected by the backend. Stats bestie.
  • -time-phases β€” Time the parser and backend phases and print a report. Timing the phases like a little performance review. ⭐
  • -version β€” Show the version number of the program. Version check, obviously. πŸ’–
  • -write-if-changed β€” Write the output file only if it is new or has changed. No unnecessary rewrites, we love a low-waste queen. 🌈

🌷 clang-tblgen Options 🌷

  • -gen-clang-attr-classes β€” Generate Clang attribute classes.
  • -gen-clang-attr-parser-string-switches β€” Generate all parser-related attribute string switches.
  • -gen-clang-attr-subject-match-rules-parser-string-switches β€” Generate all parser-related attribute subject match rule string switches.
  • -gen-clang-attr-impl β€” Generate Clang attribute implementations.
  • -gen-clang-attr-list" β€” Generate a Clang attribute list. (Yes, the quote is literally there in the original β€” we keep it exact, bestie. 🫢)
  • -gen-clang-attr-subject-match-rule-list β€” Generate a Clang attribute subject match rule list.
  • -gen-clang-attr-pch-read β€” Generate Clang PCH attribute reader.
  • -gen-clang-attr-pch-write β€” Generate Clang PCH attribute writer.
  • -gen-clang-attr-has-attribute-impl β€” Generate a Clang attribute spelling list.
  • -gen-clang-attr-spelling-index β€” Generate a Clang attribute spelling index.
  • -gen-clang-attr-ast-visitor β€” Generate a recursive AST visitor for Clang attributes.
  • -gen-clang-attr-template-instantiate β€” Generate a Clang template instantiate code.
  • -gen-clang-attr-parsed-attr-list β€” Generate a Clang parsed attribute list.
  • -gen-clang-attr-parsed-attr-impl β€” Generate the Clang parsed attribute helpers.
  • -gen-clang-attr-parsed-attr-kinds β€” Generate a Clang parsed attribute kinds.
  • -gen-clang-attr-text-node-dump β€” Generate Clang attribute text node dumper.
  • -gen-clang-attr-node-traverse β€” Generate Clang attribute traverser.
  • -gen-clang-diags-defs β€” Generate Clang diagnostics definitions.
  • -clang-component component β€” Only use warnings from specified component.
  • -gen-clang-diag-groups β€” Generate Clang diagnostic groups.
  • -gen-clang-diags-index-name β€” Generate Clang diagnostic name index.
  • -gen-clang-basic-reader β€” Generate Clang BasicReader classes.
  • -gen-clang-basic-writer β€” Generate Clang BasicWriter classes.
  • -gen-clang-comment-nodes β€” Generate Clang AST comment nodes.
  • -gen-clang-decl-nodes β€” Generate Clang AST declaration nodes.
  • -gen-clang-stmt-nodes β€” Generate Clang AST statement nodes.
  • -gen-clang-type-nodes β€” Generate Clang AST type nodes.
  • -gen-clang-type-reader β€” Generate Clang AbstractTypeReader class.
  • -gen-clang-type-writer β€” Generate Clang AbstractTypeWriter class.
  • -gen-clang-opcodes β€” Generate Clang constexpr interpreter opcodes.
  • -gen-clang-sa-checkers β€” Generate Clang static analyzer checkers.
  • -gen-clang-comment-html-tags β€” Generate efficient matchers for HTML tag names that are used in documentation comments.
  • -gen-clang-comment-html-tags-properties β€” Generate efficient matchers for HTML tag properties.
  • -gen-clang-comment-html-named-character-references β€” Generate function to translate named character references to UTF-8 sequences.
  • -gen-clang-comment-command-info β€” Generate command properties for commands that are used in documentation comments.
  • -gen-clang-comment-command-list β€” Generate list of commands that are used in documentation comments.
  • -gen-clang-opencl-builtins β€” Generate OpenCL builtin declaration handlers.
  • -gen-arm-neon β€” Generate arm_neon.h for Clang.
  • -gen-arm-fp16 β€” Generate arm_fp16.h for Clang.
  • -gen-arm-bf16 β€” Generate arm_bf16.h for Clang.
  • -gen-arm-neon-sema β€” Generate ARM NEON sema support for Clang.
  • -gen-arm-neon-test β€” Generate ARM NEON tests for Clang.
  • -gen-arm-sve-header β€” Generate arm_sve.h for Clang.
  • -gen-arm-sve-builtins β€” Generate arm_sve_builtins.inc for Clang.
  • -gen-arm-sve-builtin-codegen β€” Generate arm_sve_builtin_cg_map.inc for Clang.
  • -gen-arm-sve-typeflags β€” Generate arm_sve_typeflags.inc for Clang.
  • -gen-arm-sve-sema-rangechecks β€” Generate arm_sve_sema_rangechecks.inc for Clang.
  • -gen-arm-mve-header β€” Generate arm_mve.h for Clang.
  • -gen-arm-mve-builtin-def β€” Generate ARM MVE builtin definitions for Clang.
  • -gen-arm-mve-builtin-sema β€” Generate ARM MVE builtin sema checks for Clang.
  • -gen-arm-mve-builtin-codegen β€” Generate ARM MVE builtin code-generator for Clang.
  • -gen-arm-mve-builtin-aliases β€” Generate list of valid ARM MVE builtin aliases for Clang.
  • -gen-arm-cde-header β€” Generate arm_cde.h for Clang.
  • -gen-arm-cde-builtin-def β€” Generate ARM CDE builtin definitions for Clang.
  • -gen-arm-cde-builtin-sema β€” Generate ARM CDE builtin sema checks for Clang.
  • -gen-arm-cde-builtin-codegen β€” Generate ARM CDE builtin code-generator for Clang.
  • -gen-arm-cde-builtin-aliases β€” Generate list of valid ARM CDE builtin aliases for Clang.
  • -gen-riscv-vector-header β€” Generate riscv_vector.h for Clang.
  • -gen-riscv-vector-builtins β€” Generate riscv_vector_builtins.inc for Clang.
  • -gen-riscv-vector-builtin-codegen β€” Generate riscv_vector_builtin_cg.inc for Clang.
  • -gen-riscv-sifive-vector-builtins β€” Generate riscv_sifive_vector_builtins.inc for Clang.
  • -gen-riscv-sifive-vector-builtin-codegen β€” Generate riscv_sifive_vector_builtin_cg.inc for Clang.
  • -gen-attr-docs β€” Generate attribute documentation.
  • -gen-diag-docs β€” Generate diagnostic documentation.
  • -gen-opt-docs β€” Generate option documentation.
  • -gen-clang-data-collectors β€” Generate data collectors for AST nodes.
  • -gen-clang-test-pragma-attribute-supported-attributes β€” Generate a list of attributes supported by #pragma Clang attribute for testing purposes.

🐚 lldb-tblgen Options 🐚

  • gen-lldb-option-defs β€” Generate lldb OptionDefinition values.
  • gen-lldb-property-defs β€” Generate lldb PropertyDefinition values.
  • gen-lldb-property-enum-defs β€” Generate lldb PropertyDefinition enum values.

πŸ”₯ llvm-tblgen Options πŸ”₯

  • -gen-asm-matcher β€” Generate assembly instruction matcher.
  • -match-prefix=prefix β€” Make -gen-asm-matcher match only instructions with the given prefix.
  • -gen-asm-parser β€” Generate assembly instruction parser.
  • -asmparsernum=n β€” Make -gen-asm-parser emit assembly parser number n.
  • -gen-asm-writer β€” Generate assembly writer.
  • -asmwriternum=n β€” Make -gen-asm-writer emit assembly writer number n.
  • -gen-attrs β€” Generate attributes.
  • -gen-automata β€” Generate generic automata.
  • -gen-callingconv β€” Generate calling convention descriptions.
  • -gen-compress-inst-emitter β€” Generate RISC-V compressed instructions.
  • -gen-ctags β€” Generate ctags-compatible index.
  • -gen-dag-isel β€” Generate a DAG (directed acyclic graph) instruction selector.
  • -instrument-coverage β€” Make -gen-dag-isel generate tables to help identify the patterns matched.
  • -omit-comments β€” Make -gen-dag-isel omit comments. The default is false.
  • -gen-dfa-packetizer β€” Generate DFA Packetizer for VLIW targets.
  • -gen-directive-decl β€” Generate directive related declaration code (header file).
  • -gen-directive-gen β€” Generate directive related implementation code part.
  • -gen-directive-impl β€” Generate directive related implementation code.
  • -gen-disassembler β€” Generate disassembler.
  • -gen-emitter β€” Generate machine code emitter.
  • -gen-exegesis β€” Generate llvm-exegesis tables.
  • -gen-fast-isel β€” Generate a β€œfast” instruction selector.
  • -gen-global-isel β€” Generate GlobalISel selector.
  • -gisel-coverage-file=filename β€” Specify the file from which to retrieve coverage information.
  • -instrument-gisel-coverage β€” Make -gen-global-isel generate coverage instrumentation.
  • -optimize-match-table β€” Make -gen-global-isel generate an optimized version of the match table.
  • -warn-on-skipped-patterns β€” Make -gen-global-isel explain why a pattern was skipped for inclusion.
  • -gen-global-isel-combiner β€” generates the legacy GlobalISel combiner. Heads up bestie: this one is deprecated, pending removal πŸ’€ so maybe don't build your whole personality around it.
  • -gen-global-isel-combiner-matchtable β€” generates the MatchTable-based GlobalISel combiner. The new hotness ✨
  • -combiners=list β€” makes -gen-global-isel-combiner and -gen-global-isel-combiner-matchtable emit exactly the combiners you name in list.
  • -gicombiner-show-expansions β€” makes -gen-global-isel-combiner drop C++ comments in to flag where code expansion happens. Little breadcrumbs πŸ“
  • -gicombiner-stop-after-build β€” makes -gen-global-isel-combiner clock out right after building the match tree.
  • -gicombiner-stop-after-parse β€” makes -gen-global-isel-combiner and -gen-global-isel-combiner-matchtable stop right after parsing rules, then dump the state. Early exit, main character energy πŸ’…
  • -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 with 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. Peek behind the curtain πŸ¦‹
  • -gen-searchable-tables β€” generates generic searchable tables. The page says: See TableGen BackEnds <> for a detailed description.
  • -gen-subtarget β€” generates subtarget enumerations.
  • -gen-x86-EVEX2VEX-tables β€” generates X86 EVEX to VEX compress tables.
  • -gen-x86-fold-tables β€” generates X86 fold tables.
  • -long-string-literals β€” when emitting large string tables, prefers string literals over comma-separated char literals. Genuinely can be a readability and compile-time performance win, but it upsets some compilers 😭 (their loss, honestly).
  • -print-enums β€” prints enumeration values for a class.
  • -class=classname β€” makes -print-enums print the enumeration list for the class you name in classname.
  • -print-sets β€” prints expanded sets, for testing DAG exprs.

🧚 mlir-tblgen Options 🧚

Okay so this whole next crew is the mlir-tblgen fam 🫢

  • -gen-avail-interface-decls β€” generates availability interface declarations.
  • -gen-avail-interface-defs β€” generates op interface definitions.
  • -gen-dialect-doc β€” generates dialect documentation.
  • -dialect β€” the dialect to generate.
  • -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.
  • -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. Filtered, curated, iconic πŸ‘‘
  • -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. No soft launches here, it's fatal fr fr πŸ’€
  • -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 describes this one as "Generate operation documentation." Yep. That's what it says 🀨 keeping it exactly as documented.
  • -name namestring β€” the name of this group of passes, given as namestring.
  • -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, named name.

✨ EXIT STATUS ✨

If *-tblgen succeeds, it will exit with 0 β€” slay πŸ’– Otherwise, if an error occurs, it will exit with a non-zero value. That's the whole vibe check.


🌸 Author 🌸

Maintained by the LLVM Team (https://llvm.org/). Shoutout to the maintainers, they're carrying 🫢

2003-2026, LLVM Project


And that's the whole page, bestie! This was TBLGEN(1), version 15, dated 2026-09-09 β€” go forth and generate all the things πŸŒˆβ­πŸ’œ

πŸ“¦ where this page comes from