[Mlir-commits] [mlir] [mlir] Test the final-policy remark on a failing pipeline without verification (PR #227276)
Henrich Lauko
llvmlistbot at llvm.org
Tue Sep 29 04:18:51 PDT 2026
https://github.com/xlauko created https://github.com/llvm/llvm-project/pull/227276
`remark-final-verify-diagnostics.mlir`, added in #226258, passes without that change: the verifier's leaked registration still received the remark emitted from `~MLIRContext` (pointed out in https://github.com/llvm/llvm-project/pull/226258#discussion_r4132098767).
Check the printed remark instead. Before #226258 it was dropped, because the `SourceMgrDiagnosticHandler` was gone by the time `~MLIRContext` finalized the policy. Verified: the new test fails with #226258's source changes reverted and passes on main.
Assisted-by: Claude Code (Claude Opus 5.5)
>From d39d13f89f87ef416cafe3fd2afc76f9a11e94a2 Mon Sep 17 00:00:00 2001
From: Henrich Lauko <hlauko at nvidia.com>
Date: Tue, 29 Sep 2026 11:18:27 +0000
Subject: [PATCH] [mlir] Test the final-policy remark on a failing pipeline
without verification
remark-final-verify-diagnostics.mlir, added in #226258, passes without that
change: the verifier's leaked registration still received the remark
emitted from ~MLIRContext. Check the printed remark instead; before
#226258 it was dropped because the SourceMgrDiagnosticHandler was gone by
the time ~MLIRContext finalized the policy.
Assisted-by: Claude Code (Claude Opus 5.5)
---
mlir/test/Pass/remark-final-pass-failure.mlir | 8 ++++++++
mlir/test/Pass/remark-final-verify-diagnostics.mlir | 10 ----------
2 files changed, 8 insertions(+), 10 deletions(-)
create mode 100644 mlir/test/Pass/remark-final-pass-failure.mlir
delete mode 100644 mlir/test/Pass/remark-final-verify-diagnostics.mlir
diff --git a/mlir/test/Pass/remark-final-pass-failure.mlir b/mlir/test/Pass/remark-final-pass-failure.mlir
new file mode 100644
index 00000000000000..a0b30f2fbb4bf7
--- /dev/null
+++ b/mlir/test/Pass/remark-final-pass-failure.mlir
@@ -0,0 +1,8 @@
+// RUN: not mlir-opt %s --remarks-filter="category-1-passed" --remark-policy=final \
+// RUN: --pass-pipeline='builtin.module(test-remark,test-pass-failure)' 2>&1 | FileCheck %s
+
+// The failing pipeline returns before the textual output; the remark deferred
+// by the final policy must still be printed.
+
+// CHECK: remark: [Passed] test-remark | Category:category-1-passed
+"test.op"() : () -> ()
diff --git a/mlir/test/Pass/remark-final-verify-diagnostics.mlir b/mlir/test/Pass/remark-final-verify-diagnostics.mlir
deleted file mode 100644
index 5e6ef7103ed5db..00000000000000
--- a/mlir/test/Pass/remark-final-verify-diagnostics.mlir
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: mlir-opt %s --verify-diagnostics --remarks-filter="category-1-passed" \
-// RUN: --remark-policy=final \
-// RUN: --pass-pipeline='builtin.module(test-remark,test-pass-failure)'
-
-// The failing pipeline returns before the textual output; the remark deferred
-// by the final policy must still reach the diagnostic verifier.
-module {
- // expected-remark at below {{[Passed] test-remark | Category:category-1-passed}}
- "test.op"() : () -> ()
-}
More information about the Mlir-commits
mailing list