2020-04-12 05:49:03 +08:00
|
|
|
# Passes
|
2018-11-28 08:15:29 +08:00
|
|
|
|
|
|
|
This document describes the available MLIR passes and their contracts.
|
|
|
|
|
|
|
|
[TOC]
|
|
|
|
|
2020-04-01 16:51:50 +08:00
|
|
|
## General Transformation Passes
|
2018-11-28 08:15:29 +08:00
|
|
|
|
2020-04-01 16:51:50 +08:00
|
|
|
[include "GeneralPasses.md"]
|
2018-11-28 08:15:29 +08:00
|
|
|
|
2020-04-01 16:51:50 +08:00
|
|
|
## Conversion Passes
|
2018-11-28 08:15:29 +08:00
|
|
|
|
2020-04-01 16:51:50 +08:00
|
|
|
[include "ConversionPasses.md"]
|
2018-11-28 08:15:29 +08:00
|
|
|
|
2020-11-15 03:25:24 +08:00
|
|
|
## `async` Dialect Passes
|
|
|
|
|
|
|
|
[include "AsyncPasses.md"]
|
|
|
|
|
2020-04-01 16:51:50 +08:00
|
|
|
## `affine` Dialect Passes
|
2019-01-03 04:52:41 +08:00
|
|
|
|
2020-04-01 16:51:50 +08:00
|
|
|
[include "AffinePasses.md"]
|
2018-11-28 08:15:29 +08:00
|
|
|
|
2020-04-01 16:51:50 +08:00
|
|
|
## `gpu` Dialect Passes
|
2018-11-28 08:15:29 +08:00
|
|
|
|
2020-04-01 16:51:50 +08:00
|
|
|
[include "GPUPasses.md"]
|
Generic dialect conversion pass exercised by LLVM IR lowering
This commit introduces a generic dialect conversion/lowering/legalization pass
and illustrates it on StandardOps->LLVMIR conversion.
It partially reuses the PatternRewriter infrastructure and adds the following
functionality:
- an actual pass;
- non-default pattern constructors;
- one-to-many rewrites;
- rewriting terminators with successors;
- not applying patterns iteratively (unlike the existing greedy rewrite driver);
- ability to change function signature;
- ability to change basic block argument types.
The latter two things required, given the existing API, to create new functions
in the same module. Eventually, this should converge with the rest of
PatternRewriter. However, we may want to keep two pass versions: "heavy" with
function/block argument conversion and "light" that only touches operations.
This pass creates new functions within a module as a means to change function
signature, then creates new blocks with converted argument types in the new
function. Then, it traverses the CFG in DFS-preorder to make sure defs are
converted before uses in the dominated blocks. The generic pass has a minimal
interface with two hooks: one to fill in the set of patterns, and another one
to convert types for functions and blocks. The patterns are defined as
separate classes that can be table-generated in the future.
The LLVM IR lowering pass partially inherits from the existing LLVM IR
translator, in particular for type conversion. It defines a conversion pattern
template, instantiated for different operations, and is a good candidate for
tablegen. The lowering does not yet support loads and stores and is not
connected to the translator as it would have broken the existing flows. Future
patches will add missing support before switching the translator in a single
patch.
PiperOrigin-RevId: 230951202
2019-01-26 04:46:53 +08:00
|
|
|
|
2020-04-01 16:51:50 +08:00
|
|
|
## `linalg` Dialect Passes
|
Generic dialect conversion pass exercised by LLVM IR lowering
This commit introduces a generic dialect conversion/lowering/legalization pass
and illustrates it on StandardOps->LLVMIR conversion.
It partially reuses the PatternRewriter infrastructure and adds the following
functionality:
- an actual pass;
- non-default pattern constructors;
- one-to-many rewrites;
- rewriting terminators with successors;
- not applying patterns iteratively (unlike the existing greedy rewrite driver);
- ability to change function signature;
- ability to change basic block argument types.
The latter two things required, given the existing API, to create new functions
in the same module. Eventually, this should converge with the rest of
PatternRewriter. However, we may want to keep two pass versions: "heavy" with
function/block argument conversion and "light" that only touches operations.
This pass creates new functions within a module as a means to change function
signature, then creates new blocks with converted argument types in the new
function. Then, it traverses the CFG in DFS-preorder to make sure defs are
converted before uses in the dominated blocks. The generic pass has a minimal
interface with two hooks: one to fill in the set of patterns, and another one
to convert types for functions and blocks. The patterns are defined as
separate classes that can be table-generated in the future.
The LLVM IR lowering pass partially inherits from the existing LLVM IR
translator, in particular for type conversion. It defines a conversion pattern
template, instantiated for different operations, and is a good candidate for
tablegen. The lowering does not yet support loads and stores and is not
connected to the translator as it would have broken the existing flows. Future
patches will add missing support before switching the translator in a single
patch.
PiperOrigin-RevId: 230951202
2019-01-26 04:46:53 +08:00
|
|
|
|
2020-04-01 16:51:50 +08:00
|
|
|
[include "LinalgPasses.md"]
|
Generic dialect conversion pass exercised by LLVM IR lowering
This commit introduces a generic dialect conversion/lowering/legalization pass
and illustrates it on StandardOps->LLVMIR conversion.
It partially reuses the PatternRewriter infrastructure and adds the following
functionality:
- an actual pass;
- non-default pattern constructors;
- one-to-many rewrites;
- rewriting terminators with successors;
- not applying patterns iteratively (unlike the existing greedy rewrite driver);
- ability to change function signature;
- ability to change basic block argument types.
The latter two things required, given the existing API, to create new functions
in the same module. Eventually, this should converge with the rest of
PatternRewriter. However, we may want to keep two pass versions: "heavy" with
function/block argument conversion and "light" that only touches operations.
This pass creates new functions within a module as a means to change function
signature, then creates new blocks with converted argument types in the new
function. Then, it traverses the CFG in DFS-preorder to make sure defs are
converted before uses in the dominated blocks. The generic pass has a minimal
interface with two hooks: one to fill in the set of patterns, and another one
to convert types for functions and blocks. The patterns are defined as
separate classes that can be table-generated in the future.
The LLVM IR lowering pass partially inherits from the existing LLVM IR
translator, in particular for type conversion. It defines a conversion pattern
template, instantiated for different operations, and is a good candidate for
tablegen. The lowering does not yet support loads and stores and is not
connected to the translator as it would have broken the existing flows. Future
patches will add missing support before switching the translator in a single
patch.
PiperOrigin-RevId: 230951202
2019-01-26 04:46:53 +08:00
|
|
|
|
2020-04-01 16:51:50 +08:00
|
|
|
## `llvm` Dialect Passes
|
Generic dialect conversion pass exercised by LLVM IR lowering
This commit introduces a generic dialect conversion/lowering/legalization pass
and illustrates it on StandardOps->LLVMIR conversion.
It partially reuses the PatternRewriter infrastructure and adds the following
functionality:
- an actual pass;
- non-default pattern constructors;
- one-to-many rewrites;
- rewriting terminators with successors;
- not applying patterns iteratively (unlike the existing greedy rewrite driver);
- ability to change function signature;
- ability to change basic block argument types.
The latter two things required, given the existing API, to create new functions
in the same module. Eventually, this should converge with the rest of
PatternRewriter. However, we may want to keep two pass versions: "heavy" with
function/block argument conversion and "light" that only touches operations.
This pass creates new functions within a module as a means to change function
signature, then creates new blocks with converted argument types in the new
function. Then, it traverses the CFG in DFS-preorder to make sure defs are
converted before uses in the dominated blocks. The generic pass has a minimal
interface with two hooks: one to fill in the set of patterns, and another one
to convert types for functions and blocks. The patterns are defined as
separate classes that can be table-generated in the future.
The LLVM IR lowering pass partially inherits from the existing LLVM IR
translator, in particular for type conversion. It defines a conversion pattern
template, instantiated for different operations, and is a good candidate for
tablegen. The lowering does not yet support loads and stores and is not
connected to the translator as it would have broken the existing flows. Future
patches will add missing support before switching the translator in a single
patch.
PiperOrigin-RevId: 230951202
2019-01-26 04:46:53 +08:00
|
|
|
|
2020-04-01 16:51:50 +08:00
|
|
|
[include "LLVMPasses.md"]
|
Generic dialect conversion pass exercised by LLVM IR lowering
This commit introduces a generic dialect conversion/lowering/legalization pass
and illustrates it on StandardOps->LLVMIR conversion.
It partially reuses the PatternRewriter infrastructure and adds the following
functionality:
- an actual pass;
- non-default pattern constructors;
- one-to-many rewrites;
- rewriting terminators with successors;
- not applying patterns iteratively (unlike the existing greedy rewrite driver);
- ability to change function signature;
- ability to change basic block argument types.
The latter two things required, given the existing API, to create new functions
in the same module. Eventually, this should converge with the rest of
PatternRewriter. However, we may want to keep two pass versions: "heavy" with
function/block argument conversion and "light" that only touches operations.
This pass creates new functions within a module as a means to change function
signature, then creates new blocks with converted argument types in the new
function. Then, it traverses the CFG in DFS-preorder to make sure defs are
converted before uses in the dominated blocks. The generic pass has a minimal
interface with two hooks: one to fill in the set of patterns, and another one
to convert types for functions and blocks. The patterns are defined as
separate classes that can be table-generated in the future.
The LLVM IR lowering pass partially inherits from the existing LLVM IR
translator, in particular for type conversion. It defines a conversion pattern
template, instantiated for different operations, and is a good candidate for
tablegen. The lowering does not yet support loads and stores and is not
connected to the translator as it would have broken the existing flows. Future
patches will add missing support before switching the translator in a single
patch.
PiperOrigin-RevId: 230951202
2019-01-26 04:46:53 +08:00
|
|
|
|
2020-04-01 16:51:50 +08:00
|
|
|
## `quant` Dialect Passes
|
2019-02-20 02:26:53 +08:00
|
|
|
|
2020-04-01 16:51:50 +08:00
|
|
|
[include "QuantPasses.md"]
|
2019-02-20 02:26:53 +08:00
|
|
|
|
2020-09-26 23:47:25 +08:00
|
|
|
## Reducer Passes
|
|
|
|
|
|
|
|
[include "ReducerPasses.md"]
|
|
|
|
|
|
|
|
## `scf` Dialect Passes
|
|
|
|
|
2020-09-27 00:18:35 +08:00
|
|
|
[include "SCFPasses.md"]
|
2020-09-26 23:47:25 +08:00
|
|
|
|
2020-06-08 18:14:19 +08:00
|
|
|
## `shape` Dialect Passes
|
|
|
|
|
|
|
|
[include "ShapePasses.md"]
|
|
|
|
|
2020-04-01 16:51:50 +08:00
|
|
|
## `spv` Dialect Passes
|
2019-02-20 02:26:53 +08:00
|
|
|
|
2020-04-01 16:51:50 +08:00
|
|
|
[include "SPIRVPasses.md"]
|
2020-05-05 14:30:30 +08:00
|
|
|
|
|
|
|
## `standard` Dialect Passes
|
|
|
|
|
|
|
|
[include "StandardPasses.md"]
|
2020-11-15 03:25:24 +08:00
|
|
|
|
2020-12-24 08:13:03 +08:00
|
|
|
## `tensor` Dialect Passes
|
|
|
|
|
|
|
|
[include "TensorPasses.md"]
|
|
|
|
|
2020-11-15 03:25:24 +08:00
|
|
|
## TOSA Dialect Passes
|
|
|
|
|
|
|
|
[include "TosaPasses.md"]
|