llvm-project/mlir/docs
Jeff Niu 9a2fdc369d [MLIR] Attribute and type formats in ODS
Declarative attribute and type formats with assembly formats. Define an
`assemblyFormat` field in attribute and type defs with a `mnemonic` to
generate a parser and printer.

```tablegen
def MyAttr : AttrDef<MyDialect, "MyAttr"> {
  let parameters = (ins "int64_t":$count, "AffineMap":$map);
  let mnemonic = "my_attr";
  let assemblyFormat = "`<` $count `,` $map `>`";
}
```

Use `struct` to define a comma-separated list of key-value pairs:

```tablegen
def MyType : TypeDef<MyDialect, "MyType"> {
  let parameters = (ins "int":$one, "int":$two, "int":$three);
  let mnemonic = "my_attr";
  let assemblyFormat = "`<` $three `:` struct($one, $two) `>`";
}
```

Use `struct(*)` to capture all parameters.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D111594
2021-11-08 17:38:28 +00:00
..
Bindings [mlir][docs] Fix obvious spelling mistakes in documentation 2021-10-29 09:19:11 +02:00
Dialects [NFC] Inclusive language: Remove instances of master in URLs 2021-11-05 08:48:41 -05:00
Rationale [NFC] Inclusive language: Remove instances of master in URLs 2021-11-05 08:48:41 -05:00
Tools [mlir][docs] Fix obvious spelling mistakes in documentation 2021-10-29 09:19:11 +02:00
Tutorials [MLIR] Attribute and type formats in ODS 2021-11-08 17:38:28 +00:00
includes/img [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
BufferDeallocationInternals.md [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
Bufferization.md [MLIR][arith] fix references to std.constant in comments 2021-10-14 20:38:47 +00:00
CAPI.md [mlir] support interfaces in Python bindings 2021-10-25 12:50:42 +02:00
CMakeLists.txt Remove CMake configuration for Sphinx targets in MLIR 2020-03-12 01:28:38 +00:00
Canonicalization.md [mlir][doc] Fix links and references in top level docs directory 2021-05-24 18:43:00 +02:00
DataLayout.md [mlir][docs] Fix obvious spelling mistakes in documentation 2021-10-29 09:19:11 +02:00
DebugActions.md [mlir][doc] Fix links and references in top level docs directory 2021-05-24 18:43:00 +02:00
DeclarativeRewrites.md [mlir][docs] Fix obvious spelling mistakes in documentation 2021-10-29 09:19:11 +02:00
Diagnostics.md [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
DialectConversion.md [MLIR][arith] fix references to std.constant in comments 2021-10-14 20:38:47 +00:00
Interfaces.md [mlir] Fix attachInterface typo 2021-08-24 15:17:52 -07:00
LangRef.md [NFC] Inclusive language: Remove instances of master in URLs 2021-11-05 08:48:41 -05:00
OpDefinitions.md [mlir][ODS] Support result type inference in custom assembly format 2021-10-11 14:07:56 -06:00
PassManagement.md [MLIR][arith] fix references to std.constant in comments 2021-10-14 20:38:47 +00:00
Passes.md [MLIR][arith] fix references to std.constant in comments 2021-10-14 20:38:47 +00:00
PatternRewriter.md [mlir:GreedyPatternRewriter] Add debug logging for pattern rewriter actions 2021-10-21 17:14:35 +00:00
Quantization.md Fix invalid math formulas in quantization doc 2021-06-01 03:50:59 +00:00
README.txt [mlir] Add short readme.txt to docs directory 2020-02-18 08:35:22 -08:00
SPIRVToLLVMDialectConversion.md [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
ShapeInference.md [mlir][docs] Fix obvious spelling mistakes in documentation 2021-10-29 09:19:11 +02:00
SymbolsAndSymbolTables.md [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
TargetLLVMIR.md [mlir][docs] Fix obvious spelling mistakes in documentation 2021-10-29 09:19:11 +02:00
Traits.md [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
doxygen-mainpage.dox [mlir] Bootstrap doxygen config 2020-01-25 09:31:59 -08:00
doxygen.cfg.in [NFC] Inclusive Language: change master to main for .chm files 2021-11-08 08:23:04 -06:00

README.txt

MLIR documentation
==================

Please note mlir.llvm.org is where MLIR's rendered documentation is displayed.
The viewing experience on GitHub or elsewhere may not match those of the
website. For any changes please verify instead that they work on the main
website first.

See https://github.com/llvm/mlir-www for the website generation information.