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

Matthias Springer llvmlistbot at llvm.org
Sun Jun 2 01:58:48 PDT 2024


================
@@ -511,6 +512,50 @@ class RewriterBase : public OpBuilder {
     OpBuilder::Listener *listener;
   };
 
+  /// A listener that emits all notifyMatchFailure calls
+  /// with the given DiagnosticSeverity (default is Error).
+  /// This can be used so that any notifyMatchFailure calls will be emitted
+  /// as a message with the given severity (Remark will be used for Note)
+  struct MatchFailureEmittingListener : public RewriterBase::Listener {
----------------
matthias-springer wrote:

Do we actually need this? Match failures are printed during a greedy pattern rewrite / dialect conversion with `mlir-opt -debug`. Are there any other use cases for this?

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


More information about the Mlir-commits mailing list