[mlir] Add `replaceAllUsesExcept` to rewriter
authorDiego Caballero <diegocaballero@google.com>
Tue, 6 Dec 2022 07:30:28 +0000 (07:30 +0000)
committerDiego Caballero <diegocaballero@google.com>
Tue, 6 Dec 2022 07:42:15 +0000 (07:42 +0000)
commit77603e28ce05d3a70bcf7fb2880e7b0c6c547810
tree1442ab77dd32acc4e29a3ef1dcb4f07262bf34f4
parentd920ab4a8bf26d3201e088888460bea542fcd5ea
[mlir] Add `replaceAllUsesExcept` to rewriter

This patch adds `replaceAllUsesExcept` to the rewriter class.
The implementation is copy-pasted from Value + calling
`updateRootInPlace` to notify the listeners about the
corresponding IR changes.

Reviewed By: Mogball

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