[Mlir-commits] [mlir] [mlir] Use transform dialect for backward slice tests (PR #159634)
Oleksandr Alex Zinenko
llvmlistbot at llvm.org
Fri Sep 19 03:41:03 PDT 2025
================
@@ -0,0 +1,97 @@
+// RUN: mlir-opt --allow-unregistered-dialect --transform-interpreter --split-input-file --verify-diagnostics %s | FileCheck %s
+
+func.func @simple() {
+ %0 = "other"() : () -> (f32)
+ %1 = "root"(%0) : (f32) -> (f32)
+}
+// CHECK-LABEL: func @simple__backward_slice__()
+// CHECK: %[[OTHER:.+]] = "other"
+// CHECK: %[[ROOT:.+]] = "root"(%[[OTHER]])
+// CHECK: return
+
+module attributes {transform.with_named_sequence} {
+ transform.named_sequence @__transform_main(%arg0 : !transform.any_op {transform.readonly}) {
+ %op = transform.structured.match ops{["root"]} in %arg0
+ : (!transform.any_op) -> !transform.any_op
+ transform.test.get_backward_slice %op : !transform.any_op
+ transform.yield
+ }
+}
+
+// -----
----------------
ftynse wrote:
Do we have to split the input file here? If not, we can do add a `TransformEachOpTrait` to the transform op and have it apply to all roots one-by-one...
https://github.com/llvm/llvm-project/pull/159634
More information about the Mlir-commits
mailing list