[Mlir-commits] [mlir] [mlir][transform] Improve error message of tracking listener. (PR #66987)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Thu Sep 21 00:54:23 PDT 2023


================
@@ -1396,14 +1396,13 @@ void transform::TrackingListener::notifyOperationReplaced(
   };
 
   // Helper function to check if the handle is alive.
-  auto hasAliveUser = [&]() {
-    for (Value v : opHandles) {
-      for (Operation *user : v.getUsers())
-        if (user != transformOp && !happensBefore(user, transformOp))
-          return true;
-    }
-    return false;
-  };
+  SmallVector<Operation *> aliveUsers;
----------------
ftynse wrote:

In theory, we can have a lot of users and reporting all of them isn't necessarily a readability improvement as even a dozen of notes will fill up the terminal window. How about reporting the _first found_ user instead? 

https://github.com/llvm/llvm-project/pull/66987


More information about the Mlir-commits mailing list