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