brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 94e9d8f Raw
39 lines · plain
1// RUN: mlir-opt %s --transform-interpreter -allow-unregistered-dialect --verify-diagnostics2 3module attributes { transform.with_named_sequence } {4  // Callee returns a silenceable failure when given a module instead of func.func.5  transform.named_sequence @callee(%root: !transform.any_op {transform.consumed}) -> (!transform.any_op) {6    transform.test_consume_operand_of_op_kind_or_fail %root, "func.func" : !transform.any_op7    transform.yield %root : !transform.any_op8  }9 10  transform.named_sequence @__transform_main(%root: !transform.any_op) {11    %res = transform.sequence %root : !transform.any_op -> !transform.any_op failures(suppress) {12    ^bb0(%arg0: !transform.any_op):13      // This include returns a silenceable failure; it must not remap results.14      %included = transform.include @callee failures(propagate) (%arg0) : (!transform.any_op) -> (!transform.any_op)15      transform.yield %included : !transform.any_op16    }17 18    %count = transform.num_associations %res : (!transform.any_op) -> !transform.param<i64>19    // expected-remark @below {{0}}20    transform.debug.emit_param_as_remark %count : !transform.param<i64>21 22    // If the include incorrectly forwarded mappings on failure, this would run23    // and produce an unexpected remark under --verify-diagnostics.24    transform.foreach %res : !transform.any_op {25    ^bb0(%it: !transform.any_op):26      transform.debug.emit_remark_at %it, "include result unexpectedly populated" : !transform.any_op27    }28    transform.yield29  }30}31 32// -----33 34module {35  func.func @payload() {36    return37  }38}39