[Mlir-commits] [mlir] MLIR Rewriters: add new listener to emit match failures to user, enhance docs (PR #94130)
Matthias Springer
llvmlistbot at llvm.org
Tue Jun 4 00:53:04 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:
If you emit an error/warning/remark every time a pattern fails to match, you will be bombarded with output in many cases (even though the lowering was successful). Just try running `-canonicalize` on a larger piece of IR and see how many pattern fail to match. (Most of them don't report match failures due to laziness though.)
https://github.com/llvm/llvm-project/pull/94130
More information about the Mlir-commits
mailing list