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