llvm-c166/llvm/utils/TableGen
Chinmay Deshpande 34286058e2
[AMDGPU] Add MaxHWAddressableLocalMemorySize to TargetParser (#219020)
This is to aid in resolving
https://github.com/ROCm/llvm-project/issues/3298 : "Comgr should use
target information from upstream TargetParser rather than maintaining
its own"
2026-08-26 15:48:43 -07:00
..
Basic [AMDGPU] Add MaxHWAddressableLocalMemorySize to TargetParser (#219020) 2026-08-26 15:48:43 -07:00
Common [TableGen] Remove unnecessary sorts from writeToStream in InfoByHwMode subclasses. NFC (#218977) 2026-08-26 17:49:29 +00:00
jupyter
AsmMatcherEmitter.cpp [TableGen] Fix non-deterministic output from emitGetRegClassFromMatchKindFunc. (#218560) 2026-08-25 18:14:35 -07:00
AsmWriterEmitter.cpp
CallingConvEmitter.cpp
CMakeLists.txt
CodeEmitterGen.cpp
CodeGenMapTable.cpp
CompressInstEmitter.cpp
CTagsEmitter.cpp
DAGISelEmitter.cpp
DAGISelMatcher.cpp
DAGISelMatcher.h
DAGISelMatcherEmitter.cpp
DAGISelMatcherGen.cpp
DAGISelMatcherOpt.cpp
DecoderEmitter.cpp
DecoderTableEmitter.cpp
DecoderTableEmitter.h
DecoderTree.cpp
DecoderTree.h
DFAEmitter.cpp
DFAEmitter.h
DFAPacketizerEmitter.cpp
DisassemblerEmitter.cpp
DXILEmitter.cpp
ExegesisEmitter.cpp
FastISelEmitter.cpp
GlobalISelCombinerEmitter.cpp
GlobalISelEmitter.cpp
InstrDocsEmitter.cpp
InstrInfoEmitter.cpp
llvm-min-tblgen.cpp
llvm-tblgen.cpp
MacroFusionPredicatorEmitter.cpp
OptionParserEmitter.cpp
OptionRSTEmitter.cpp
PseudoLoweringEmitter.cpp
README.md
RegisterBankEmitter.cpp
RegisterInfoEmitter.cpp [MC][NFC] Store RegBitSet more compact (#218701) 2026-08-25 20:04:06 +02:00
SDNodeInfoEmitter.cpp
SearchableTableEmitter.cpp
SubtargetEmitter.cpp
TableGenBackends.h
tdtags
WebAssemblyDisassemblerEmitter.cpp
WebAssemblyDisassemblerEmitter.h
X86DisassemblerShared.h
X86DisassemblerTables.cpp
X86DisassemblerTables.h
X86FoldTablesEmitter.cpp
X86InstrMappingEmitter.cpp
X86ManualFoldTables.def
X86ManualInstrMapping.def
X86MnemonicTables.cpp
X86ModRMFilters.cpp
X86ModRMFilters.h
X86RecognizableInstr.cpp
X86RecognizableInstr.h

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: