[mlir] GreedyPatternRewriteDriver: Keep track of surviving ops
authorMatthias Springer <springerm@google.com>
Thu, 26 Jan 2023 08:15:49 +0000 (09:15 +0100)
committerMatthias Springer <springerm@google.com>
Thu, 26 Jan 2023 08:21:51 +0000 (09:21 +0100)
commit774416bdb396e79e19d9c7ed49a49203c841c7c3
tree0dbd6935c6ef990bac8fc6228f3c6af21d29e170
parent7c7e215f0e2be690358484df2a5c149b87b0aa6c
[mlir] GreedyPatternRewriteDriver: Keep track of surviving ops

This change adds `allErased` to the `applyOpPatternsAndFold(ArrayRef<Operation *>, ...)` overload. This overload now supports all functionality that is also supported by `applyOpPatternsAndFold(Operation *, ...)` and can be used as a replacement.

This change has no performance implications when `allErased = nullptr`.

The single-operation overload is removed in a subsequent NFC change.

Differential Revision: https://reviews.llvm.org/D141920
mlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h
mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
mlir/test/Transforms/test-strict-pattern-driver.mlir
mlir/test/lib/Dialect/Test/TestPatterns.cpp