[Mlir-commits] [mlir] [mlir][Transforms] Use correct listener in dialect conversion (PR #84861)

Matthias Springer llvmlistbot at llvm.org
Mon Mar 11 18:34:30 PDT 2024


https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/84861

There was a typo in the dialect conversion: `RewriterBase::Listener` should be used instead of `ForwardingListener`.

>From 30e4b8cd0d5b48f2d2a13dddd3cd257e7dcf6e49 Mon Sep 17 00:00:00 2001
From: Matthias Springer <springerm at google.com>
Date: Tue, 12 Mar 2024 01:33:48 +0000
Subject: [PATCH] [mlir][Transforms] Use correct listener in dialect conversion

There was a typo in the dialect conversion: `RewriterBase::Listener` should be used instead of `ForwardingListener`.
---
 mlir/lib/Transforms/Utils/DialectConversion.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/mlir/lib/Transforms/Utils/DialectConversion.cpp b/mlir/lib/Transforms/Utils/DialectConversion.cpp
index cd49bd121a62e5..2ec0b964b304f6 100644
--- a/mlir/lib/Transforms/Utils/DialectConversion.cpp
+++ b/mlir/lib/Transforms/Utils/DialectConversion.cpp
@@ -1020,8 +1020,8 @@ void BlockTypeConversionRewrite::commit(RewriterBase &rewriter) {
   // Inform the listener about all IR modifications that have already taken
   // place: References to the original block have been replaced with the new
   // block.
-  if (auto *listener = dyn_cast_or_null<RewriterBase::ForwardingListener>(
-          rewriter.getListener()))
+  if (auto *listener =
+          dyn_cast_or_null<RewriterBase::Listener>(rewriter.getListener()))
     for (Operation *op : block->getUsers())
       listener->notifyOperationModified(op);
 
@@ -1123,8 +1123,8 @@ void ReplaceBlockArgRewrite::commit(RewriterBase &rewriter) {
 void ReplaceBlockArgRewrite::rollback() { rewriterImpl.mapping.erase(arg); }
 
 void ReplaceOperationRewrite::commit(RewriterBase &rewriter) {
-  auto *listener = dyn_cast_or_null<RewriterBase::ForwardingListener>(
-      rewriter.getListener());
+  auto *listener =
+      dyn_cast_or_null<RewriterBase::Listener>(rewriter.getListener());
 
   // Compute replacement values.
   SmallVector<Value> replacements =



More information about the Mlir-commits mailing list