Skip to content

Commit b46e78c

Browse files
sott0nftynse
authored andcommitted
[mlir][NFC] Cleanup Passes documentation
- Fix a place of NVGPU dialect's pass - Move a summary of `-finalize-memref-to-llvm` into description - Fix broken links - Replace back-quote dialect headers with single-quote headers for improved readability. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D142868
1 parent 115711c commit b46e78c

4 files changed

Lines changed: 37 additions & 31 deletions

File tree

mlir/docs/Passes.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,71 +16,75 @@ This document describes the available MLIR passes and their contracts.
1616

1717
[include "ConversionPasses.md"]
1818

19-
## `async` Dialect Passes
19+
## 'async' Dialect Passes
2020

2121
[include "AsyncPasses.md"]
2222

23-
## `affine` Dialect Passes
23+
## 'affine' Dialect Passes
2424

2525
[include "AffinePasses.md"]
2626

27-
## `arith` Dialect Passes
27+
## 'arith' Dialect Passes
2828

2929
[include "ArithPasses.md"]
3030

31-
## `func` Dialect Passes
31+
## 'func' Dialect Passes
3232

3333
[include "FuncPasses.md"]
3434

35-
## `gpu` Dialect Passes
35+
## 'gpu' Dialect Passes
3636

3737
[include "GPUPasses.md"]
3838

39-
## `linalg` Dialect Passes
39+
## 'linalg' Dialect Passes
4040

4141
[include "LinalgPasses.md"]
4242

43-
## `llvm` Dialect Passes
43+
## 'llvm' Dialect Passes
4444

4545
[include "LLVMPasses.md"]
4646

47-
## `memref` Dialect Passes
47+
## 'memref' Dialect Passes
4848

4949
[include "MemRefPasses.md"]
5050

51-
## `quant` Dialect Passes
51+
## 'nvgpu' Dialect Passes
52+
53+
[include "NVGPUPasses.md"]
54+
55+
## 'quant' Dialect Passes
5256

5357
[include "QuantPasses.md"]
5458

5559
## Reducer Passes
5660

5761
[include "ReducerPasses.md"]
5862

59-
## `scf` Dialect Passes
63+
## 'scf' Dialect Passes
6064

6165
[include "SCFPasses.md"]
6266

63-
## `shape` Dialect Passes
67+
## 'shape' Dialect Passes
6468

6569
[include "ShapePasses.md"]
6670

67-
## `sparse_tensor` Dialect Passes
71+
## 'sparse_tensor' Dialect Passes
6872

6973
[include "SparseTensorPasses.md"]
7074

71-
## `spv` Dialect Passes
75+
## 'spv' Dialect Passes
7276

7377
[include "SPIRVPasses.md"]
7478

75-
## `tensor` Dialect Passes
79+
## 'tensor' Dialect Passes
7680

7781
[include "TensorPasses.md"]
7882

79-
## `transform` Dialect Passes
83+
## 'transform' Dialect Passes
8084

8185
[include "TransformPasses.md"]
8286

83-
## `vector` Dialect Passes
87+
## 'vector' Dialect Passes
8488

8589
[include "VectorPasses.md"]
8690

mlir/include/mlir/Conversion/Passes.td

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -636,11 +636,14 @@ def ConvertMathToFuncs : Pass<"convert-math-to-funcs", "ModuleOp"> {
636636

637637
def FinalizeMemRefToLLVMConversionPass :
638638
Pass<"finalize-memref-to-llvm", "ModuleOp"> {
639-
let summary = "Finalize the conversion of the operations from the MemRef "
640-
"dialect to the LLVM dialect."
641-
"This conversion will not convert some complex MemRef "
642-
"operations. Make sure to run `expand-strided-metadata` "
643-
"beforehand for these.";
639+
let summary = "Finalize MemRef dialect to LLVM dialect conversion";
640+
let description = [{
641+
Finalize the conversion of the operations from the MemRef
642+
dialect to the LLVM dialect.
643+
This conversion will not convert some complex MemRef
644+
operations. Make sure to run `expand-strided-metadata`
645+
beforehand for these.
646+
}];
644647
let dependentDialects = ["LLVM::LLVMDialect"];
645648
let options = [
646649
Option<"useAlignedAlloc", "use-aligned-alloc", "bool", /*default=*/"false",

mlir/include/mlir/Dialect/MemRef/Transforms/Passes.td

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,17 @@ def NormalizeMemRefs : Pass<"normalize-memrefs", "ModuleOp"> {
4848
let summary = "Normalize memrefs";
4949
let description = [{
5050
This pass transforms memref types with a non-trivial
51-
[layout map](https://mlir.llvm.org/docs/LangRef/#layout-map) into
52-
memref types with an identity layout map, e.g. (i, j) -> (i, j). This
51+
[layout map](https://mlir.llvm.org/docs/Dialects/Builtin/#affine-map-layout)
52+
into memref types with an identity layout map, e.g. (i, j) -> (i, j). This
5353
pass is inter-procedural, in the sense that it can modify function
5454
interfaces and call sites that pass memref types. In order to modify
5555
memref types while preserving the original behavior, users of those
5656
memref types are also modified to incorporate the resulting layout map.
57-
For instance, an [AffineLoadOp]
58-
(https://mlir.llvm.org/docs/Dialects/Affine/#affineload-affineloadop)
57+
For instance, an [AffineLoadOp](https://mlir.llvm.org/docs/Dialects/Affine/#affineload-mliraffineloadop)
5958
will be updated to compose the layout map with with the affine expression
60-
contained in the op. Operations marked with the [MemRefsNormalizable]
61-
(https://mlir.llvm.org/docs/Traits/#memrefsnormalizable) trait are
62-
expected to be normalizable. Supported operations include affine
59+
contained in the op. Operations marked with the
60+
[MemRefsNormalizable](https://mlir.llvm.org/docs/Traits/#memrefsnormalizable)
61+
trait are expected to be normalizable. Supported operations include affine
6362
operations, memref.alloc, memref.dealloc, and func.return.
6463

6564
Given an appropriate layout map specified in the code, this transformation

mlir/include/mlir/Transforms/Passes.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def LocationSnapshot : Pass<"snapshot-op-locations"> {
133133
```
134134

135135
* If set, the new location is fused with the original location in the form
136-
of a [`Name Location`](Diagnostics.md#name-location) with the specified tag.
136+
of a [`Name Location`](Dialects/Builtin.md/#nameloc) with the specified tag.
137137

138138
Example:
139139

@@ -187,7 +187,7 @@ def StripDebugInfo : Pass<"strip-debuginfo"> {
187187
let summary = "Strip debug info from all operations";
188188
let description = [{
189189
This pass strips the IR of any location information, by replacing all
190-
operation locations with [`unknown`](Diagnostics.md#unknown-location).
190+
operation locations with [`unknown`](Dialects/Builtin.md/#unknownloc).
191191
}];
192192
let constructor = "mlir::createStripDebugInfoPass()";
193193
}
@@ -199,7 +199,7 @@ def SymbolDCE : Pass<"symbol-dce"> {
199199
by computing the set of operations that are known to be live, propagating
200200
that liveness to other symbols, and then deleting all symbols that are not
201201
within this live set. Live symbols are those that have a
202-
[visibility](SymbolsAndSymbolTables.md#symbol-visibility) that extends
202+
[visibility](SymbolsAndSymbolTables.md/#symbol-visibility) that extends
203203
beyond the IR, e.g. `public`, or those that are referenced by live symbols
204204
or other non-Symbol operations.
205205

0 commit comments

Comments
 (0)