Files
David Green 3273cdaa5e [GlobalISel][AArch64] Do not remove dst type predicates from pattern children nodes. (#221576)
Given an instruction with a non-concrete type (G_CONCAT_VECTOR), with a
child pattern instruction with a concrete type (G_FPTRUNC), the concrete
type check for the child would incorrectly be removed. This patch makes
sure they remain. This makes the match table a little larger, but many
should be able to be optimized away (providing that the two operands
with the same type can be matched up).

Fixes #221458

(cherry picked from commit 09be00c800cf9ae03a2c8fbdc215c259ac39f30f)
2026-09-25 10:23:25 +02: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: