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. thedirectoryvalue 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. iffilenameis-, then*-tblgensends 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 specifiedcomponent.-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β generatesarm_neon.hfor Clang.-gen-arm-fp16β generatesarm_fp16.hfor Clang.-gen-arm-bf16β generatesarm_bf16.hfor 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β generatesarm_immcheck_types.incfor Clang.-gen-arm-sve-headerβ generatesarm_sve.hfor Clang.-gen-arm-sve-builtinsβ generatesarm_sve_builtins.incfor Clang.-gen-arm-sve-builtin-codegenβ generatesarm_sve_builtin_cg_map.incfor Clang.-gen-arm-sve-typeflagsβ generatesarm_sve_typeflags.incfor Clang.-gen-arm-sve-sema-rangechecksβ generatesarm_sve_sema_rangechecks.incfor Clang.-gen-arm-mve-headerβ generatesarm_mve.hfor 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β generatesarm_cde.hfor 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β generatesriscv_vector.hfor Clang.-gen-riscv-vector-builtinsβ generatesriscv_vector_builtins.incfor Clang.-gen-riscv-vector-builtin-codegenβ generatesriscv_vector_builtin_cg.incfor Clang.-gen-riscv-sifive-vector-builtinsβ generatesriscv_sifive_vector_builtins.incfor Clang.-gen-riscv-sifive-vector-builtin-codegenβ generatesriscv_sifive_vector_builtin_cg.incfor 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 attributefor 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 lldbOptionDefinitionvalues.gen-lldb-property-defsβ generates lldbPropertyDefinitionvalues.gen-lldb-property-enum-defsβ generates lldbPropertyDefinitionenum 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-matchermatch only instructions with the givenprefix.-gen-asm-parserβ generates assembly instruction parser.-asmparsernum=nβ makes-gen-asm-parseremit assembly parser numbern.-gen-asm-writerβ generates assembly writer.-asmwriternum=nβ makes-gen-asm-writeremit assembly writer numbern.-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-iselgenerate tables to help identify the patterns matched.-omit-commentsβ makes-gen-dag-iselomit 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-iselgenerate coverage instrumentation.-optimize-match-tableβ makes-gen-global-iselgenerate an optimized version of the match table.-warn-on-skipped-patternsβ makes-gen-global-iselexplain 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-combineremit 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-combineremits. little breadcrumbs everywhere π-gicombiner-stop-after-parseβ tells-gen-global-isel-combinerto 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-enumsgenerate 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-infodump register information for debugging. peek behind the curtain energy π₯-gen-searchable-tablesβ generates generic searchable tables. the page says to seeTableGen 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-enumsprint 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 ofEnumAttrsfrom LLVM IR.-gen-enum-to-llvmir-conversionsβ generates conversions ofEnumAttrsto 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β generatesTypeDefdeclarations.-gen-typedef-defsβ generatesTypeDefdefinitions.-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 β¨
π Copyright π
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