@@ -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 ®ion, const FrozenRewritePatternSet &patterns,
131130// / Same as `applyPatternsAndGreedily` above with folding.
132131// / FIXME: Remove this once transition to above is complieted.
133132LLVM_DEPRECATED (" Use applyPatternsGreedily() instead" , " applyPatternsGreedily" )
134- inline LogicalResult
135- applyPatternsAndFoldGreedily (Region ®ion,
136- const FrozenRewritePatternSet &patterns,
137- GreedyRewriteConfig config = GreedyRewriteConfig(),
138- bool *changed = nullptr ) {
133+ inline LogicalResult applyPatternsAndFoldGreedily (
134+ Region ®ion, 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.
185183LLVM_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 " )
231228inline LogicalResult
232229applyOpPatternsAndFold (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}
0 commit comments