[mlir][Transforms][NFC] CSE: Add non-pass entry point
authorMatthias Springer <me@m-sp.org>
Thu, 29 Jun 2023 14:32:11 +0000 (16:32 +0200)
committerMatthias Springer <me@m-sp.org>
Thu, 29 Jun 2023 14:36:58 +0000 (16:36 +0200)
commit189033e6bede96de0d74e61715fcd1b48d95e247
treefca4c3c3f7b3f935331767d879c9f5937980bbd7
parent92b5a3405de9f04cb31fae21138183c417afc42e
[mlir][Transforms][NFC] CSE: Add non-pass entry point

Add an additional entry point so that CSE can be used without a pass. This allows CSE to be used from the Transform dialect without invalidating all handles.

* All IR modifications are done with a rewriter.
* The C++ entry point takes a `RewriterBase &`, which may have a listener attached to it. This allows users to track all IR modifications.

Differential Revision: https://reviews.llvm.org/D145226
mlir/include/mlir/IR/PatternMatch.h
mlir/include/mlir/Transforms/CSE.h [new file with mode: 0644]
mlir/lib/Transforms/CSE.cpp