[mlir] GreedyPatternRewriteDriver: Add new strict mode option
authorMatthias Springer <springerm@google.com>
Fri, 20 Jan 2023 09:01:27 +0000 (10:01 +0100)
committerMatthias Springer <springerm@google.com>
Fri, 20 Jan 2023 09:08:11 +0000 (10:08 +0100)
commit87e345b1bdb76867cc6e9ae59b6dd2633a480d38
treed0f08ae200d025b31aa29c97b43ff4361c1072d5
parentb7894ebf8439c0141614fbb8bfc1a27a0a67e946
[mlir] GreedyPatternRewriteDriver: Add new strict mode option

There are now three options:
* `AnyOp` (previously `false`)
* `ExistingAndNewOps` (previously `true`)
* `ExistingOps`: this one is new.

The last option corresponds to what the `applyOpPatternsAndFold(Operation*, ...)` overload is doing. It is now also supported on the `applyOpPatternsAndFold(ArrayRef<Operation *>, ...)` overload.

Differential Revision: https://reviews.llvm.org/D141904
mlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h
mlir/lib/Dialect/Affine/TransformOps/AffineTransformOps.cpp
mlir/lib/Dialect/Affine/Transforms/AffineDataCopyGeneration.cpp
mlir/lib/Dialect/Affine/Transforms/SimplifyAffineStructures.cpp
mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
mlir/test/Transforms/test-strict-pattern-driver.mlir
mlir/test/lib/Dialect/Affine/TestAffineDataCopy.cpp
mlir/test/lib/Dialect/Test/TestPatterns.cpp