TBLGEN(1)
TBLGEN(1) π β the LLVM manual, bestie β¨
Okay so tblgen is literally the manual page for the *-tblgen family of programs. They translate target description (.td) files into C++ code and other output formats. Most LLVM users will not need this program β itβs only for writing parts of the compiler, debugger, and LLVM target backends, iykyk. π
π¦ 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 translate target description (.td) files into C++ code and other output formats. 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. No cap. π«Ά
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. π
The filename argument specifies the name of the Target Description (.td) file that TableGen processes. Slay. β¨
π OPTIONS π
πΈ General Options πΈ
-helpβ prints a description of the command-line options. Cute and useful.-help-listβ prints a description of the command-line options in a simple list format. List girlies stay winning.-D=macronameβ specifies 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β specifies the name of the dependency filename.-debugβ enables debug output. Turn it on if you want the tea. π΅-dump-jsonβ prints a JSON representation of all records, suitable for further automated processing.-I directoryβ specifies 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β parses the source files and builds the records, but does not run any backend. This is useful for timing the frontend.-o filenameβ specifies the output file name. If filename is-, then*-tblgensends its output to standard output.-print-recordsβ prints all classes and records to standard output (this is the default backend option).-print-detailed-recordsβ prints a detailed report of all global variables, classes, and records to standard output.-statsβ prints a report with any statistics collected by the backend.-time-phasesβ times the parser and backend phases and prints a report.-versionβ shows the version number of the program.-write-if-changedβ writes the output file only if it is new or has changed.
π clang-tblgen Options π
-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 trailing quote is part of the flag here. Preserve it, bestie. π-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 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 uses warnings from specified component.-gen-clang-diag-groupsβ generates Clang diagnostic groups.-gen-clang-diags-index-nameβ generates Clang diagnostic name index.-gen-clang-basic-readerβ generates ClangBasicReaderclasses.-gen-clang-basic-writerβ generates ClangBasicWriterclasses.-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 ClangAbstractTypeReaderclass.-gen-clang-type-writerβ generates ClangAbstractTypeWriterclass.-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-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-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 π¦
gen-lldb-option-defsβ generates lldbOptionDefinitionvalues. No leading dash here, bestie β keep it exactly like this.gen-lldb-property-defsβ generates lldbPropertyDefinitionvalues.gen-lldb-property-enum-defsβ generates lldbPropertyDefinitionenum values.
π₯ llvm-tblgen Options π₯
-gen-asm-matcherβ generates assembly instruction matcher.-match-prefix=prefixβ makes-gen-asm-matchermatch only instructions with the given prefix.-gen-asm-parserβ generates assembly instruction parser.-asmparsernum=nβ makes-gen-asm-parseremit assembly parser number n.-gen-asm-writerβ generates assembly writer.-asmwriternum=nβ makes-gen-asm-writeremit assembly writer number n.-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β generatesllvm-exegesistables.-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β generates GlobalISel combiner.-combiners=listβ makes-gen-global-isel-combineremit the specified combiners.-gicombiner-show-expansionsβ makes-gen-global-isel-combineruse C++ comments to indicate occurrences of code expansion.-gicombiner-stop-after-buildβ makes-gen-global-isel-combinerstop processing right after it builds the match tree (basically a "ok we're done here" flag π ).-gicombiner-stop-after-parseβ makes-gen-global-isel-combinerstop after parsing the rules and dump state β very "let me see what I'm working with first" of it.-gen-instr-infoβ generate instruction descriptions.-gen-instr-docsβ generate instruction documentation.-gen-intrinsic-enumsβ generate intrinsic enums.-intrinsic-prefix=prefixβ makes-gen-intrinsic-enumsgenerate intrinsics with this targetprefix.-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 π.-gen-searchable-tablesβ generate generic searchable tables. See TableGen BackEnds for a detailed description, iykyk.-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. This can be a readability and compile-time performance win, but upsets some compilers π β so like, proceed with vibes checked.-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 π§
Bestie, this is the whole other flavor of the tool β same energy, different target π.
-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.-dialect-opclass-baseβ the base class for the ops in the dialect we are 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 π.-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.-name namestringβ the name of this group of passes, asnamestring.-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 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,name.
π EXIT STATUS π
If *-tblgen succeeds, it exits with 0 β slay, we love a clean exit π
β¨. Otherwise, if an error occurs, it exits with a non-zero value. That's the vibe check failing, bestie, no cap.
π AUTHOR π
Maintained by the LLVM Team (https://llvm.org/) β the actual main characters of this whole story, fr fr π«Ά.
π COPYRIGHT π
2003-2023, LLVM Project β iconic, legendary, the blueprint π.
And that's the whole page, bestie! π¦ Go forth and generate all the things. This one's version 15, dated 2023-07-14, and it's filed under TBLGEN(1) β so if you ever forget, just remember: the girlies who read manpages together stay together β¨πΈπ
π¦ where this page comes from
- ubuntu jammy: llvm-15 1:15.0.7-0ubuntu0.22.04.3 Β· 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