[mlir] GreedyPatternRewriteDriver: Entry point takes single region
authorMatthias Springer <springerm@google.com>
Fri, 27 Jan 2023 10:09:13 +0000 (11:09 +0100)
committerMatthias Springer <springerm@google.com>
Fri, 27 Jan 2023 10:23:04 +0000 (11:23 +0100)
commita2b837ab0448869c74cc042155dd454833c60d62
treed4163edb5c7cabe9b1f2cd94858d0eb0aeb0409a
parentbf5f63e59fd729efd6dd69318b365293f7ce385d
[mlir] GreedyPatternRewriteDriver: Entry point takes single region

The rewrite driver is typically applied to a single region or all regions of the same op. There is no longer an overload to apply the rewrite driver to a list of regions.

This simplifies the rewrite driver implementation because the scope is now a single region as opposed to a list of regions.

Note: This change is not NFC because `config.maxIterations` and `config.maxNumRewrites` is now counted for each region separately. Furthermore, worklist filtering (`scope`) is now applied to each region separately.

Differential Revision: https://reviews.llvm.org/D142611
mlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h
mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp
mlir/lib/Dialect/MemRef/Transforms/ExpandStridedMetadata.cpp
mlir/lib/Dialect/MemRef/Transforms/FoldMemRefAliasOps.cpp
mlir/lib/Dialect/MemRef/Transforms/ResolveShapedTypeResultDims.cpp
mlir/lib/Dialect/Vector/Transforms/LowerVectorMask.cpp
mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
mlir/test/lib/Dialect/Test/TestPatterns.cpp