[mlir] GreedyPatternRewriter: Reprocess modified ops
authorMatthias Springer <springerm@google.com>
Fri, 18 Nov 2022 10:18:19 +0000 (11:18 +0100)
committerMatthias Springer <springerm@google.com>
Fri, 18 Nov 2022 10:43:44 +0000 (11:43 +0100)
commit2fea658a74196a9c9128be34c5bc306eba7a025e
tree9f0223442c5696bb1eccc91618b6f17879e5d8cc
parent34d88cf6cfe9f878e6330f157f178c2b104c3949
[mlir] GreedyPatternRewriter: Reprocess modified ops

Ops that were modifed in-place (`finalizeRootUpdate` was called) should be reprocessed by the GreedyPatternRewriter. This is currently not happening with `GreedyRewriteConfig::maxIterations = 1`.

Note: If your project goes into an infinite loop because of this change, you likely have one or multiple faulty patterns that modify the same operations in-place (`updateRootInplace`) indefinitely.

Differential Revision: https://reviews.llvm.org/D138038
mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp
mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
mlir/test/IR/greedy-pattern-rewriter-driver.mlir [new file with mode: 0644]
mlir/test/lib/Dialect/Test/TestPatterns.cpp