TBLGEN(1)
π
tblgen β the tblgen family, aka Description to C++ Code β¨
okay so real talk, this is TBLGEN(1) from the LLVM manual, and it's a whole family of little generator programs. Buckle up bestie π
β¨ SYNOPSIS β¨
clang-tblgen [options] [filename]
lldb-tblgen [options] [filename]
llvm-tblgen [options] [filename]
mlir-tblgen [options] [filename]
π¦ DESCRIPTION π¦
So *-tblgen isn't one program, it's a whole squad of programs that translate target description (.td) files into C++ code and other output formats. Translates them. Like a little compiler-adjacent bestie π«Ά
Most users of LLVM will not need to use this program, fr fr β like, if you're just out here using LLVM you can close this tab. It's used only for writing parts of the compiler, the debugger, and LLVM target backends. So it's giving "for the devs building the thing", not "for everyone using the thing" π
The details of the input and output of the *-tblgen programs is beyond the scope of this short introduction β so please see the TableGen Overview for an introduction and for references to additional TableGen documents. (iykyk, go read those π)
The filename argument specifies the name of the Target Description (.td) file that TableGen processes. That's the one. That's the file. π
πΈ OPTIONS πΈ
π General Options
-helpβ Print a description of the command line options.-help-listβ Print a description of the command line options in a simple list format. (the no-frills version, lowkey love that for us)- *
-D=macroname* β Specify the name of a macro to be defined. The name is defined, but it has no particular value. it's just... a name. existing. main character energy of existing β¨ - *
-d=filename* β Specify the name of the dependency filename. -debugβ Enable debug output.-dump-jsonβ Print a JSON representation of all records, suitable for further automated processing.-Idirectory β 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. This is useful for timing the frontend. (frontend-only speedrun, slay β±οΈ)-ofilename β Specify the output file name. If filename is-, then*-tblgensends its output to standard output. lil dash means stdout, iconic π«Ά-print-recordsβ Print all classes and records to standard output (default backend option).-print-detailed-recordsβ Print a detailed report of all global variables, classes, and records to standard output. the detailed one. she's thorough π-statsβ Print a report with any statistics collected by the backend.-time-phasesβ Time the parser and backend phases and print a report.-versionβ Show the version number of the program.-write-if-changedβ Write the output file only if it is new or has changed. no pointless rewrites, we respect the build system's time π§
π clang-tblgen Options
okay this section is LONG and it's all -gen- this and -gen- that. every single one is here, don't worry. π«Ά
-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. (yes that's a whole mouthful, say it with your chest π)-gen-clang-attr-implβ Generate Clang attribute implementations.-gen-clang-attr-list"β Generate a Clang attribute list. (and yes, that trailing quote mark is literally printed in the manual like that, no cap β I'm not touching 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-componentcomponent β Only use warnings from specified component. (only warnings from that component, keep it focused β¨)-gen-clang-diag-groupsβ Generate Clang diagnostic groups.-gen-clang-diags-index-nameβ Generate Clang diagnostic name index.-gen-clang-basic-readerβ Generate ClangBasicReaderclasses.-gen-clang-basic-writerβ Generate ClangBasicWriterclasses.-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 ClangAbstractTypeReaderclass.-gen-clang-type-writerβ Generate ClangAbstractTypeWriterclass.-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
bestie notice something? these three don't have a leading dash in the manual. not a typo on my end, that's literally how they're printed π
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. (only those instructions, gatekept by prefix π )-gen-asm-parserβ Generate assembly instruction parser.-asmparsernum=n β Make-gen-asm-parseremit assembly parser number n.-gen-asm-writerβ Generate assembly writer.-asmwriternum=n β Make-gen-asm-writeremit 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-iselgenerate tables to help identify the patterns matched.-omit-commentsβ Make-gen-dag-iselomit comments. The default isfalse. (so like, comments are ON by default. good to know π«Ά)-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. (quotes around "fast" are the manual's, not mine π)-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. (she tells you why, we love transparency β¨)-gen-global-isel-combinerβ Generate GlobalISel combiner.-combiners=listβ tells-gen-global-isel-combinerto emit the specific combiners you list here π you pick the list, it does the emitting.-gicombiner-debug-cxxpredsβ sprinkles debug comments onto every C++ predicate that-gen-global-isel-combineremits π little breadcrumbs so you can actually follow what's happening.-gicombiner-stop-after-parseβ makes-gen-global-isel-combinerstop right after parsing the rules and dump its state. like, "we're done here bestie, look at what I got" π«Ά-gen-instr-infoβ generate instruction descriptions β¨-gen-instr-docsβ generate instruction documentation π-gen-intrinsic-enumsβ generate intrinsic enums π₯-intrinsic-prefix=prefixβ makes-gen-intrinsic-enumsspit out intrinsics carrying this targetprefixin front of them.-gen-intrinsic-implβ generate intrinsic information π-gen-opt-parser-defsβ generate options definitions πΈ-gen-opt-rstβ generate option RST π-gen-pseudo-loweringβ generate pseudo instruction lowering π-gen-register-bankβ generate register bank descriptions π¦β¨-gen-register-infoβ generate registers and register classes info π-register-info-debugβ makes-gen-register-infodump register information for debugging π peek behind the curtain.-gen-searchable-tablesβ generate generic searchable tables. see TableGen BackEnds <> for a detailed description π¦-gen-subtargetβ generate subtarget enumerations β-gen-x86-EVEX2VEX-tablesβ generate X86 EVEX to VEX compress tables π§-gen-x86-fold-tablesβ generate X86 fold tables π-long-string-literalsβ when emitting large string tables, prefer string literals over comma-separated char literals. it's a readability and compile-time performance win, but heads up: it upsets some compilers π so like, know your compiler before you commit.-print-enumsβ print enumeration values for a class π-class=classnameβ makes-print-enumsprint the enumeration list for the specifiedclassnameπ-print-setsβ print expanded sets for testing DAG exprs π§ͺ
πΈ mlir-tblgen Options πΈ
a whole other menu of options, slay π
-gen-avail-interface-declsβ generate availability interface declarations β¨-gen-avail-interface-defsβ generate op interface definitions π-gen-dialect-docβ generate dialect documentation π-dialectβ the dialect to generate π-gen-directive-declβ generate declarations for directives (OpenMP, etc.) π―-gen-enum-declsβ generate enum utility declarations π-gen-enum-defsβ generate enum utility definitions π-gen-enum-from-llvmir-conversionsβ generate conversions of EnumAttrs from LLVM IR π-gen-enum-to-llvmir-conversionsβ generate conversions of EnumAttrs to LLVM IR π-gen-llvmir-conversionsβ generate LLVM IR conversions π-gen-llvmir-intrinsicsβ generate LLVM IR intrinsics π₯-llvmir-intrinsics-filterβ only keep the intrinsics with the specified substring in their record name π«Ά a lil filter, no big deal.-dialect-opclass-baseβ the base class for the ops in the dialect we're about to emit π-gen-op-declsβ generate operation declarations β¨-gen-op-defsβ generate operation definitions π-asmformat-error-is-fatalβ emit a fatal error if format parsing fails π like, no silent oopsie, it just straight up dies.-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β generate operation documentation π-gen-pass-declsβ generate operation documentation π (yes, that's what it says, bestie β copying it exactly, not my fault π)-name namestringβ the name of this group of passes π·οΈ note it's a space before the value, not an=.-gen-pass-docβ generate pass documentation π-gen-rewritersβ generate pattern rewriters π-gen-spirv-avail-implsβ generate SPIR-V operation utility definitions π-gen-spirv-capability-implicationβ generate a utility function to return implied capabilities for a given capability π§ β¨-gen-spirv-enum-avail-declsβ generate SPIR-V enum availability declarations π-gen-spirv-enum-avail-defsβ generate SPIR-V enum availability definitions π-gen-spirv-op-utilsβ generate SPIR-V operation utility definitions πΈ-gen-spirv-serializationβ generate SPIR-V (de)serialization utilities and functions π-gen-struct-attr-declsβ generate struct utility declarations π§±-gen-struct-attr-defsβ generate struct utility definitions π§±-gen-typedef-declsβ generate TypeDef declarations π·οΈ-gen-typedef-defsβ generate TypeDef definitions π·οΈ-typedefs-dialect nameβ generate types for this dialect π
π EXIT STATUS π
okay so the vibe check: if *-tblgen* succeeds, it exits with 0 π₯³ iconic, no notes.
otherwise, if an error occurs, it exits with a non-zero value π something went wrong and it's telling you loudly.
π Author π
maintained by the LLVM Team (https://llvm.org/) π«Ά they're out here doing the work.
π Copyright π
2003-2026, LLVM Project β
and that's the whole page, bestie β¨ this was TBLGEN(1) β page 15 of the manual, dated 2026-09-09, in all its LLVM glory. π¦π
π
π¦ where this page comes from
- ubuntu stonking: llvm-19 1:19.1.7-20ubuntu8 Β· 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