[Mlir-commits] [mlir] [mlir] transform dialect; add pre/post-condition type (PR #191813)

Renato Golin llvmlistbot at llvm.org
Thu Apr 16 06:58:39 PDT 2026


================
@@ -0,0 +1,82 @@
+// RUN: mlir-opt %s --split-input-file --verify-diagnostics --transform-interpreter
+
+// expected-error @below {{normal form test_single_block_normal_form requires payload operations to have a single region}}
+func.func private @empty()
+
+module attributes {transform.with_named_sequence} {
+  transform.named_sequence @__transform_main(%arg0: !transform.any_op) {
+    transform.structured.match attributes {sym_name = "empty"} in %arg0 : (!transform.any_op) -> !transform.normalized_op<#transform.test_single_block_normal_form<nested false>>
+    transform.yield
+  }
+}
+
+// -----
+
+// expected-remark @below {{found}}
+func.func private @single() {
+  return
+}
+
+module attributes {transform.with_named_sequence} {
+  transform.named_sequence @__transform_main(%arg0: !transform.any_op) {
+    %0 = transform.structured.match attributes {sym_name = "single"} in %arg0 : (!transform.any_op) -> !transform.normalized_op<#transform.test_single_block_normal_form<nested false>>
+    transform.debug.emit_remark_at %0, "found" : !transform.normalized_op<#transform.test_single_block_normal_form<nested false>>
----------------
rengolin wrote:

do you have to propagate the normal form test on the type of every operation?

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


More information about the Mlir-commits mailing list