llvm-project/mlir/docs
River Riddle 2d0477a003 [mlir][DeclarativeParser] Add basic support for optional groups in the assembly format.
When operations have optional attributes, or optional operands(i.e. empty variadic operands), the assembly format often has an optional section to represent these arguments. This revision adds basic support for defining an "optional group" in the assembly format to support this. An optional group is defined by wrapping a set of elements in `()` followed by `?` and requires the following:

* The first element of the group must be either a literal or an operand argument.
  - This is because the first element must be optionally parsable.
* There must be exactly one argument variable within the group that is marked as the anchor of the group. The anchor is the element whose presence controls whether the group should be printed/parsed. An element is marked as the anchor by adding a trailing `^`.
* The group must only contain literals, variables, and type directives.
  - Any attribute variables may be used, but only optional attributes can be marked as the anchor.
  - Only variadic, i.e. optional, operand arguments can be used.
  - The elements of a type directive must be defined within the same optional group.

An example of this can be seen with the assembly format for ReturnOp, which has a variadic number of operands.

```
def ReturnOp : ... {
  let arguments = (ins Variadic<AnyType>:$operands);

  // We only print the operands+types if there are a non-zero number
  // of operands.
  let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?";
}
```

Differential Revision: https://reviews.llvm.org/D74681
2020-02-21 15:15:31 -08:00
..
Dialects [mlir] Fix multiple titles 2020-02-17 13:55:46 -08:00
Tutorials/Toy Fix some typos in the MLIR documentation. 2020-02-20 11:09:28 -08:00
includes/img Adjust some MLIR paths and docs 2019-12-24 02:23:01 +00:00
CMakeLists.txt [mlir] Bootstrap doxygen config 2020-01-25 09:31:59 -08:00
Canonicalization.md Adjust some MLIR paths and docs 2019-12-24 02:23:01 +00:00
ConversionToLLVMDialect.md [mlir] use unpacked memref descriptors at function boundaries 2020-02-10 15:03:43 +01:00
DeclarativeRewrites.md NFC: add indexing operator for ArrayAttr 2020-02-14 22:54:37 -08:00
DefiningAttributesAndTypes.md [mlir] Refactor the structure of the 'verifyConstructionInvariants' methods. 2020-02-20 10:37:52 -08:00
Diagnostics.md fix doc grammar-o to cycle bots 2020-01-02 12:11:59 -05:00
DialectConversion.md [mlir] Refactor TypeConverter to add conversions without inheritance 2020-02-18 16:17:48 -08:00
EDSC.md [mlir][EDSC] Almost NFC - Refactor and untangle EDSC dependencies 2020-02-10 12:10:41 -05:00
GenericDAGRewriter.md Adjust some MLIR paths and docs 2019-12-24 02:23:01 +00:00
Interfaces.md Adjust some MLIR paths and docs 2019-12-24 02:23:01 +00:00
LangRef.md [mlir] Add a signedness semantics bit to IntegerType 2020-02-21 09:16:54 -05:00
MLIRForGraphAlgorithms.md Adjust some MLIR paths and docs 2019-12-24 02:23:01 +00:00
OpDefinitions.md [mlir][DeclarativeParser] Add basic support for optional groups in the assembly format. 2020-02-21 15:15:31 -08:00
Passes.md Adjust some MLIR paths and docs 2019-12-24 02:23:01 +00:00
Quantization.md Adjust some MLIR paths and docs 2019-12-24 02:23:01 +00:00
QuickstartRewrites.md [mlir] NFC: Remove Value::operator* and Value::operator-> now that Value is properly value-typed. 2020-01-11 08:54:39 -08:00
README.txt [mlir] Add short readme.txt to docs directory 2020-02-18 08:35:22 -08:00
Rationale.md [mlir] Add a signedness semantics bit to IntegerType 2020-02-21 09:16:54 -05:00
RationaleLinalgDialect.md [mlir] Fix multiple titles 2020-02-17 13:55:46 -08:00
RationaleSimplifiedPolyhedralForm.md [mlir] Make code blocks more consistent 2019-12-31 09:54:16 -08:00
ShapeInference.md [mlir] Expand shape functions in ShapeInference doc 2020-02-01 14:44:38 -08:00
SymbolsAndSymbolTables.md [mlir] Address post commit feedback of D73590 for SymbolsAndSymbolTables.md 2020-02-16 21:07:20 -08:00
Traits.md [mlir] Add a document detailing the design of the SymbolTable. 2020-02-08 10:40:07 -08:00
UsageOfConst.md Adjust some MLIR paths and docs 2019-12-24 02:23:01 +00:00
WritingAPass.md Fix some typos in the MLIR documentation. 2020-02-20 11:09:28 -08:00
doxygen-mainpage.dox [mlir] Bootstrap doxygen config 2020-01-25 09:31:59 -08:00
doxygen.cfg.in [mlir] Bootstrap doxygen config 2020-01-25 09:31:59 -08: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.