TBLGEN(1)

πŸ“¦
version 13.0.1 Β· 5 versions
, in ubuntu jammy

✨ NAME ✨

okay so this is TBLGEN(1) from the LLVM manual, bestie β€” the name is literally tblgen β€” Description to C++ Code. πŸ’–

πŸ¦‹ SYNOPSIS πŸ¦‹

clang-tblgen [options] [filename]

lldb-tblgen [options] [filename]

llvm-tblgen [options] [filename]

mlir-tblgen [options] [filename]

πŸ’– DESCRIPTION πŸ’–

okay so *-tblgen is a whole family of programs that translates 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. ✨

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. πŸŽ€

πŸŽ€ 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.
  • -D=macroname β€” Specify the name of a macro to be defined. The name is defined, but it has no particular value.
  • -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.
  • -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. This is useful for timing the frontend.
  • -o filename β€” Specify the output file name. If filename is -, then *-tblgen sends its output to standard output.
  • -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.
  • -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.

πŸ’… 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.
  • -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 β€” Generate arm_neon.h for Clang.
  • -gen-arm-fp16 β€” Generate arm_fp16.h for Clang.
  • -gen-arm-bf16 β€” Generate arm_bf16.h for 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 β€” Generate arm_sve.h for Clang.
  • -gen-arm-sve-builtins β€” Generate arm_sve_builtins.inc for Clang.
  • -gen-arm-sve-builtin-codegen β€” Generate arm_sve_builtin_cg_map.inc for Clang.
  • -gen-arm-sve-typeflags β€” Generate arm_sve_typeflags.inc for Clang.
  • -gen-arm-sve-sema-rangechecks β€” Generate arm_sve_sema_rangechecks.inc for Clang.
  • -gen-arm-mve-header β€” Generate arm_mve.h for 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 β€” Generate arm_cde.h for 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 β€” Generate riscv_vector.h for Clang.
  • -gen-riscv-vector-builtins β€” Generate riscv_vector_builtins.inc for Clang.
  • -gen-riscv-vector-builtin-codegen β€” Generate riscv_vector_builtin_cg.inc for 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 attribute for testing purposes.

πŸ¦‹ lldb-tblgen Options πŸ¦‹

  • gen-lldb-option-defs β€” Generate lldb OptionDefinition values.
  • gen-lldb-property-defs β€” Generate lldb PropertyDefinition values.
  • gen-lldb-property-enum-defs β€” Generate lldb PropertyDefinition enum values.

πŸ”₯ llvm-tblgen Options πŸ”₯

  • -gen-asm-matcher β€” Generate assembly instruction matcher.
  • -match-prefix=prefix β€” Make -gen-asm-matcher match only instructions with the given prefix.
  • -gen-asm-parser β€” Generate assembly instruction parser.
  • -asmparsernum=n β€” Make -gen-asm-parser emit assembly parser number n.
  • -gen-asm-writer β€” Generate assembly writer.
  • -asmwriternum=n β€” Make -gen-asm-writer emit 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-isel generate tables to help identify the patterns matched.
  • -omit-comments β€” Make -gen-dag-isel omit comments. The default is false.
  • -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.
  • -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-isel generate coverage instrumentation.
  • -optimize-match-table β€” Make -gen-global-isel generate an optimized version of the match table.
  • -warn-on-skipped-patterns β€” Make -gen-global-isel explain why a pattern was skipped for inclusion.
  • -gen-global-isel-combiner β€” Generate GlobalISel combiner.
  • -combiners=list β€” Make -gen-global-isel-combiner emit the specified combiners.
  • -gicombiner-show-expansions β€” Make -gen-global-isel-combiner use C++ comments to indicate occurrences of code expansion.
  • -gicombiner-stop-after-build β€” makes -gen-global-isel-combiner stop doing its thing right after it builds the match tree. like, tree's built, we're done, bye πŸ’…
  • -gicombiner-stop-after-parse β€” makes -gen-global-isel-combiner stop right after it parses the rules, and then it dumps the state so you can peek at it πŸ‘€
  • -gen-instr-info β€” generates instruction descriptions.
  • -gen-instr-docs β€” generates instruction documentation. yes, docs. for instructions. slay ✨
  • -gen-intrinsic-enums β€” generates intrinsic enums.
  • -intrinsic-prefix=prefix β€” makes -gen-intrinsic-enums generate 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. the whole register lore 🫢
  • -register-info-debug β€” makes -gen-register-info dump register information for debugging. detective mode πŸ”
  • -gen-searchable-tables β€” generates generic searchable tables. see TableGen BackEnds for the detailed description, iykyk.
  • -gen-subtarget β€” generates subtarget enumerations.
  • -gen-x86-EVEX2VEX-tables β€” generates X86 EVEX to VEX compress tables. very specific, very iconic πŸ’…
  • -gen-x86-fold-tables β€” generates 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 it upsets some compilers 😭 like, sorry bestie, not everyone can handle it.
  • -print-enums β€” prints enumeration values for a class.
  • -class=classname β€” makes -print-enums print the enumeration list for the specified class. plug the classname in and go πŸ’–
  • -print-sets β€” prints expanded sets for testing DAG exprs. testing era πŸ§ͺ

🌈 mlir-tblgen Options 🌈

okay this whole squad is for mlir-tblgen, and it's a lot, but we're getting through it together πŸ’œ

  • -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 it, that's the whole vibe.
  • -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. filtering? we love a curated feed ✨
  • -dialect-opclass-base β€” the base class for the ops in the dialect we're about to emit. main character base class energy πŸ‘‘
  • -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 chill, no grace, just fatal πŸ’€
  • -op-exclude-regex β€” regular expression of name of ops to exclude (no filter if empty). leave it empty and it just doesn't filter, easy.
  • -op-include-regex β€” regular expression of name of ops to include (no filter if empty). same deal, empty means no filter.
  • -gen-op-doc β€” generates operation documentation.
  • -gen-pass-decls β€” generates operation documentation. yes the original says operation documentation here, not pass, and we are not editing it, periodt 🫑
  • -name namestring β€” the name of this group of passes. (no = bestie, it's a space, watch out πŸ‘€)
  • -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. both directions, we're versatile πŸ’…
  • -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. (again, space not =, we stay vigilant πŸŽ€)

πŸ’« EXIT STATUS πŸ’«

if *-tblgen succeeds, it exits with 0 and everyone cheers πŸŽ‰

otherwise, if an error occurs, it exits with a non-zero value. and that's the whole story, no plot twist 😭


πŸ¦‹ AUTHOR πŸ¦‹

maintained by the LLVM Team (https://llvm.org/). absolute icons, honestly 🫢


2003-2023, LLVM Project


and that's a wrap bestie!! this page is from the 13 version, dated 2023-07-14, filed under TBLGEN(1) β€” go forth and generate, you've got this πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from