blob: 372d1b2a73086ff0938a0a4441259a6f2fab7a1c [file] [log] [blame]
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +00001tblgen - Target Description To C++ Code Generator
2=================================================
3
James Hendersona0566842019-06-27 13:24:46 +00004.. program:: tblgen
5
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +00006SYNOPSIS
7--------
8
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +00009:program:`tblgen` [*options*] [*filename*]
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000010
11DESCRIPTION
12-----------
13
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000014:program:`tblgen` translates from target description (``.td``) files into C++
15code that can be included in the definition of an LLVM target library. Most
16users of LLVM will not need to use this program. It is only for assisting with
17writing an LLVM target backend.
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000018
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000019The input and output of :program:`tblgen` is beyond the scope of this short
Sean Silva397ee6e2014-04-07 22:46:40 +000020introduction; please see the :doc:`introduction to TableGen
21<../TableGen/index>`.
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000022
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000023The *filename* argument specifies the name of a Target Description (``.td``)
24file to read as input.
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000025
26OPTIONS
27-------
28
Dmitri Gribenko7d8b6072013-04-27 16:34:24 +000029.. program:: tblgen
30
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000031.. option:: -help
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000032
33 Print a summary of command line options.
34
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000035.. option:: -o filename
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000036
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000037 Specify the output file name. If ``filename`` is ``-``, then
38 :program:`tblgen` sends its output to standard output.
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000039
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000040.. option:: -I directory
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000041
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000042 Specify where to find other target description files for inclusion. The
43 ``directory`` value should be a full or partial path to a directory that
44 contains target description files.
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000045
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000046.. option:: -asmparsernum N
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000047
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000048 Make -gen-asm-parser emit assembly writer number ``N``.
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000049
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000050.. option:: -asmwriternum N
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000051
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000052 Make -gen-asm-writer emit assembly writer number ``N``.
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000053
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000054.. option:: -class className
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000055
56 Print the enumeration list for this class.
57
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000058.. option:: -print-records
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000059
60 Print all records to standard output (default).
61
Simon Tatham6a8c6ca2018-07-11 08:40:19 +000062.. option:: -dump-json
63
64 Print a JSON representation of all records, suitable for further
65 automated processing.
66
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000067.. option:: -print-enums
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000068
Dmitri Gribenko7d8b6072013-04-27 16:34:24 +000069 Print enumeration values for a class.
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000070
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000071.. option:: -print-sets
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000072
73 Print expanded sets for testing DAG exprs.
74
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000075.. option:: -gen-emitter
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000076
77 Generate machine code emitter.
78
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000079.. option:: -gen-register-info
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000080
81 Generate registers and register classes info.
82
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000083.. option:: -gen-instr-info
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000084
85 Generate instruction descriptions.
86
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000087.. option:: -gen-asm-writer
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000088
89 Generate the assembly writer.
90
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000091.. option:: -gen-disassembler
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000092
93 Generate disassembler.
94
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000095.. option:: -gen-pseudo-lowering
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000096
97 Generate pseudo instruction lowering.
98
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000099.. option:: -gen-dag-isel
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000100
101 Generate a DAG (Directed Acycle Graph) instruction selector.
102
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +0000103.. option:: -gen-asm-matcher
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000104
105 Generate assembly instruction matcher.
106
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +0000107.. option:: -gen-dfa-packetizer
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000108
109 Generate DFA Packetizer for VLIW targets.
110
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +0000111.. option:: -gen-fast-isel
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000112
113 Generate a "fast" instruction selector.
114
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +0000115.. option:: -gen-subtarget
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000116
117 Generate subtarget enumerations.
118
Fangrui Song05f66262018-06-25 19:40:08 +0000119.. option:: -gen-intrinsic-enums
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000120
Fangrui Song05f66262018-06-25 19:40:08 +0000121 Generate intrinsic enums.
122
123.. option:: -gen-intrinsic-impl
124
125 Generate intrinsic implementation.
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000126
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +0000127.. option:: -gen-tgt-intrinsic
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000128
129 Generate target intrinsic information.
130
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +0000131.. option:: -gen-enhanced-disassembly-info
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000132
133 Generate enhanced disassembly info.
134
Clement Courbet41c8af32018-10-25 07:44:01 +0000135.. option:: -gen-exegesis
136
137 Generate llvm-exegesis tables.
138
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +0000139.. option:: -version
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000140
141 Show the version number of this program.
142
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000143EXIT STATUS
144-----------
145
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +0000146If :program:`tblgen` succeeds, it will exit with 0. Otherwise, if an error
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000147occurs, it will exit with a non-zero value.