[mlir][IR] Trigger notifyOperationModified for replacements
authorMatthias Springer <me@m-sp.org>
Mon, 6 Mar 2023 08:24:39 +0000 (09:24 +0100)
committerMatthias Springer <me@m-sp.org>
Mon, 6 Mar 2023 09:07:48 +0000 (10:07 +0100)
commit21f4b84c456b471cc52016cf360e14d45f7f2960
tree4cbdd50ea1414b5d21faa490ddf2055a08da2fe2
parent0317147a2848547ec97d8e76782f7dc38267a21f
[mlir][IR] Trigger notifyOperationModified for replacements

Each user of the original value is modified in-place. Therefore, the corresponding notification should be triggered.

Also fixes a bug where `RewriterBase::mergeBlocks` did not notify the GreedyPatternRewriteDriver when replacing uses of block arguments. This function does not trigger "operation replaced" notifications, so the GreedyPatternRewriteDriver was not made aware of such IR changes.

Differential Revision: https://reviews.llvm.org/D144549
mlir/include/mlir/IR/PatternMatch.h
mlir/lib/IR/PatternMatch.cpp