[llvm-branch-commits] [mlir] [mlir][Transform] Remove `notifyOperationErased` workaround (PR #84134)

Matthias Springer via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Mar 6 00:10:53 PST 2024


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

D144193 (#66771) has been merged.

>From d9a6a5665c177185bafbe9cff264e28634b2b3e7 Mon Sep 17 00:00:00 2001
From: Matthias Springer <springerm at google.com>
Date: Wed, 6 Mar 2024 08:09:22 +0000
Subject: [PATCH] [mlir][Transform] Remove `notifyOperationErased` workaround

D144193 (#66771) has been merged.
---
 .../Dialect/Transform/IR/TransformInterfaces.cpp    | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp b/mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp
index 71a9d61198e3fb..fe2eea535ffdcf 100644
--- a/mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp
+++ b/mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp
@@ -1278,14 +1278,11 @@ void transform::TrackingListener::notifyMatchFailure(
 }
 
 void transform::TrackingListener::notifyOperationErased(Operation *op) {
-  // TODO: Walk can be removed when D144193 has landed.
-  op->walk([&](Operation *op) {
-    // Remove mappings for result values.
-    for (OpResult value : op->getResults())
-      (void)replacePayloadValue(value, nullptr);
-    // Remove mapping for op.
-    (void)replacePayloadOp(op, nullptr);
-  });
+  // Remove mappings for result values.
+  for (OpResult value : op->getResults())
+    (void)replacePayloadValue(value, nullptr);
+  // Remove mapping for op.
+  (void)replacePayloadOp(op, nullptr);
 }
 
 void transform::TrackingListener::notifyOperationReplaced(



More information about the llvm-branch-commits mailing list