Skip to content

Commit f7a1347

Browse files
committed
[mlir][docs] Update/Add documentation for MLIRs Pattern Rewrite infrastructure
This infrastructure has evolved a lot over the course of MLIRs lifetime, and has never truly been documented outside of rationale or proposals. This revision aims to document the infrastructure and user facing API, with the rationale specific portions moved to the Rationale folder and updated. Differential Revision: https://reviews.llvm.org/D85260
1 parent fa4b314 commit f7a1347

File tree

6 files changed

+550
-423
lines changed

6 files changed

+550
-423
lines changed

mlir/docs/DialectConversion.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ target.markOpRecursivelyLegal<MyOp>([](MyOp op) { ... });
151151
## Rewrite Pattern Specification
152152

153153
After the conversion target has been defined, a set of legalization patterns
154-
must be provided to transform illegal operations into legal ones. The structure
155-
of the patterns supplied here is the same as those described in the
156-
[quickstart rewrites guide](Tutorials/QuickstartRewrites.md#adding-patterns).
157-
The patterns provided do not need to generate operations that are directly legal
158-
on the target. The framework will automatically build a graph of conversions to
159-
convert non-legal operations into a set of legal ones.
154+
must be provided to transform illegal operations into legal ones. The patterns
155+
supplied here have the same structure and restrictions as those described in the
156+
main [Pattern](PatternRewriter.md) documentation. The patterns provided do not
157+
need to generate operations that are directly legal on the target. The framework
158+
will automatically build a graph of conversions to convert non-legal operations
159+
into a set of legal ones.
160160

161161
As an example, say you define a target that supports one operation: `foo.add`.
162162
When providing the following patterns: [`bar.add` -> `baz.add`, `baz.add` ->

0 commit comments

Comments
 (0)