TBLGEN(1)

TBLGEN(1) πŸ’…βœ¨

okay bestie, buckle UP, because this is the LLVM manual page for tblgen β€” and yes, there are several of them, it's a whole family, it's giving squad goals 🫢


🌸 NAME 🌸

tblgen β€” Description to C++ Code

literally the entire job. description in, C++ out. no cap. πŸ’–


✨ SYNOPSIS ✨

clang-tblgen [options] [filename]

lldb-tblgen [options] [filename]

llvm-tblgen [options] [filename]

mlir-tblgen [options] [filename]

four icons, four entrances, same energy. pick your fighter. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

so *-tblgen is actually a family of programs β€” like, a whole friend group β€” and what they do is translate target description files, aka .td files, into C++ code and other output formats. that's the vibe. 🧚

ngl though, most people using LLVM are never gonna need this program. it's used only for writing parts of the compiler, the debugger, and LLVM target backends. it's a behind-the-scenes main character, not a front-row one. 😭

the details of what goes in and what comes out of the *-tblgen programs are, and I quote, beyond the scope of this short introduction. so if you want the real tea, go read the TableGen Overview for an introduction, and it'll point you at even more TableGen docs from there. iykyk πŸ“š

and the filename argument? that's just the name of the Target Description (.td) file that TableGen processes. simple as. πŸ’…


πŸ‘‘ OPTIONS πŸ‘‘

πŸ’œ General Options πŸ’œ

  • -help β€” prints a description of the command line options. your classic "help me pls" button.
  • -help-list β€” prints a description of the command line options, but in a simple list format. same info, tidier fit. ✨
  • -D=macroname β€” specify the name of a macro to be defined. the name gets defined, but it has no particular value. it's just... there. existing. vibing. 🫢
  • -d=filename β€” specify the name of the dependency filename.
  • -debug β€” enable debug output. turn on the subtitles, bestie. πŸ›
  • -dump-json β€” print a JSON representation of all records, suitable for further automated processing. for when the robots need to read it too. πŸ€–
  • -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. πŸ“
  • -null-backend β€” parse the source files and build the records, but do not run any backend. useful for timing the frontend. it's the "just do the warmup and then go home" option πŸ’€
  • -o filename β€” specify the output file name. and if filename is -, then *-tblgen sends its output to standard output. dash means "to the screen, babes." πŸ–₯️
  • -print-records β€” print all classes and records to standard output. this is the default backend option. ⭐
  • -print-detailed-records β€” print a detailed report of all global variables, classes, and records to standard output. the deluxe version. πŸ”₯
  • -stats β€” print a report with any statistics collected by the backend. numbers!! we love numbers πŸ“Š
  • -time-phases β€” time the parser and backend phases and print a report. stopwatch behavior. ⏱️
  • -version β€” show the version number of the program. who are you, really. πŸͺž
  • -write-if-changed β€” write the output file only if it is new or has changed. so polite. so considerate. no unnecessary writes. πŸŽ€

🌈 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 mark is right there in the source. we don't fix it. we respect it. πŸ™ˆ)
  • -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. filtered feed. 🎧
  • -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-immcheck-types β€” generate arm_immcheck_types.inc 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 πŸŽ€

okay so heads up, these three are written without a leading dash in the source. not my business, not my problem, i'm just the messenger 🫢

  • 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. filter it, bestie.
  • -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. say it with me: directed acyclic graph. ✨
  • -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. so by default, comments stay. periodt.
  • -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. quotes are theirs, speed is theirs too 🏎️
  • -gen-global-isel β€” generate GlobalISel selector.
  • -gisel-coverage-file=filename β€” specify the filename 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. it's not ignoring you, it's telling you. πŸ’–
  • -gen-global-isel-combiner β€” makes the GlobalISel combiner, bestie ✨
  • -combiners=list β€” tells -gen-global-isel-combiner to emit exactly the combiners you named in list. you pick, it ships πŸ’…
  • -gicombiner-debug-cxxpreds β€” sprinkles debug comments onto every single C++ predicate that -gen-global-isel-combiner emits πŸŽ€
  • -gicombiner-stop-after-parse β€” makes -gen-global-isel-combiner clock out right after parsing the rules, then dumps the state. like, that's it, we're done here πŸ’€
  • -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 spit out intrinsics carrying 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 so you can debug it πŸ”₯
  • -gen-searchable-tables β€” generates generic searchable tables. for the full tea, go see TableGen BackEnds πŸ’…
  • -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 it's emitting big string tables, it'll prefer string literals over comma-separated char literals. this can be a readability and compile-time performance win, but it upsets some compilers 😭 (sorry to those compilers fr fr)
  • -print-enums β€” prints enumeration values for a class 🌸
  • -class=classname β€” makes -print-enums print the enumeration list for the classname you gave it πŸ’œ
  • -print-sets β€” prints expanded sets, for testing DAG exprs 🧚

✨ mlir-tblgen Options ✨

okay bestie, this is the mlir-tblgen side of the menu, and it is stacked 🫢

  • -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 whose record name contains the substring you specify 🧚
  • -dialect-opclass-base β€” the base class for the ops in the dialect we're about 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 πŸ’€ (yeah, fatal fatal)
  • -op-exclude-regex β€” regular expression of the name of ops to exclude (no filter if it's empty) πŸŽ€
  • -op-include-regex β€” regular expression of the name of ops to include (no filter if it's empty) πŸŽ€
  • -gen-op-doc β€” generates operation documentation 🌸
  • -gen-pass-decls β€” generates operation documentation πŸ¦‹
  • -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 dips out with 0 ✨

otherwise, if an error happens, it exits with a non-zero value 😭 periodt.


πŸ‘‘ AUTHOR πŸ‘‘

maintained by the LLVM Team (<https://llvm.org/>) β€” the way they keep this whole thing running, iconic fr fr 🫢

2003-2025, LLVM Project πŸ’œ


and that's the whole page, bestie!! this was TBLGEN(1), version 20, dated 2025-09-03 β€” go forth and generate some tables, you absolute main character πŸŒŸπŸ’…πŸ¦‹

πŸ“¦ where this page comes from