tblgen - Description to C++ Code


clang-tblgen [options] [filename]

lldb-tblgen [options] [filename]

llvm-tblgen [options] [filename]

mlir-tblgen [options] [filename]


*-tblgen is a 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.


General Options


Print a description of the command line options.


Print a description of the command line options in a simple list format.


Specify the name of a macro to be defined. The name is defined, but it has no particular value.


Specify the name of the dependency filename.


Enable debug output.


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.


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 all classes and records to standard output (default backend option).


Print a detailed report of all global variables, classes, and records to standard output.


Print a report with any statistics collected by the backend.


Time the parser and backend phases and print a report.


Show the version number of the program.


Write the output file only if it is new or has changed.

clang-tblgen Options


Generate Clang attribute classes.


Generate all parser-related attribute string switches.


Generate all parser-related attribute subject match rule string switches.


Generate Clang attribute implementations.


Generate a Clang attribute list.


Generate a Clang attribute subject match rule list.


Generate Clang PCH attribute reader.


Generate Clang PCH attribute writer.


Generate a Clang attribute spelling list.


Generate a Clang attribute spelling index.


Generate a recursive AST visitor for Clang attributes.


Generate a Clang template instantiate code.


Generate a Clang parsed attribute list.


Generate the Clang parsed attribute helpers.


Generate a Clang parsed attribute kinds.


Generate Clang attribute text node dumper.


Generate Clang attribute traverser.


Generate Clang diagnostics definitions.

-clang-component component

Only use warnings from specified component.


Generate Clang diagnostic groups.


Generate Clang diagnostic name index.


Generate Clang BasicReader classes.


Generate Clang BasicWriter classes.


Generate Clang AST comment nodes.


Generate Clang AST declaration nodes.


Generate Clang AST statement nodes.


Generate Clang AST type nodes.


Generate Clang AbstractTypeReader class.


Generate Clang AbstractTypeWriter class.


Generate Clang constexpr interpreter opcodes.


Generate Clang static analyzer checkers.


Generate efficient matchers for HTML tag names that are used in documentation comments.


Generate efficient matchers for HTML tag properties.


Generate function to translate named character references to UTF-8 sequences.


Generate command properties for commands that are used in documentation comments.


Generate list of commands that are used in documentation comments.


Generate OpenCL builtin declaration handlers.


Generate arm_neon.h for Clang.


Generate arm_fp16.h for Clang.


Generate arm_bf16.h for Clang.


Generate ARM NEON sema support for Clang.


Generate ARM NEON tests for Clang.


Generate arm_sve.h for Clang.


Generate arm_sve_builtins.inc for Clang.


Generate arm_sve_builtin_cg_map.inc for Clang.


Generate arm_sve_typeflags.inc for Clang.


Generate arm_sve_sema_rangechecks.inc for Clang.


Generate arm_mve.h for Clang.


Generate ARM MVE builtin definitions for Clang.


Generate ARM MVE builtin sema checks for Clang.


Generate ARM MVE builtin code-generator for Clang.


Generate list of valid ARM MVE builtin aliases for Clang.


Generate arm_cde.h for Clang.


Generate ARM CDE builtin definitions for Clang.


Generate ARM CDE builtin sema checks for Clang.


Generate ARM CDE builtin code-generator for Clang.


Generate list of valid ARM CDE builtin aliases for Clang.


Generate riscv_vector.h for Clang.


Generate riscv_vector_builtins.inc for Clang.


Generate riscv_vector_builtin_cg.inc for Clang.


Generate riscv_sifive_vector_builtins.inc for Clang.


Generate riscv_sifive_vector_builtin_cg.inc for Clang.


Generate attribute documentation.


Generate diagnostic documentation.


Generate option documentation.


Generate data collectors for AST nodes.


Generate a list of attributes supported by #pragma Clang attribute for testing purposes.

lldb-tblgen Options


Generate lldb OptionDefinition values.


Generate lldb PropertyDefinition values.


Generate lldb PropertyDefinition enum values.

llvm-tblgen Options


Generate assembly instruction matcher.


Make -gen-asm-matcher match only instructions with the given prefix.


Generate assembly instruction parser.


Make -gen-asm-parser emit assembly parser number n.


Generate assembly writer.


Make -gen-asm-writer emit assembly writer number n.


Generate attributes.


Generate generic automata.


Generate calling convention descriptions.


Generate RISC-V compressed instructions.


Generate ctags-compatible index.


Generate a DAG (directed acyclic graph) instruction selector.


Make -gen-dag-isel generate tables to help identify the patterns matched.


Make -gen-dag-isel omit comments. The default is false.


Generate DFA Packetizer for VLIW targets.


Generate directive related declaration code (header file).


Generate directive related implementation code part.


Generate directive related implementation code.


Generate disassembler.


Generate machine code emitter.


Generate llvm-exegesis tables.


Generate a “fast” instruction selector.


Generate GlobalISel selector.


Specify the file from which to retrieve coverage information.


Make -gen-global-isel generate coverage instrumentation.


Make -gen-global-isel generate an optimized version of the match table.


Make -gen-global-isel explain why a pattern was skipped for inclusion.


Generate GlobalISel combiner.


Make -gen-global-isel-combiner emit the specified combiners.


Add debug comments to all C++ predicates emitted by -gen-global-isel-combiner


Make -gen-global-isel-combiner stop processing after parsing rules and dump state.


Generate instruction descriptions.


Generate instruction documentation.


Generate intrinsic enums.


Make -gen-intrinsic-enums generate intrinsics with this target prefix.


Generate intrinsic information.


Generate options definitions.


Generate option RST.


Generate pseudo instruction lowering.


Generate register bank descriptions.


Generate registers and register classes info.


Make -gen-register-info dump register information for debugging.


Generate generic searchable tables. See TableGen BackEnds for a detailed description.


Generate subtarget enumerations.


Generate X86 EVEX to VEX compress tables.


Generate X86 fold tables.


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.


Print enumeration values for a class.


Make -print-enums print the enumeration list for the specified class.


Print expanded sets for testing DAG exprs.

mlir-tblgen Options


Generate availability interface declarations.


Generate op interface definitions.


Generate dialect documentation.


The dialect to generate.


Generate declarations for directives (OpenMP, etc.).


Generate enum utility declarations.


Generate enum utility definitions.


Generate conversions of EnumAttrs from LLVM IR.


Generate conversions of EnumAttrs to LLVM IR.


Generate LLVM IR conversions.


Generate LLVM IR intrinsics.


Only keep the intrinsics with the specified substring in their record name.


The base class for the ops in the dialect we are to emit.


Generate operation declarations.


Generate operation definitions.


Emit a fatal error if format parsing fails.


Regular expression of name of ops to exclude (no filter if empty).


Regular expression of name of ops to include (no filter if empty).


Generate operation documentation.


Generate operation documentation.

-name namestring

The name of this group of passes.


Generate pass documentation.


Generate pattern rewriters.


Generate SPIR-V operation utility definitions.


Generate utility function to return implied capabilities for a given capability.


Generate SPIR-V enum availability declarations.


Generate SPIR-V enum availability definitions.


Generate SPIR-V operation utility definitions.


Generate SPIR-V (de)serialization utilities and functions.


Generate struct utility declarations.


Generate struct utility definitions.


Generate TypeDef declarations.


Generate TypeDef definitions.

-typedefs-dialect name

Generate types for this dialect.


If *-tblgen succeeds, it will exit with 0. Otherwise, if an error occurs, it will exit with a non-zero value.