bolt/deps/llvm-18.1.8/llvm/utils/TableGen
2025-02-14 19:21:04 +01:00
..
GlobalISel Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
jupyter Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
AsmMatcherEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
AsmWriterEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
AsmWriterInst.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
AsmWriterInst.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
Attributes.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CallingConvEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CMakeLists.txt Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CodeEmitterGen.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CodeGenDAGPatterns.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CodeGenDAGPatterns.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CodeGenHwModes.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CodeGenHwModes.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CodeGenInstAlias.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CodeGenInstAlias.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CodeGenInstruction.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CodeGenInstruction.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CodeGenIntrinsics.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CodeGenIntrinsics.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CodeGenMapTable.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CodeGenRegisters.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CodeGenRegisters.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CodeGenSchedule.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CodeGenSchedule.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CodeGenTarget.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CodeGenTarget.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CompressInstEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
CTagsEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
DAGISelEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
DAGISelMatcher.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
DAGISelMatcher.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
DAGISelMatcherEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
DAGISelMatcherGen.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
DAGISelMatcherOpt.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
DecoderEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
DFAEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
DFAEmitter.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
DFAPacketizerEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
DirectiveEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
DisassemblerEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
DXILEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
ExegesisEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
FastISelEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
GlobalISelCombinerEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
GlobalISelEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
GlobalISelMatchTable.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
GlobalISelMatchTable.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
GlobalISelMatchTableExecutorEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
GlobalISelMatchTableExecutorEmitter.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
InfoByHwMode.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
InfoByHwMode.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
InstrDocsEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
InstrInfoEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
IntrinsicEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
MacroFusionPredicatorEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
OptEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
OptEmitter.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
OptParserEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
OptRSTEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
PredicateExpander.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
PredicateExpander.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
PseudoLoweringEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
README.md Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
RegisterBankEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
RegisterInfoEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
RISCVTargetDefEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
SDNodeProperties.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
SDNodeProperties.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
SearchableTableEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
SequenceToOffsetTable.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
SubtargetEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
SubtargetFeatureInfo.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
SubtargetFeatureInfo.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
TableGen.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
TableGenBackends.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
tdtags Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
Types.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
Types.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
VarLenCodeEmitterGen.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
VarLenCodeEmitterGen.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
VTEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
WebAssemblyDisassemblerEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
WebAssemblyDisassemblerEmitter.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
X86CompressEVEXTablesEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
X86DisassemblerShared.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
X86DisassemblerTables.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
X86DisassemblerTables.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
X86FoldTablesEmitter.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
X86ManualCompressEVEXTables.def Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
X86ManualFoldTables.def Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
X86MnemonicTables.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
X86ModRMFilters.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
X86ModRMFilters.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
X86RecognizableInstr.cpp Embed LLVM 18.1.8 2025-02-14 19:21:04 +01:00
X86RecognizableInstr.h Embed LLVM 18.1.8 2025-02-14 19:21:04 +01: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: