Skip to content

[MLIR] Use applyOpPatternsGreedily instead of deprecated applyOpPatternsAndFold in documentation #127379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mlir/docs/PatternRewriter.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ This driver comes in two fashions:
* `applyPatternsGreedily` ("region-based driver") applies patterns to
all ops in a given region or a given container op (but not the container op
itself). I.e., the worklist is initialized with all containing ops.
* `applyOpPatternsAndFold` ("op-based driver") applies patterns to the
* `applyOpPatternsGreedily` ("op-based driver") applies patterns to the
provided list of operations. I.e., the worklist is initialized with the
specified list of ops.

Expand Down
6 changes: 3 additions & 3 deletions mlir/lib/Reducer/ReductionTreePass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ static void applyPatterns(Region &region,
opsInRange.push_back(&op.value());
}

// `applyOpPatternsAndFold` may erase the ops so we can't do the pattern
// `applyOpPatternsGreedily` may erase the ops so we can't do the pattern
// matching in above iteration. Besides, erase op not-in-range may end up in
// invalid module, so `applyOpPatternsAndFold` should come before that
// invalid module, so `applyOpPatternsGreedily` should come before that
// transform.
for (Operation *op : opsInRange) {
// `applyOpPatternsAndFold` returns whether the op is convered. Omit it
// `applyOpPatternsGreedily` returns whether the op is convered. Omit it
// because we don't have expectation this reduction will be success or not.
GreedyRewriteConfig config;
config.strictMode = GreedyRewriteStrictness::ExistingOps;
Expand Down