brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · c00b47f Raw
43 lines · plain
1// RUN: mlir-opt %s --transform-interpreter -test-transform-dialect-erase-schedule --test-lower-to-llvm --split-input-file | FileCheck %s2 3// CHECK-LABEL: llvm.func @matmul_tensors4func.func @matmul_tensors(5  %arg0: tensor<2x4xf32>, %arg1: tensor<4x6xf32>, %arg2: tensor<2x6xf32>)6    -> tensor<2x6xf32> {7// CHECK-NOT: linalg8// CHECK: llvm.intr.fmuladd{{.*}}9  %0 = linalg.matmul  ins(%arg0, %arg1: tensor<2x4xf32>, tensor<4x6xf32>)10                     outs(%arg2: tensor<2x6xf32>)11    -> tensor<2x6xf32>12  return %0 : tensor<2x6xf32>13}14 15module attributes {transform.with_named_sequence} {16  transform.named_sequence @__transform_main(%module_op: !transform.any_op {transform.consumed}) {17    %0 = transform.structured.match ops{["linalg.matmul"]} in %module_op : (!transform.any_op) -> !transform.any_op18    %1, %loops:3 = transform.structured.tile_using_for %0 tile_sizes [2, 2, 2] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)19    %2 = transform.get_parent_op %1 {isolated_from_above} : (!transform.any_op) -> !transform.any_op20    transform.structured.vectorize_children_and_apply_patterns %2 : (!transform.any_op) -> !transform.any_op21    %b = transform.bufferization.one_shot_bufferize layout{IdentityLayoutMap}22        %module_op {bufferize_function_boundaries = true}23        : (!transform.any_op) -> !transform.any_op24 25    %f = transform.structured.match ops{["func.func"]} in %b26      : (!transform.any_op) -> !transform.any_op27 28    // TODO: group these lower-level controls into various properly named vector29    // lowering TD macros.30    transform.apply_patterns to %f {31      transform.apply_patterns.vector.lower_contraction lowering_strategy = "outerproduct"32      transform.apply_patterns.vector.transfer_permutation_patterns33      transform.apply_patterns.vector.lower_multi_reduction lowering_strategy = "innerparallel"34      transform.apply_patterns.vector.split_transfer_full_partial split_transfer_strategy = "linalg-copy"35      transform.apply_patterns.vector.transfer_to_scf max_transfer_rank = 1 full_unroll = true36      transform.apply_patterns.vector.lower_transfer max_transfer_rank = 137      transform.apply_patterns.vector.lower_shape_cast38      transform.apply_patterns.vector.lower_transpose lowering_strategy = "shuffle_1d"39    } : !transform.any_op40    transform.yield41  }42}43