[mlir] Add RewriterBase::replaceAllUsesWith for Blocks.
authorIngo Müller <ingomueller@google.com>
Tue, 24 Jan 2023 15:42:38 +0000 (15:42 +0000)
committerIngo Müller <ingomueller@google.com>
Wed, 15 Feb 2023 07:23:21 +0000 (07:23 +0000)
commit4bba8bd33efdfb43c840e2dfa7ef5263254facdb
treef5ae546f2f4df4ef34a43bf62d77f1f7d606fb2a
parent72429a42ac33564fa82449d99dc234da32a05498
[mlir] Add RewriterBase::replaceAllUsesWith for Blocks.

When changing IR in a RewriterPattern, all changes must go through the
rewriter. There are several convenience functions in RewriterBase that
help with high-level modifications, such as replaceAllUsesWith for
Values, but there is currently none to do the same task for Blocks.

Reviewed By: mehdi_amini, ingomueller-net

Differential Revision: https://reviews.llvm.org/D142525
mlir/include/mlir/IR/PatternMatch.h
mlir/lib/IR/PatternMatch.cpp
mlir/test/Transforms/test-strict-pattern-driver.mlir
mlir/test/lib/Dialect/Test/TestPatterns.cpp