TBLGEN(1)

πŸ’… NAME πŸ’…

okay so this is tblgen, bestie β€” the LLVM TBLGEN(1) page β€” and its whole thing is description to C++ code. That's the name: tblgen, description-to-C++-code. We're in part 1, so hydrate and let's go πŸŽ€

✨ SYNOPSIS ✨

bestie, the *-tblgen family rolls like this β€” same shape, different little gremlin:

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. It's giving compiler-adjacent magic ✨. Most users of LLVM will not need to use this program. It is used only for writing parts of the compiler, debugger, and LLVM target backends. So if you're just out here using the compiler, you can lowkey ignore this one.

The details of 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. That's the homework, bestie πŸ“š.

The filename argument specifies the name of the Target Description (.td) file that TableGen processes. So yeah, that's the file it's gonna chew on.

πŸŽ€ OPTIONS πŸŽ€

okay, now the flags. There are a lot of them. Hydrate first πŸ’§.

🌟 General Options 🌟

  • -help β€” prints a description of the command line options. like a little map for your flags πŸ—ΊοΈ
  • -help-list β€” prints a description of the command line options in a simple list format. a tidy little list, slay πŸ’…
  • -D=macroname β€” specifies the name of a macro to be defined. the name is defined, but it has no particular value β€” it's just vibes, no value attached 🫢
  • -d=filename β€” specifies the name of the dependency filename.
  • -debug β€” enables debug output. turn on the little detective hat πŸ”
  • -dump-json β€” prints a JSON representation of all records, suitable for further automated processing. json girlies rise 🌈
  • -I directory β€” specifies 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.
  • -null-backend β€” parses the source files and builds the records, but does not run any backend. this is useful for timing the frontend. no backend, just frontend cardio πŸ’€
  • -o filename β€” specifies 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. the deluxe version πŸ“‹
  • -stats β€” prints a report with any statistics collected by the backend. numbers moment πŸ“Š
  • -time-phases β€” times the parser and backend phases and prints a report. clock it ⏱️
  • -version β€” shows the version number of the program.
  • -write-if-changed β€” writes the output file only if it is new or has changed. no unnecessary overwrites, we respect the file's journey ✨

πŸ’– clang-tblgen Options πŸ’–

these are the clang-specific little generators. there are so many. stay with me 🫢

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

πŸ¦‹ lldb-tblgen Options πŸ¦‹

these ones are missing their leading dash, bestie β€” that's just how they're listed here, so we keep it exactly:

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

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

and now the llvm-tblgen buffet. we're still going πŸ’…

  • -gen-asm-matcher β€” generates assembly instruction matcher.
  • -match-prefix=prefix β€” makes -gen-asm-matcher match only instructions with the given prefix.
  • -gen-asm-parser β€” generates assembly instruction parser.
  • -asmparsernum=n β€” makes -gen-asm-parser emit assembly parser number n.
  • -gen-asm-writer β€” generates assembly writer.
  • -asmwriternum=n β€” makes -gen-asm-writer emit assembly writer number n.
  • -gen-attrs β€” generates attributes.
  • -gen-automata β€” generates generic automata.
  • -gen-callingconv β€” generates calling convention descriptions.
  • -gen-compress-inst-emitter β€” generates RISC-V compressed instructions.
  • -gen-ctags β€” generates ctags-compatible index.
  • -gen-dag-isel β€” generates 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 β€” generates DFA Packetizer for VLIW targets.
  • -gen-directive-decl β€” generates directive related declaration code (header file).
  • -gen-directive-gen β€” generates directive related implementation code part.
  • -gen-directive-impl β€” generates directive related implementation code.
  • -gen-disassembler β€” generates disassembler.
  • -gen-emitter β€” generates machine code emitter.
  • -gen-exegesis β€” generates llvm-exegesis tables.
  • -gen-fast-isel β€” generates a "fast" instruction selector.
  • -gen-global-isel β€” generates GlobalISel selector.
  • -gisel-coverage-file=filename β€” specifies 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 β€” ok so this one generates the GlobalISel combiner. That's the whole vibe πŸ’…
  • -combiners=list β€” makes -gen-global-isel-combiner emit exactly the combiners you name in that list. your picks, your rules ✨
  • -gicombiner-debug-cxxpreds β€” drops debug comments into, like, every single C++ predicate that -gen-global-isel-combiner emits. little breadcrumbs everywhere πŸŽ€
  • -gicombiner-stop-after-parse β€” tells -gen-global-isel-combiner to stop right after it parses the rules and just dump the state. like, "we're not going further, bestie, look at this mess first" 😭
  • -gen-instr-info β€” generates instruction descriptions. iconic behavior.
  • -gen-instr-docs β€” generates instruction documentation. yes, docs about instrs. slay.
  • -gen-intrinsic-enums β€” generates intrinsic enums 🧚
  • -intrinsic-prefix=prefix β€” makes -gen-intrinsic-enums generate intrinsics with this target prefix, exactly the one you hand it.
  • -gen-intrinsic-impl β€” generates intrinsic information. short and sweet.
  • -gen-opt-parser-defs β€” generates options definitions.
  • -gen-opt-rst β€” generates option RST. fancy formatting era 🌸
  • -gen-pseudo-lowering β€” generates pseudo instruction lowering. fake instrs getting real jobs πŸ’€
  • -gen-register-bank β€” generates register bank descriptions.
  • -gen-register-info β€” generates registers and register classes info. the whole register gossip network fr fr πŸ‘‘
  • -register-info-debug β€” makes -gen-register-info dump register information for debugging. peek behind the curtain energy πŸ”₯
  • -gen-searchable-tables β€” generates generic searchable tables. the page says to see TableGen BackEnds <> for a detailed description, so go look, iykyk πŸ¦‹
  • -gen-subtarget β€” generates subtarget enumerations.
  • -gen-x86-EVEX2VEX-tables β€” generates X86 EVEX to VEX compress tables. very specific, very x86 of them ✨
  • -gen-x86-fold-tables β€” generates X86 fold tables. same family, different table 🫢
  • -long-string-literals β€” when it's emitting large string tables, this prefers string literals over comma-separated char literals. the page is honest about the tradeoff: it can be a readability and compile-time performance win, but it upsets some compilers 😭 so like, cute idea, but not universally loved.
  • -print-enums β€” prints enumeration values for a class. show me the enum lore πŸ“œ
  • -class=classname β€” makes -print-enums print the enumeration list for the class you specify. name the class, get the list πŸ’œ
  • -print-sets β€” prints expanded sets for testing DAG exprs. test girlie behavior πŸŽ€

🌈 mlir-tblgen Options 🌈

okay bestie, new section, new tool, same energy. these are the mlir-tblgen flags:

  • -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. that's the whole description, no cap.
  • -gen-directive-decl β€” generates declarations for directives (OpenMP, etc.). the "etc." is doing so much work there πŸ™ˆ
  • -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. yes, the other direction. both paths covered πŸ¦‹
  • -gen-llvmir-conversions β€” generates LLVM IR conversions.
  • -gen-llvmir-intrinsics β€” generates LLVM IR intrinsics.
  • -llvmir-intrinsics-filter β€” only keeps the intrinsics whose record name contains the substring you specify. no substring, no entry πŸ’…
  • -dialect-opclass-base β€” the base class for the ops in the dialect we're about to emit. set the foundation, bestie πŸ—οΈ
  • -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 the names of ops to exclude (no filter if empty). empty means nobody gets excluded ✨
  • -op-include-regex β€” regular expression of the names of ops to include (no filter if empty). empty means everybody's invited πŸŽ€
  • -gen-op-doc β€” generates operation documentation.
  • -gen-pass-decls β€” the page literally says "Generate operation documentation." for this one. i'm not fixing it, i'm just reporting it fr fr 😭
  • -name namestring β€” the name of this group of passes. give your pass group a name, it deserves one πŸ‘‘
  • -gen-pass-doc β€” generates pass documentation.
  • -gen-rewriters β€” generates pattern rewriters. glow-ups for patterns ✨
  • -gen-spirv-avail-impls β€” generates SPIR-V operation utility definitions.
  • -gen-spirv-capability-implication β€” generates a utility function that returns the implied capabilities for a given capability. so if you have this, you secretly also have that 🧚
  • -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. both directions, we contain multitudes 🌸
  • -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. name that dialect 🫢

πŸ’– EXIT STATUS πŸ’–

if *-tblgen succeeds, it exits with 0. and if an error occurs? it exits with a non-zero value. that's it, that's the whole story. no in-between, no "it depends" β€” zero or not-zero, main character or villain πŸ’…

πŸ‘‘ Author πŸ‘‘

maintained by the LLVM Team (https://llvm.org/). they're keeping the lights on, respect ✨

2003-2026, LLVM Project


and that's a wrap on TBLGEN(1), bestie!! πŸ¦‹ this is version 23, dated 2026-10-20, and you read the whole thing β€” genuinely iconic of you πŸ’œ go generate some tables, you absolute legend 🌈⭐

πŸ“¦ where this page comes from
  • arch rolling: llvm 23.1.4-1 Β· Apache-2.0 WITH LLVM-exception
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms