Files
llvm-project/llvm/utils/TableGen
Finn Plummer af9f6d61b5 [NFC][VectorUtils] Simplify description of TriviallyScalaraziable intrinsics (#192505)
This pr allows us to specify if an intrinsic is `TriviallyScalarizable`
by specifying it in a more idiomatic way as an intrinsic property.

This was suggested here:
https://github.com/llvm/llvm-project/issues/120169#issuecomment-3805670982,
and would allow for the attached issue to be resolved in a similar
manner by having a `TriviallyVectorizable` property as well.

Assisted by: Github Copilot
2026-04-20 20:10:17 +00:00
..

LLVM TableGen

The purpose of TableGen is to generate complex output files based on information from source files that are significantly easier to code than the output files would be, and also easier to maintain and modify over time.

The information is coded in a declarative style involving classes and records, which are then processed by TableGen.

class Hello <string _msg> {
  string msg = !strconcat("Hello ", _msg);
}

def HelloWorld: Hello<"world!"> {}
------------- Classes -----------------
class Hello<string Hello:_msg = ?> {
  string msg = !strconcat("Hello ", Hello:_msg);
}
------------- Defs -----------------
def HelloWorld {        // Hello
  string msg = "Hello world!";
}

Try this example on Compiler Explorer.

The internalized records are passed on to various backends, which extract information from a subset of the records and generate one or more output files.

These output files are typically .inc files for C++, but may be any type of file that the backend developer needs.

Resources for learning the language:

Writing TableGen backends:

TableGen in MLIR:

Useful tools: