[Mlir-commits] [mlir] MLIR Rewriters: add new listener to emit match failures to user, enhance docs (PR #94130)

Ryan Thomas Lynch llvmlistbot at llvm.org
Mon Jun 3 11:20:14 PDT 2024


================
@@ -1620,6 +1620,8 @@ void ConversionPatternRewriterImpl::notifyMatchFailure(
     if (config.notifyCallback)
       config.notifyCallback(diag);
   });
+  if (config.listener)
+    config.listener->notifyMatchFailure(loc, reasonCallback);
----------------
emosy wrote:

If this is not an intended purpose for `notifyMatchFailure`, then can you help me explain why in the documentation?
I believe myself and others who agree with me probably just thought that match failure could be used as a way to signal a specific reason for failure, so I thought it made sense to add a way to use a listener to forward those.

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


More information about the Mlir-commits mailing list