Skip to content

Commit 4e41e9a

Browse files
authored
[mlir] Update docs for Greedy Pattern Rewrite Driver(NFC) (#126701)
The `applyOpPatternsAndFold` is deprecated, use `applyOpPatternsGreedily` instead.
1 parent 18ea6c9 commit 4e41e9a

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

mlir/docs/PatternRewriter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ This driver comes in two fashions:
361361
* `applyPatternsGreedily` ("region-based driver") applies patterns to
362362
all ops in a given region or a given container op (but not the container op
363363
itself). I.e., the worklist is initialized with all containing ops.
364-
* `applyOpPatternsAndFold` ("op-based driver") applies patterns to the
364+
* `applyOpPatternsGreedily` ("op-based driver") applies patterns to the
365365
provided list of operations. I.e., the worklist is initialized with the
366366
specified list of ops.
367367

mlir/lib/Reducer/ReductionTreePass.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,14 @@ static void applyPatterns(Region &region,
5656
opsInRange.push_back(&op.value());
5757
}
5858

59-
// `applyOpPatternsAndFold` may erase the ops so we can't do the pattern
60-
// matching in above iteration. Besides, erase op not-in-range may end up in
61-
// invalid module, so `applyOpPatternsAndFold` should come before that
62-
// transform.
59+
// `applyOpPatternsGreedily` with folding may erase the ops so we can't do the
60+
// pattern matching in above iteration. Besides, erase op not-in-range may end
61+
// up in invalid module, so `applyOpPatternsGreedily` with folding should come
62+
// before that transform.
6363
for (Operation *op : opsInRange) {
64-
// `applyOpPatternsAndFold` returns whether the op is convered. Omit it
65-
// because we don't have expectation this reduction will be success or not.
64+
// `applyOpPatternsGreedily` with folding returns whether the op is
65+
// convered. Omit it because we don't have expectation this reduction will
66+
// be success or not.
6667
GreedyRewriteConfig config;
6768
config.strictMode = GreedyRewriteStrictness::ExistingOps;
6869
(void)applyOpPatternsGreedily(op, patterns, config);

0 commit comments

Comments
 (0)