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. Thedirectoryvalue should be a full or partial path to a directory that contains target description files. So itβs like βlook here for more.tdfiles.β π-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. Iffilenameis-, then*-tblgensends 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β Generatearm_neon.hfor Clang.-gen-arm-fp16β Generatearm_fp16.hfor Clang.-gen-arm-bf16β Generatearm_bf16.hfor 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β Generatearm_sve.hfor Clang.-gen-arm-sve-builtinsβ Generatearm_sve_builtins.incfor Clang.-gen-arm-sve-builtin-codegenβ Generatearm_sve_builtin_cg_map.incfor Clang.-gen-arm-sve-typeflagsβ Generatearm_sve_typeflags.incfor Clang.-gen-arm-sve-sema-rangechecksβ Generatearm_sve_sema_rangechecks.incfor Clang.-gen-arm-mve-headerβ Generatearm_mve.hfor 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β Generatearm_cde.hfor 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β Generateriscv_vector.hfor Clang.-gen-riscv-vector-builtinsβ Generateriscv_vector_builtins.incfor Clang.-gen-riscv-vector-builtin-codegenβ Generateriscv_vector_builtin_cg.incfor Clang.-gen-riscv-sifive-vector-builtinsβ Generateriscv_sifive_vector_builtins.incfor Clang.-gen-riscv-sifive-vector-builtin-codegenβ Generateriscv_sifive_vector_builtin_cg.incfor 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 attributefor testing purposes.
π lldb-tblgen Options π
gen-lldb-option-defsβ Generate lldbOptionDefinitionvalues.gen-lldb-property-defsβ Generate lldbPropertyDefinitionvalues.gen-lldb-property-enum-defsβ Generate lldbPropertyDefinitionenum values.
π₯ llvm-tblgen Options π₯
-gen-asm-matcherβ Generate assembly instruction matcher.-match-prefix=prefixβ Make-gen-asm-matchermatch only instructions with the given prefix.-gen-asm-parserβ Generate assembly instruction parser.-asmparsernum=nβ Make-gen-asm-parseremit assembly parser numbern.-gen-asm-writerβ Generate assembly writer.-asmwriternum=nβ Make-gen-asm-writeremit assembly writer numbern.-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-iselgenerate tables to help identify the patterns matched.-omit-commentsβ Make-gen-dag-iselomit comments. The default isfalse.-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β Generatellvm-exegesistables.-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-iselgenerate coverage instrumentation.-optimize-match-tableβ Make-gen-global-iselgenerate an optimized version of the match table.-warn-on-skipped-patternsβ Make-gen-global-iselexplain 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-combinerand-gen-global-isel-combiner-matchtableemit exactly the combiners you name in list.-gicombiner-show-expansionsβ makes-gen-global-isel-combinerdrop C++ comments in to flag where code expansion happens. Little breadcrumbs π-gicombiner-stop-after-buildβ makes-gen-global-isel-combinerclock out right after building the match tree.-gicombiner-stop-after-parseβ makes-gen-global-isel-combinerand-gen-global-isel-combiner-matchtablestop 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-enumsgenerate 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-infodump register information for debugging. Peek behind the curtain π¦-gen-searchable-tablesβ generates generic searchable tables. The page says: SeeTableGen 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-enumsprint 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 π«Ά
π Copyright π
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
- ubuntu stonking: llvm-17 1:17.0.6-23ubuntu10 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms