Skip to content

Commit 7d7aeda

Browse files
committed
Update callsites & comment
1 parent 1933c8b commit 7d7aeda

File tree

101 files changed

+211
-227
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+211
-227
lines changed

mlir/docs/PatternRewriter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ which point the driver finishes.
358358

359359
This driver comes in two fashions:
360360

361-
* `applyPatternsAndFoldGreedily` ("region-based driver") applies patterns to
361+
* `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.
364364
* `applyOpPatternsAndFold` ("op-based driver") applies patterns to the

mlir/examples/standalone/lib/Standalone/StandalonePasses.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class StandaloneSwitchBarFoo
3939
RewritePatternSet patterns(&getContext());
4040
patterns.add<StandaloneSwitchBarFooRewriter>(&getContext());
4141
FrozenRewritePatternSet patternSet(std::move(patterns));
42-
if (failed(applyPatternsAndFoldGreedily(getOperation(), patternSet)))
42+
if (failed(applyPatternsGreedily(getOperation(), patternSet)))
4343
signalPassFailure();
4444
}
4545
};

mlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ class GreedyRewriteConfig {
9292
/// An optional listener that should be notified about IR modifications.
9393
RewriterBase::Listener *listener = nullptr;
9494

95-
/// Whether this should fold while greedily rewriting. This also disables
96-
/// CSE'ing constants.
95+
/// Whether this should fold while greedily rewriting.
9796
bool fold = true;
9897

9998
/// If set to "true", constants are CSE'd (even across multiple regions that
@@ -131,11 +130,10 @@ applyPatternsGreedily(Region &region, const FrozenRewritePatternSet &patterns,
131130
/// Same as `applyPatternsAndGreedily` above with folding.
132131
/// FIXME: Remove this once transition to above is complieted.
133132
LLVM_DEPRECATED("Use applyPatternsGreedily() instead", "applyPatternsGreedily")
134-
inline LogicalResult
135-
applyPatternsAndFoldGreedily(Region &region,
136-
const FrozenRewritePatternSet &patterns,
137-
GreedyRewriteConfig config = GreedyRewriteConfig(),
138-
bool *changed = nullptr) {
133+
inline LogicalResult applyPatternsAndFoldGreedily(
134+
Region &region, const FrozenRewritePatternSet &patterns,
135+
GreedyRewriteConfig config = GreedyRewriteConfig(),
136+
bool *changed = nullptr) {
139137
config.fold = true;
140138
return applyPatternsGreedily(region, patterns, config, changed);
141139
}
@@ -183,11 +181,10 @@ applyPatternsGreedily(Operation *op, const FrozenRewritePatternSet &patterns,
183181
/// Same as `applyPatternsGreedily` above with folding.
184182
/// FIXME: Remove this once transition to above is complieted.
185183
LLVM_DEPRECATED("Use applyPatternsGreedily() instead", "applyPatternsGreedily")
186-
inline LogicalResult
187-
applyPatternsAndFoldGreedily(Operation *op,
188-
const FrozenRewritePatternSet &patterns,
189-
GreedyRewriteConfig config = GreedyRewriteConfig(),
190-
bool *changed = nullptr) {
184+
inline LogicalResult applyPatternsAndFoldGreedily(
185+
Operation *op, const FrozenRewritePatternSet &patterns,
186+
GreedyRewriteConfig config = GreedyRewriteConfig(),
187+
bool *changed = nullptr) {
191188
config.fold = true;
192189
return applyPatternsGreedily(op, patterns, config, changed);
193190
}
@@ -207,14 +204,14 @@ applyPatternsAndFoldGreedily(Operation *op,
207204
/// regardless of `strictMode`).
208205
///
209206
/// In addition to strictness, a region scope can be specified. Only ops within
210-
/// the scope are simplified. This is similar to `applyPatternsAndFoldGreedily`,
207+
/// the scope are simplified. This is similar to `applyPatternsGreedily`,
211208
/// where only ops within the given region/op are simplified by default. If no
212209
/// scope is specified, it is assumed to be the first common enclosing region of
213210
/// the given ops.
214211
///
215212
/// Note that ops in `ops` could be erased as result of folding, becoming dead,
216213
/// or via pattern rewrites. If more far reaching simplification is desired,
217-
/// `applyPatternsAndFoldGreedily` should be used.
214+
/// `applyPatternsGreedily` should be used.
218215
///
219216
/// Returns "success" if the iterative process converged (i.e., fixpoint was
220217
/// reached) and no more patterns can be matched. `changed` is set to "true" if
@@ -227,12 +224,12 @@ applyOpPatternsGreedily(ArrayRef<Operation *> ops,
227224
bool *changed = nullptr, bool *allErased = nullptr);
228225
/// Same as `applyOpPatternsGreedily` with folding.
229226
/// FIXME: Remove this once transition to above is complieted.
230-
LLVM_DEPRECATED("Use applyPatternsGreedily() instead", "applyPatternsGreedily")
227+
LLVM_DEPRECATED("Use applyOpPatternsGreedily() instead", "applyOpPatternsGreedily")
231228
inline LogicalResult
232229
applyOpPatternsAndFold(ArrayRef<Operation *> ops,
233-
const FrozenRewritePatternSet &patterns,
234-
GreedyRewriteConfig config = GreedyRewriteConfig(),
235-
bool *changed = nullptr, bool *allErased = nullptr) {
230+
const FrozenRewritePatternSet &patterns,
231+
GreedyRewriteConfig config = GreedyRewriteConfig(),
232+
bool *changed = nullptr, bool *allErased = nullptr) {
236233
config.fold = true;
237234
return applyOpPatternsGreedily(ops, patterns, config, changed, allErased);
238235
}

mlir/lib/CAPI/Transforms/Rewrite.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,7 @@ MlirLogicalResult
289289
mlirApplyPatternsAndFoldGreedily(MlirModule op,
290290
MlirFrozenRewritePatternSet patterns,
291291
MlirGreedyRewriteDriverConfig) {
292-
return wrap(
293-
mlir::applyPatternsAndFoldGreedily(unwrap(op), *unwrap(patterns)));
292+
return wrap(mlir::applyPatternsGreedily(unwrap(op), *unwrap(patterns)));
294293
}
295294

296295
//===----------------------------------------------------------------------===//

mlir/lib/Conversion/ArithToAMDGPU/ArithToAMDGPU.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,6 @@ void ArithToAMDGPUConversionPass::runOnOperation() {
385385
arith::populateArithToAMDGPUConversionPatterns(
386386
patterns, convertFP8Arithmetic, saturateFP8Truncf, allowPackedF16Rtz,
387387
*maybeChipset);
388-
if (failed(applyPatternsAndFoldGreedily(op, std::move(patterns))))
388+
if (failed(applyPatternsGreedily(op, std::move(patterns))))
389389
return signalPassFailure();
390390
}

mlir/lib/Conversion/ArithToArmSME/ArithToArmSME.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ struct ArithToArmSMEConversionPass final
117117
void runOnOperation() override {
118118
RewritePatternSet patterns(&getContext());
119119
arith::populateArithToArmSMEConversionPatterns(patterns);
120-
if (failed(
121-
applyPatternsAndFoldGreedily(getOperation(), std::move(patterns))))
120+
if (failed(applyPatternsGreedily(getOperation(), std::move(patterns))))
122121
return signalPassFailure();
123122
}
124123
};

mlir/lib/Conversion/ArmNeon2dToIntr/ArmNeon2dToIntr.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ class ConvertArmNeon2dToIntr
5959
RewritePatternSet patterns(context);
6060
populateConvertArmNeon2dToIntrPatterns(patterns);
6161

62-
if (failed(
63-
applyPatternsAndFoldGreedily(getOperation(), std::move(patterns))))
62+
if (failed(applyPatternsGreedily(getOperation(), std::move(patterns))))
6463
return signalPassFailure();
6564
}
6665
};

mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ struct LowerGpuOpsToNVVMOpsPass
271271
{
272272
RewritePatternSet patterns(m.getContext());
273273
populateGpuRewritePatterns(patterns);
274-
if (failed(applyPatternsAndFoldGreedily(m, std::move(patterns))))
274+
if (failed(applyPatternsGreedily(m, std::move(patterns))))
275275
return signalPassFailure();
276276
}
277277

mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ struct LowerGpuOpsToROCDLOpsPass
271271
RewritePatternSet patterns(ctx);
272272
populateGpuRewritePatterns(patterns);
273273
arith::populateExpandBFloat16Patterns(patterns);
274-
(void)applyPatternsAndFoldGreedily(m, std::move(patterns));
274+
(void)applyPatternsGreedily(m, std::move(patterns));
275275
}
276276

277277
LLVMTypeConverter converter(ctx, options);

mlir/lib/Conversion/MeshToMPI/MeshToMPI.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,7 @@ struct ConvertMeshToMPIPass
427427
ConvertProcessLinearIndexOp, ConvertProcessMultiIndexOp>(
428428
ctx);
429429

430-
(void)mlir::applyPatternsAndFoldGreedily(getOperation(),
431-
std::move(patterns));
430+
(void)mlir::applyPatternsGreedily(getOperation(), std::move(patterns));
432431
}
433432
};
434433

0 commit comments

Comments
 (0)