63 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 5func.func @two_iters(%lb1: index, %lb2: index, %ub1: index, %ub2: index, %step1: index, %step2: index) {6 scf.parallel (%i, %j) = (%lb1, %lb2) to (%ub1, %ub2) step (%step1, %step2) {7 func.call @callee(%i, %j) : (index, index) -> ()8 }9 // CHECK: scf.for %[[VAL_0:.*]] = %[[ARG0:.*]] to %[[ARG2:.*]] step %[[ARG4:.*]] {10 // CHECK: scf.for %[[VAL_1:.*]] = %[[ARG1:.*]] to %[[ARG3:.*]] step %[[ARG5:.*]] {11 // CHECK: func.call @callee(%[[VAL_0]], %[[VAL_1]]) : (index, index) -> ()12 // CHECK: }13 // CHECK: }14 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.parallel"]} in %arg0 : (!transform.any_op) -> !transform.any_op20 transform.loop.parallel_for_to_nested_fors %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(%lb1: index, %lb2: index, %ub1: index, %ub2: index, %step1: index, %step2: index) {30 scf.parallel (%i, %j) = (%lb1, %lb2) to (%ub1, %ub2) step (%step1, %step2) {31 func.call @callee(%i, %j) : (index, index) -> ()32 }33 34 scf.parallel (%i, %j) = (%lb1, %lb2) to (%ub1, %ub2) step (%step1, %step2) {35 func.call @callee(%i, %j) : (index, index) -> ()36 }37 38 return39}40 41module attributes {transform.with_named_sequence} {42 transform.named_sequence @__transform_main(%arg0: !transform.any_op {transform.readonly}) {43 %0 = transform.structured.match ops{["scf.parallel"]} in %arg0 : (!transform.any_op) -> !transform.any_op44 // expected-error @below {{expected a single payload op}}45 transform.loop.parallel_for_to_nested_fors %0 : (!transform.any_op) -> (!transform.any_op)46 transform.yield47 }48}49 50// -----51 52// expected-note @below {{payload op}}53func.func private @callee(%i: index, %j: index)54 55module attributes {transform.with_named_sequence} {56 transform.named_sequence @__transform_main(%arg0: !transform.any_op {transform.readonly}) {57 %0 = transform.structured.match ops{["func.func"]} in %arg0 : (!transform.any_op) -> !transform.any_op58 // expected-error @below {{expected the payload to be scf.parallel}}59 transform.loop.parallel_for_to_nested_fors %0 : (!transform.any_op) -> !transform.any_op60 transform.yield61 }62}63