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*-tblgensends 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 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-immcheck-typesβ generatearm_immcheck_types.incfor 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 Clangattribute 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 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. filter it, bestie.-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. say it with me: directed acyclic graph. β¨-instrument-coverageβ make-gen-dag-iselgenerate tables to help identify the patterns matched.-omit-commentsβ make-gen-dag-iselomit comments. the default isfalse. 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-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. it's not ignoring you, it's telling you. π-gen-global-isel-combinerβ makes the GlobalISel combiner, bestie β¨-combiners=listβ tells-gen-global-isel-combinerto 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-combineremits π-gicombiner-stop-after-parseβ makes-gen-global-isel-combinerclock 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-enumsspit 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-infodump 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-enumsprint 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 π«Ά
π COPYRIGHT π
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
- fedora 43: llvm20 20.1.8-2.fc43 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 43: llvm20 20.1.8-2.fc43 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 44: llvm20 20.1.8-2.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 44: llvm20 20.1.8-2.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms