MLIR  20.0.0git
Public Attributes | Static Public Attributes | List of all members
mlir::GreedyRewriteConfig Class Reference

This class allows control over how the GreedyPatternRewriteDriver works. More...

#include "mlir/Transforms/GreedyPatternRewriteDriver.h"

Public Attributes

bool useTopDownTraversal = false
 This specifies the order of initial traversal that populates the rewriters worklist. More...
 
GreedySimplifyRegionLevel enableRegionSimplification
 Perform control flow optimizations to the region tree after applying all patterns. More...
 
int64_t maxIterations = 10
 This specifies the maximum number of times the rewriter will iterate between applying patterns and simplifying regions. More...
 
int64_t maxNumRewrites = kNoLimit
 This specifies the maximum number of rewrites within an iteration. More...
 
Regionscope = nullptr
 Only ops within the scope are added to the worklist. More...
 
GreedyRewriteStrictness strictMode = GreedyRewriteStrictness::AnyOp
 Strict mode can restrict the ops that are added to the worklist during the rewrite. More...
 
RewriterBase::Listenerlistener = nullptr
 An optional listener that should be notified about IR modifications. More...
 

Static Public Attributes

static constexpr int64_t kNoLimit = -1
 

Detailed Description

This class allows control over how the GreedyPatternRewriteDriver works.

Definition at line 43 of file GreedyPatternRewriteDriver.h.

Member Data Documentation

◆ enableRegionSimplification

GreedySimplifyRegionLevel mlir::GreedyRewriteConfig::enableRegionSimplification
Initial value:

Perform control flow optimizations to the region tree after applying all patterns.

Note: Only applicable when simplifying entire regions.

Definition at line 58 of file GreedyPatternRewriteDriver.h.

◆ kNoLimit

constexpr int64_t mlir::GreedyRewriteConfig::kNoLimit = -1
staticconstexpr

Definition at line 72 of file GreedyPatternRewriteDriver.h.

◆ listener

RewriterBase::Listener* mlir::GreedyRewriteConfig::listener = nullptr

An optional listener that should be notified about IR modifications.

Definition at line 93 of file GreedyPatternRewriteDriver.h.

◆ maxIterations

int64_t mlir::GreedyRewriteConfig::maxIterations = 10

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 66 of file GreedyPatternRewriteDriver.h.

Referenced by mlir::applyPatternsAndFoldGreedily().

◆ maxNumRewrites

int64_t mlir::GreedyRewriteConfig::maxNumRewrites = kNoLimit

This specifies the maximum number of rewrites within an iteration.

Use kNoLimit to disable this limit.

Definition at line 70 of file GreedyPatternRewriteDriver.h.

Referenced by mlir::applyOpPatternsAndFold().

◆ scope

Region* mlir::GreedyRewriteConfig::scope = nullptr

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.

Definition at line 78 of file GreedyPatternRewriteDriver.h.

Referenced by mlir::applyOpPatternsAndFold(), and mlir::applyPatternsAndFoldGreedily().

◆ strictMode

GreedyRewriteStrictness mlir::GreedyRewriteConfig::strictMode = GreedyRewriteStrictness::AnyOp

Strict mode can restrict the ops that are added to the worklist during the rewrite.

Definition at line 90 of file GreedyPatternRewriteDriver.h.

Referenced by mlir::affine::affineForOpBodySkew(), applyPatterns(), mlir::affine::hoistAffineIfOp(), and mlir::spirv::unrollVectorsInSignatures().

◆ useTopDownTraversal

bool mlir::GreedyRewriteConfig::useTopDownTraversal = false

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.


The documentation for this class was generated from the following file: