61 lines · plain
1// RUN: mlir-opt %s --transform-interpreter --split-input-file --verify-diagnostics | FileCheck %s2 3func.func private @callee(%i: index, %j: index)4 5// CHECK-LABEL: @two_iters6// CHECK-SAME: %[[UB1:.+]]: index, %[[UB2:.+]]: index7func.func @two_iters(%ub1: index, %ub2: index) {8 scf.forall (%i, %j) in (%ub1, %ub2) {9 func.call @callee(%i, %j) : (index, index) -> ()10 }11 // CHECK: scf.parallel (%[[IV1:.+]], %[[IV2:.+]]) = (%{{.*}}, %{{.*}}) to (%[[UB1]], %[[UB2]])12 // CHECK: func.call @callee(%[[IV1]], %[[IV2]]) : (index, index) -> ()13 // CHECK: scf.reduce14 return15}16 17module attributes {transform.with_named_sequence} {18 transform.named_sequence @__transform_main(%arg0: !transform.any_op {transform.readonly}) {19 %0 = transform.structured.match ops{["scf.forall"]} in %arg0 : (!transform.any_op) -> !transform.any_op20 transform.loop.forall_to_parallel %0 : (!transform.any_op) -> (!transform.any_op)21 transform.yield22 }23}24 25// -----26 27func.func private @callee(%i: index, %j: index)28 29func.func @repeated(%ub1: index, %ub2: index) {30 scf.forall (%i, %j) in (%ub1, %ub2) {31 func.call @callee(%i, %j) : (index, index) -> ()32 }33 scf.forall (%i, %j) in (%ub1, %ub2) {34 func.call @callee(%i, %j) : (index, index) -> ()35 }36 return37}38 39module attributes {transform.with_named_sequence} {40 transform.named_sequence @__transform_main(%arg0: !transform.any_op {transform.readonly}) {41 %0 = transform.structured.match ops{["scf.forall"]} in %arg0 : (!transform.any_op) -> !transform.any_op42 // expected-error @below {{expected a single payload op}}43 transform.loop.forall_to_parallel %0 : (!transform.any_op) -> (!transform.any_op)44 transform.yield45 }46}47 48// -----49 50// expected-note @below {{payload op}}51func.func private @callee(%i: index, %j: index)52 53module attributes {transform.with_named_sequence} {54 transform.named_sequence @__transform_main(%arg0: !transform.any_op {transform.readonly}) {55 %0 = transform.structured.match ops{["func.func"]} in %arg0 : (!transform.any_op) -> !transform.any_op56 // expected-error @below {{expected the payload to be scf.forall}}57 transform.loop.forall_to_for %0 : (!transform.any_op) -> !transform.any_op58 transform.yield59 }60}61