llvm/mlir/docs
River Riddle ea64828a10 [mlir:PDL] Expand how native constraint/rewrite functions can be defined
This commit refactors the expected form of native constraint and rewrite
functions, and greatly reduces the necessary user complexity required when
defining a native function. Namely, this commit adds in automatic processing
of the necessary PDLValue glue code, and allows for users to define
constraint/rewrite functions using the C++ types that they actually want to
use.

As an example, lets see a simple example rewrite defined today:

```
static void rewriteFn(PatternRewriter &rewriter, PDLResultList &results,
                      ArrayRef<PDLValue> args) {
  ValueRange operandValues = args[0].cast<ValueRange>();
  TypeRange typeValues = args[1].cast<TypeRange>();
  ...
  // Create an operation at some point and pass it back to PDL.
  Operation *op = rewriter.create<SomeOp>(...);
  results.push_back(op);
}
```

After this commit, that same rewrite could be defined as:

```
static Operation *rewriteFn(PatternRewriter &rewriter ValueRange operandValues,
                            TypeRange typeValues) {
  ...
  // Create an operation at some point and pass it back to PDL.
  return rewriter.create<SomeOp>(...);
}
```

Differential Revision: https://reviews.llvm.org/D122086
2022-04-06 17:41:59 -07:00
..
Bindings [mlir:FunctionOpInterface] Rename the "type" attribute to "function_type" 2022-03-16 17:07:04 -07:00
Dialects [mlir][emitc] Adapt to move of FuncOp 2022-03-28 17:44:47 +02:00
includes/img
Rationale
Tools
Tutorials [mlir] Rename OpAsmParser::OperandType to OpAsmParser::UnresolvedOperand 2022-03-21 21:42:13 +01:00
AttributesAndTypes.md [mlir] Rewrite and modernize the documentation for defining Attributes/Types 2022-03-15 00:19:52 -07:00
BufferDeallocationInternals.md
Bufferization.md [mlir][bufferize] Update documentation with allow-return-allocs 2022-03-16 23:30:09 +09:00
Canonicalization.md
CAPI.md
CMakeLists.txt
DataLayout.md
DebugActions.md
DeclarativeRewrites.md
Diagnostics.md
DialectConversion.md
doxygen-mainpage.dox
doxygen.cfg.in
Interfaces.md
LangRef.md [MLIR] Add nested symbols into LangRef 2022-04-04 22:06:19 +05:30
OpDefinitions.md [mlir][ods] Add Deprecate helper 2022-03-22 11:08:36 -07:00
Passes.md
PassManagement.md [mlir:PassOption] Rework ListOption parsing and add support for std::vector/SmallVector options 2022-04-02 00:45:11 -07:00
PatternRewriter.md [mlir:PassOption] Rework ListOption parsing and add support for std::vector/SmallVector options 2022-04-02 00:45:11 -07:00
PDLL.md [mlir:PDL] Expand how native constraint/rewrite functions can be defined 2022-04-06 17:41:59 -07:00
Quantization.md
README.txt
ShapeInference.md
SPIRVToLLVMDialectConversion.md
SymbolsAndSymbolTables.md [mlir] Move the Builtin FuncOp to the Func dialect 2022-03-16 17:07:03 -07:00
TargetLLVMIR.md [mlir] Move the Builtin FuncOp to the Func dialect 2022-03-16 17:07:03 -07:00
Traits.md

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.