[Mlir-commits] [mlir] 437fcc6 - [mlir][IR] Add additional rewriter constructor (#85044)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Mar 13 20:45:10 PDT 2024
Author: Matthias Springer
Date: 2024-03-14T12:45:07+09:00
New Revision: 437fcc6eed99694a9f9486d29ead6a3d3275ede9
URL: https://github.com/llvm/llvm-project/commit/437fcc6eed99694a9f9486d29ead6a3d3275ede9
DIFF: https://github.com/llvm/llvm-project/commit/437fcc6eed99694a9f9486d29ead6a3d3275ede9.diff
LOG: [mlir][IR] Add additional rewriter constructor (#85044)
For convenience, add an additional constructor to `RewriterBase` and
`IRRewriter` that also sets the insertion point. `OpBuilder` provides a
similar constructor.
Added:
Modified:
mlir/include/mlir/IR/PatternMatch.h
Removed:
################################################################################
diff --git a/mlir/include/mlir/IR/PatternMatch.h b/mlir/include/mlir/IR/PatternMatch.h
index ef53a0b82866fc..070e6ed702f86a 100644
--- a/mlir/include/mlir/IR/PatternMatch.h
+++ b/mlir/include/mlir/IR/PatternMatch.h
@@ -736,6 +736,8 @@ class RewriterBase : public OpBuilder {
: OpBuilder(ctx, listener) {}
explicit RewriterBase(const OpBuilder &otherBuilder)
: OpBuilder(otherBuilder) {}
+ explicit RewriterBase(Operation *op, OpBuilder::Listener *listener = nullptr)
+ : OpBuilder(op, listener) {}
virtual ~RewriterBase();
private:
@@ -756,6 +758,8 @@ class IRRewriter : public RewriterBase {
explicit IRRewriter(MLIRContext *ctx, OpBuilder::Listener *listener = nullptr)
: RewriterBase(ctx, listener) {}
explicit IRRewriter(const OpBuilder &builder) : RewriterBase(builder) {}
+ explicit IRRewriter(Operation *op, OpBuilder::Listener *listener = nullptr)
+ : RewriterBase(op, listener) {}
};
//===----------------------------------------------------------------------===//
More information about the Mlir-commits
mailing list