|
2 | 2 | // RUN: mlir-opt %s -test-linalg-codegen-strategy="anchor-func=matmul anchor-op=linalg.matmul tile-sizes=16,32,64 promote promote-full-tile-pad register-tile-sizes=2,4,8 vectorize vectorize-contraction-to=outerproduct split-transfers=true unroll-vector-transfers=false" -split-input-file | FileCheck %s --check-prefix=CHECK-OUTER
|
3 | 3 | // RUN: mlir-opt %s -test-linalg-codegen-strategy="anchor-func=matmul anchor-op=linalg.matmul tile-sizes=16,32,64 tile-interchange=1,2,0 generalize iterator-interchange=0,2,1" -split-input-file | FileCheck %s --check-prefix=CHECK-INTERCHANGE
|
4 | 4 | // RUN: mlir-opt %s -test-linalg-codegen-strategy="anchor-func=matmul anchor-op=linalg.matmul tile-sizes=16,32,64 pad pack-paddings=1,1,0 hoist-paddings=3,3,0" -split-input-file | FileCheck %s --check-prefix=CHECK-PAD
|
| 5 | +// RUN: mlir-opt %s -test-linalg-codegen-strategy="anchor-func=matmul anchor-op=linalg.matmul tile-sizes=16,32,64 fuse pad vectorize" -split-input-file | FileCheck %s --check-prefix=CHECK-FUSE |
5 | 6 |
|
6 | 7 | // CHECK-INTRINSIC: func @matmul(
|
7 | 8 | // CHECK-OUTER: func @matmul(
|
@@ -56,3 +57,20 @@ func @matmul(%arg0: tensor<72x72xf32>, %arg1: tensor<72x72xf32>, %arg2: tensor<7
|
56 | 57 | %0 = linalg.matmul ins(%arg0, %arg1: tensor<72x72xf32>, tensor<72x72xf32>) outs(%arg2: tensor<72x72xf32>) -> tensor<72x72xf32>
|
57 | 58 | return %0 : tensor<72x72xf32>
|
58 | 59 | }
|
| 60 | + |
| 61 | +// ----- |
| 62 | + |
| 63 | +// CHECK-FUSE: func @matmul( |
| 64 | +func @matmul(%arg0: tensor<72x72xf32>, %arg1: tensor<72x72xf32>, %arg2: tensor<72x72xf32>) -> tensor<72x72xf32> { |
| 65 | + |
| 66 | + // Check the padding and vectorization applies to the fill operation due to the empty anchor op string. |
| 67 | + // CHECK-FUSE: %[[CST:.*]] = arith.constant dense<0.000000e+00> |
| 68 | + // CHECK-FUSE: vector.transfer_write %[[CST]] |
| 69 | + %cst = arith.constant 0.0 : f32 |
| 70 | + %0 = linalg.fill(%cst, %arg0) : f32, tensor<72x72xf32> -> tensor<72x72xf32> |
| 71 | + |
| 72 | + // Check the matmul is padded and vectorized despite the empty anchor op string. |
| 73 | + // CHECK-FUSE: vector.outerproduct |
| 74 | + %1 = linalg.matmul ins(%arg0, %arg1: tensor<72x72xf32>, tensor<72x72xf32>) outs(%0: tensor<72x72xf32>) -> tensor<72x72xf32> |
| 75 | + return %1 : tensor<72x72xf32> |
| 76 | +} |
0 commit comments