|
MLIR 23.0.0git
|
This class allows control over how the GreedyPatternRewriteDriver works. More...
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
Public Member Functions | |
| bool | getUseTopDownTraversal () const |
| This specifies the order of initial traversal that populates the rewriters worklist. | |
| GreedyRewriteConfig & | setUseTopDownTraversal (bool use=true) |
| GreedySimplifyRegionLevel | getRegionSimplificationLevel () const |
| Perform control flow optimizations to the region tree after applying all patterns. | |
| GreedyRewriteConfig & | setRegionSimplificationLevel (GreedySimplifyRegionLevel level) |
| int64_t | getMaxIterations () const |
| This specifies the maximum number of times the rewriter will iterate between applying patterns and simplifying regions. | |
| GreedyRewriteConfig & | setMaxIterations (int64_t iterations) |
| int64_t | getMaxNumRewrites () const |
| This specifies the maximum number of rewrites within an iteration. | |
| GreedyRewriteConfig & | setMaxNumRewrites (int64_t limit) |
| Region * | getScope () const |
| Only ops within the scope are added to the worklist. | |
| GreedyRewriteConfig & | setScope (Region *scope) |
| GreedyRewriteStrictness | getStrictness () const |
| Strict mode can restrict the ops that are added to the worklist during the rewrite. | |
| GreedyRewriteConfig & | setStrictness (GreedyRewriteStrictness mode) |
| RewriterBase::Listener * | getListener () const |
| An optional listener that should be notified about IR modifications. | |
| GreedyRewriteConfig & | setListener (RewriterBase::Listener *listener) |
| bool | isFoldingEnabled () const |
| Whether this should fold while greedily rewriting. | |
| GreedyRewriteConfig & | enableFolding (bool enable=true) |
| bool | isConstantCSEEnabled () const |
| If set to "true", constants are CSE'd (even across multiple regions that are in a parent-ancestor relationship). | |
| GreedyRewriteConfig & | enableConstantCSE (bool enable=true) |
| bool | isCSEBetweenIterationsEnabled () const |
| If set to "true", full common-subexpression elimination is run on the scoped region between each pattern-application iteration. | |
| GreedyRewriteConfig & | enableCSEBetweenIterations (bool enable=true) |
Static Public Attributes | |
| static constexpr int64_t | kNoLimit = -1 |
This class allows control over how the GreedyPatternRewriteDriver works.
Definition at line 43 of file GreedyPatternRewriteDriver.h.
|
inline |
Definition at line 136 of file GreedyPatternRewriteDriver.h.
Referenced by mlirGreedyRewriteDriverConfigEnableConstantCSE().
|
inline |
Definition at line 159 of file GreedyPatternRewriteDriver.h.
|
inline |
Definition at line 128 of file GreedyPatternRewriteDriver.h.
Referenced by mlirGreedyRewriteDriverConfigEnableFolding().
|
inline |
An optional listener that should be notified about IR modifications.
Definition at line 120 of file GreedyPatternRewriteDriver.h.
|
inline |
This specifies the maximum number of times the rewriter will iterate between applying patterns and simplifying regions.
Use kNoLimit to disable this iteration limit.
Note: Only applicable when simplifying entire regions.
Definition at line 76 of file GreedyPatternRewriteDriver.h.
Referenced by mlir::applyPatternsGreedily(), and mlirGreedyRewriteDriverConfigGetMaxIterations().
|
inline |
This specifies the maximum number of rewrites within an iteration.
Use kNoLimit to disable this limit.
Definition at line 84 of file GreedyPatternRewriteDriver.h.
Referenced by mlir::applyOpPatternsGreedily(), and mlirGreedyRewriteDriverConfigGetMaxNumRewrites().
|
inline |
Perform control flow optimizations to the region tree after applying all patterns.
Note: Only applicable when simplifying entire regions.
Definition at line 62 of file GreedyPatternRewriteDriver.h.
Referenced by mlirGreedyRewriteDriverConfigGetRegionSimplificationLevel().
|
inline |
Only ops within the scope are added to the worklist.
If no scope is specified, the closest enclosing region around the initial list of ops (or the specified region, depending on which greedy rewrite entry point is used) is used as a scope. Any region being simplified must be enclosed by the scope (or equal to it).
Definition at line 97 of file GreedyPatternRewriteDriver.h.
Referenced by mlir::applyOpPatternsGreedily(), and mlir::applyPatternsGreedily().
|
inline |
Strict mode can restrict the ops that are added to the worklist during the rewrite.
Definition at line 113 of file GreedyPatternRewriteDriver.h.
Referenced by mlirGreedyRewriteDriverConfigGetStrictness().
|
inline |
This specifies the order of initial traversal that populates the rewriters worklist.
When set to true, it walks the operations top-down, which is generally more efficient in compile time. When set to false, its initial traversal of the region tree is bottom up on each block, which may match larger patterns when given an ambiguous pattern set.
Note: Only applicable when simplifying entire regions.
Definition at line 52 of file GreedyPatternRewriteDriver.h.
Referenced by mlirGreedyRewriteDriverConfigGetUseTopDownTraversal().
|
inline |
If set to "true", constants are CSE'd (even across multiple regions that are in a parent-ancestor relationship).
Definition at line 135 of file GreedyPatternRewriteDriver.h.
Referenced by mlirGreedyRewriteDriverConfigIsConstantCSEEnabled().
|
inline |
If set to "true", full common-subexpression elimination is run on the scoped region between each pattern-application iteration.
Unlike cseConstants (which only deduplicates constant ops via the operation folder) this runs the standard CSE algorithm and can unblock further canonicalizations on the next iteration. Off by default because it rebuilds dominance info each iteration.
Caveats when enabling this option:
Definition at line 158 of file GreedyPatternRewriteDriver.h.
|
inline |
Whether this should fold while greedily rewriting.
Definition at line 127 of file GreedyPatternRewriteDriver.h.
Referenced by mlirGreedyRewriteDriverConfigIsFoldingEnabled().
|
inline |
Definition at line 121 of file GreedyPatternRewriteDriver.h.
|
inline |
Definition at line 77 of file GreedyPatternRewriteDriver.h.
Referenced by mlirGreedyRewriteDriverConfigSetMaxIterations().
|
inline |
Definition at line 85 of file GreedyPatternRewriteDriver.h.
Referenced by mlirGreedyRewriteDriverConfigSetMaxNumRewrites().
|
inline |
Definition at line 66 of file GreedyPatternRewriteDriver.h.
Referenced by mlirGreedyRewriteDriverConfigSetRegionSimplificationLevel().
|
inline |
Definition at line 98 of file GreedyPatternRewriteDriver.h.
Referenced by mlir::applyOpPatternsGreedily(), and mlir::applyPatternsGreedily().
|
inline |
Definition at line 114 of file GreedyPatternRewriteDriver.h.
Referenced by mlirGreedyRewriteDriverConfigSetStrictness(), and mlir::affine::simplifyAffineMinMaxOps().
|
inline |
Definition at line 53 of file GreedyPatternRewriteDriver.h.
Referenced by mlirGreedyRewriteDriverConfigSetUseTopDownTraversal().
|
staticconstexpr |
Definition at line 90 of file GreedyPatternRewriteDriver.h.