1TBLGEN(1) LLVM TBLGEN(1)
2
3
4
6 tblgen - Description to C++ Code
7
9 clang-tblgen [options] [filename]
10
11 lldb-tblgen [options] [filename]
12
13 llvm-tblgen [options] [filename]
14
15 mlir-tblgen [options] [filename]
16
18 *-tblgen is a family of programs that translates target description
19 (.td) files into C++ code and other output formats. Most users of LLVM
20 will not need to use this program. It is used only for writing parts of
21 the compiler, debugger, and LLVM target backends.
22
23 The details of the input and output of the *-tblgen programs is beyond
24 the scope of this short introduction; please see the TableGen Overview
25 for an introduction and for references to additional TableGen docu‐
26 ments.
27
28 The filename argument specifies the name of the Target Description
29 (.td) file that TableGen processes.
30
32 General Options
33 -help Print a description of the command line options.
34
35 -help-list
36 Print a description of the command line options in a simple list
37 format.
38
39 -D=macroname
40 Specify the name of a macro to be defined. The name is defined,
41 but it has no particular value.
42
43 -d=filename
44 Specify the name of the dependency filename.
45
46 -debug Enable debug output.
47
48 -dump-json
49 Print a JSON representation of all records, suitable for further
50 automated processing.
51
52 -I directory
53 Specify where to find other target description files for inclu‐
54 sion. The directory value should be a full or partial path to a
55 directory that contains target description files.
56
57 -null-backend
58 Parse the source files and build the records, but do not run any
59 backend. This is useful for timing the frontend.
60
61 -o filename
62 Specify the output file name. If filename is -, then *-tblgen
63 sends its output to standard output.
64
65 -print-records
66 Print all classes and records to standard output (default back‐
67 end option).
68
69 -print-detailed-records
70 Print a detailed report of all global variables, classes, and
71 records to standard output.
72
73 -stats Print a report with any statistics collected by the backend.
74
75 -time-phases
76 Time the parser and backend phases and print a report.
77
78 -version
79 Show the version number of the program.
80
81 -write-if-changed
82 Write the output file only if it is new or has changed.
83
84 clang-tblgen Options
85 -gen-clang-attr-classes
86 Generate Clang attribute classes.
87
88 -gen-clang-attr-parser-string-switches
89 Generate all parser-related attribute string switches.
90
91 -gen-clang-attr-subject-match-rules-parser-string-switches
92 Generate all parser-related attribute subject match rule string
93 switches.
94
95 -gen-clang-attr-impl
96 Generate Clang attribute implementations.
97
98 -gen-clang-attr-list"
99 Generate a Clang attribute list.
100
101 -gen-clang-attr-subject-match-rule-list
102 Generate a Clang attribute subject match rule list.
103
104 -gen-clang-attr-pch-read
105 Generate Clang PCH attribute reader.
106
107 -gen-clang-attr-pch-write
108 Generate Clang PCH attribute writer.
109
110 -gen-clang-attr-has-attribute-impl
111 Generate a Clang attribute spelling list.
112
113 -gen-clang-attr-spelling-index
114 Generate a Clang attribute spelling index.
115
116 -gen-clang-attr-ast-visitor
117 Generate a recursive AST visitor for Clang attributes.
118
119 -gen-clang-attr-template-instantiate
120 Generate a Clang template instantiate code.
121
122 -gen-clang-attr-parsed-attr-list
123 Generate a Clang parsed attribute list.
124
125 -gen-clang-attr-parsed-attr-impl
126 Generate the Clang parsed attribute helpers.
127
128 -gen-clang-attr-parsed-attr-kinds
129 Generate a Clang parsed attribute kinds.
130
131 -gen-clang-attr-text-node-dump
132 Generate Clang attribute text node dumper.
133
134 -gen-clang-attr-node-traverse
135 Generate Clang attribute traverser.
136
137 -gen-clang-diags-defs
138 Generate Clang diagnostics definitions.
139
140 -clang-component component
141 Only use warnings from specified component.
142
143 -gen-clang-diag-groups
144 Generate Clang diagnostic groups.
145
146 -gen-clang-diags-index-name
147 Generate Clang diagnostic name index.
148
149 -gen-clang-basic-reader
150 Generate Clang BasicReader classes.
151
152 -gen-clang-basic-writer
153 Generate Clang BasicWriter classes.
154
155 -gen-clang-comment-nodes
156 Generate Clang AST comment nodes.
157
158 -gen-clang-decl-nodes
159 Generate Clang AST declaration nodes.
160
161 -gen-clang-stmt-nodes
162 Generate Clang AST statement nodes.
163
164 -gen-clang-type-nodes
165 Generate Clang AST type nodes.
166
167 -gen-clang-type-reader
168 Generate Clang AbstractTypeReader class.
169
170 -gen-clang-type-writer
171 Generate Clang AbstractTypeWriter class.
172
173 -gen-clang-opcodes
174 Generate Clang constexpr interpreter opcodes.
175
176 -gen-clang-sa-checkers
177 Generate Clang static analyzer checkers.
178
179 -gen-clang-comment-html-tags
180 Generate efficient matchers for HTML tag names that are used in
181 documentation comments.
182
183 -gen-clang-comment-html-tags-properties
184 Generate efficient matchers for HTML tag properties.
185
186 -gen-clang-comment-html-named-character-references
187 Generate function to translate named character references to
188 UTF-8 sequences.
189
190 -gen-clang-comment-command-info
191 Generate command properties for commands that are used in docu‐
192 mentation comments.
193
194 -gen-clang-comment-command-list
195 Generate list of commands that are used in documentation com‐
196 ments.
197
198 -gen-clang-opencl-builtins
199 Generate OpenCL builtin declaration handlers.
200
201 -gen-arm-neon
202 Generate arm_neon.h for Clang.
203
204 -gen-arm-fp16
205 Generate arm_fp16.h for Clang.
206
207 -gen-arm-bf16
208 Generate arm_bf16.h for Clang.
209
210 -gen-arm-neon-sema
211 Generate ARM NEON sema support for Clang.
212
213 -gen-arm-neon-test
214 Generate ARM NEON tests for Clang.
215
216 -gen-arm-sve-header
217 Generate arm_sve.h for Clang.
218
219 -gen-arm-sve-builtins
220 Generate arm_sve_builtins.inc for Clang.
221
222 -gen-arm-sve-builtin-codegen
223 Generate arm_sve_builtin_cg_map.inc for Clang.
224
225 -gen-arm-sve-typeflags
226 Generate arm_sve_typeflags.inc for Clang.
227
228 -gen-arm-sve-sema-rangechecks
229 Generate arm_sve_sema_rangechecks.inc for Clang.
230
231 -gen-arm-mve-header
232 Generate arm_mve.h for Clang.
233
234 -gen-arm-mve-builtin-def
235 Generate ARM MVE builtin definitions for Clang.
236
237 -gen-arm-mve-builtin-sema
238 Generate ARM MVE builtin sema checks for Clang.
239
240 -gen-arm-mve-builtin-codegen
241 Generate ARM MVE builtin code-generator for Clang.
242
243 -gen-arm-mve-builtin-aliases
244 Generate list of valid ARM MVE builtin aliases for Clang.
245
246 -gen-arm-cde-header
247 Generate arm_cde.h for Clang.
248
249 -gen-arm-cde-builtin-def
250 Generate ARM CDE builtin definitions for Clang.
251
252 -gen-arm-cde-builtin-sema
253 Generate ARM CDE builtin sema checks for Clang.
254
255 -gen-arm-cde-builtin-codegen
256 Generate ARM CDE builtin code-generator for Clang.
257
258 -gen-arm-cde-builtin-aliases
259 Generate list of valid ARM CDE builtin aliases for Clang.
260
261 -gen-riscv-vector-header
262 Generate riscv_vector.h for Clang.
263
264 -gen-riscv-vector-builtins
265 Generate riscv_vector_builtins.inc for Clang.
266
267 -gen-riscv-vector-builtin-codegen
268 Generate riscv_vector_builtin_cg.inc for Clang.
269
270 -gen-riscv-sifive-vector-builtins
271 Generate riscv_sifive_vector_builtins.inc for Clang.
272
273 -gen-riscv-sifive-vector-builtin-codegen
274 Generate riscv_sifive_vector_builtin_cg.inc for Clang.
275
276 -gen-attr-docs
277 Generate attribute documentation.
278
279 -gen-diag-docs
280 Generate diagnostic documentation.
281
282 -gen-opt-docs
283 Generate option documentation.
284
285 -gen-clang-data-collectors
286 Generate data collectors for AST nodes.
287
288 -gen-clang-test-pragma-attribute-supported-attributes
289 Generate a list of attributes supported by #pragma Clang attri‐
290 bute for testing purposes.
291
292 lldb-tblgen Options
293 gen-lldb-option-defs
294 Generate lldb OptionDefinition values.
295
296 gen-lldb-property-defs
297 Generate lldb PropertyDefinition values.
298
299 gen-lldb-property-enum-defs
300 Generate lldb PropertyDefinition enum values.
301
302 llvm-tblgen Options
303 -gen-asm-matcher
304 Generate assembly instruction matcher.
305
306 -match-prefix=prefix
307 Make -gen-asm-matcher match only instructions with the given
308 prefix.
309
310 -gen-asm-parser
311 Generate assembly instruction parser.
312
313 -asmparsernum=n
314 Make -gen-asm-parser emit assembly parser number n.
315
316 -gen-asm-writer
317 Generate assembly writer.
318
319 -asmwriternum=n
320 Make -gen-asm-writer emit assembly writer number n.
321
322 -gen-attrs
323 Generate attributes.
324
325 -gen-automata
326 Generate generic automata.
327
328 -gen-callingconv
329 Generate calling convention descriptions.
330
331 -gen-compress-inst-emitter
332 Generate RISC-V compressed instructions.
333
334 -gen-ctags
335 Generate ctags-compatible index.
336
337 -gen-dag-isel
338 Generate a DAG (directed acyclic graph) instruction selector.
339
340 -instrument-coverage
341 Make -gen-dag-isel generate tables to help identify the patterns
342 matched.
343
344 -omit-comments
345 Make -gen-dag-isel omit comments. The default is false.
346
347 -gen-dfa-packetizer
348 Generate DFA Packetizer for VLIW targets.
349
350 -gen-directive-decl
351 Generate directive related declaration code (header file).
352
353 -gen-directive-gen
354 Generate directive related implementation code part.
355
356 -gen-directive-impl
357 Generate directive related implementation code.
358
359 -gen-disassembler
360 Generate disassembler.
361
362 -gen-emitter
363 Generate machine code emitter.
364
365 -gen-exegesis
366 Generate llvm-exegesis tables.
367
368 -gen-fast-isel
369 Generate a "fast" instruction selector.
370
371 -gen-global-isel
372 Generate GlobalISel selector.
373
374 -gisel-coverage-file=filename
375 Specify the file from which to retrieve coverage information.
376
377 -instrument-gisel-coverage
378 Make -gen-global-isel generate coverage instrumentation.
379
380 -optimize-match-table
381 Make -gen-global-isel generate an optimized version of the match
382 table.
383
384 -warn-on-skipped-patterns
385 Make -gen-global-isel explain why a pattern was skipped for in‐
386 clusion.
387
388 -gen-global-isel-combiner
389 (Deprecated, pending removal) Generate legacy GlobalISel com‐
390 biner.
391
392 -gen-global-isel-combiner-matchtable
393 Generate MatchTable-based GlobalISel combiner.
394
395 -combiners=list
396 Make -gen-global-isel-combiner and -gen-global-isel-com‐
397 biner-matchtable emit the specified combiners.
398
399 -gicombiner-show-expansions
400 Make -gen-global-isel-combiner use C++ comments to indicate oc‐
401 currences of code expansion.
402
403 -gicombiner-stop-after-build
404 Make -gen-global-isel-combiner stop processing after building
405 the match tree.
406
407 -gicombiner-stop-after-parse
408 Make -gen-global-isel-combiner and -gen-global-isel-com‐
409 biner-matchtable stop processing after parsing rules and dump
410 state.
411
412 -gen-instr-info
413 Generate instruction descriptions.
414
415 -gen-instr-docs
416 Generate instruction documentation.
417
418 -gen-intrinsic-enums
419 Generate intrinsic enums.
420
421 -intrinsic-prefix=prefix
422 Make -gen-intrinsic-enums generate intrinsics with this target
423 prefix.
424
425 -gen-intrinsic-impl
426 Generate intrinsic information.
427
428 -gen-opt-parser-defs
429 Generate options definitions.
430
431 -gen-opt-rst
432 Generate option RST.
433
434 -gen-pseudo-lowering
435 Generate pseudo instruction lowering.
436
437 -gen-register-bank
438 Generate register bank descriptions.
439
440 -gen-register-info
441 Generate registers and register classes info.
442
443 -register-info-debug
444 Make -gen-register-info dump register information for debugging.
445
446 -gen-searchable-tables
447 Generate generic searchable tables. See TableGen BackEnds for a
448 detailed description.
449
450 -gen-subtarget
451 Generate subtarget enumerations.
452
453 -gen-x86-EVEX2VEX-tables
454 Generate X86 EVEX to VEX compress tables.
455
456 -gen-x86-fold-tables
457 Generate X86 fold tables.
458
459 -long-string-literals
460 When emitting large string tables, prefer string literals over
461 comma-separated char literals. This can be a readability and
462 compile-time performance win, but upsets some compilers.
463
464 -print-enums
465 Print enumeration values for a class.
466
467 -class=classname
468 Make -print-enums print the enumeration list for the specified
469 class.
470
471 -print-sets
472 Print expanded sets for testing DAG exprs.
473
474 mlir-tblgen Options
475 -gen-avail-interface-decls
476 Generate availability interface declarations.
477
478 -gen-avail-interface-defs
479 Generate op interface definitions.
480
481 -gen-dialect-doc
482 Generate dialect documentation.
483
484 -dialect
485 The dialect to generate.
486
487 -gen-directive-decl
488 Generate declarations for directives (OpenMP, etc.).
489
490 -gen-enum-decls
491 Generate enum utility declarations.
492
493 -gen-enum-defs
494 Generate enum utility definitions.
495
496 -gen-enum-from-llvmir-conversions
497 Generate conversions of EnumAttrs from LLVM IR.
498
499 -gen-enum-to-llvmir-conversions
500 Generate conversions of EnumAttrs to LLVM IR.
501
502 -gen-llvmir-conversions
503 Generate LLVM IR conversions.
504
505 -gen-llvmir-intrinsics
506 Generate LLVM IR intrinsics.
507
508 -llvmir-intrinsics-filter
509 Only keep the intrinsics with the specified substring in their
510 record name.
511
512 -dialect-opclass-base
513 The base class for the ops in the dialect we are to emit.
514
515 -gen-op-decls
516 Generate operation declarations.
517
518 -gen-op-defs
519 Generate operation definitions.
520
521 -asmformat-error-is-fatal
522 Emit a fatal error if format parsing fails.
523
524 -op-exclude-regex
525 Regular expression of name of ops to exclude (no filter if
526 empty).
527
528 -op-include-regex
529 Regular expression of name of ops to include (no filter if
530 empty).
531
532 -gen-op-doc
533 Generate operation documentation.
534
535 -gen-pass-decls
536 Generate operation documentation.
537
538 -name namestring
539 The name of this group of passes.
540
541 -gen-pass-doc
542 Generate pass documentation.
543
544 -gen-rewriters
545 Generate pattern rewriters.
546
547 -gen-spirv-avail-impls
548 Generate SPIR-V operation utility definitions.
549
550 -gen-spirv-capability-implication
551 Generate utility function to return implied capabilities for a
552 given capability.
553
554 -gen-spirv-enum-avail-decls
555 Generate SPIR-V enum availability declarations.
556
557 -gen-spirv-enum-avail-defs
558 Generate SPIR-V enum availability definitions.
559
560 -gen-spirv-op-utils
561 Generate SPIR-V operation utility definitions.
562
563 -gen-spirv-serialization
564 Generate SPIR-V (de)serialization utilities and functions.
565
566 -gen-struct-attr-decls
567 Generate struct utility declarations.
568
569 -gen-struct-attr-defs
570 Generate struct utility definitions.
571
572 -gen-typedef-decls
573 Generate TypeDef declarations.
574
575 -gen-typedef-defs
576 Generate TypeDef definitions.
577
578 -typedefs-dialect name
579 Generate types for this dialect.
580
582 If *-tblgen succeeds, it will exit with 0. Otherwise, if an error oc‐
583 curs, it will exit with a non-zero value.
584
586 Maintained by the LLVM Team (https://llvm.org/).
587
589 2003-2023, LLVM Project
590
591
592
593
59417 2023-11-28 TBLGEN(1)