Skip to content

Commit 2afdeee

Browse files
committed
Add test for complete folding of tile + slice
1 parent b87be4f commit 2afdeee

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

mlir/test/Dialect/Tosa/canonicalize.mlir

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,17 @@ func.func @canonicalize_tile_slice(%arg0 : tensor<1x12x12x10x10x10xf32>) -> tens
908908

909909
// -----
910910

911+
// CHECK-LABEL: func.func @canonicalize_tile_slice_fold
912+
// CHECK-SAME: ([[PARAM_0_:%.+]]: tensor<1x12x12x10x10x10xf32>) -> tensor<1x12x12x10x10x10xf32> {
913+
// CHECK: return [[PARAM_0_]] : tensor<1x12x12x10x10x10xf32>
914+
func.func @canonicalize_tile_slice_fold(%arg0 : tensor<1x12x12x10x10x10xf32>) -> tensor<1x12x12x10x10x10xf32> {
915+
%0 = tosa.tile %arg0 {multiples = array<i64: 10, 10, 10, 10, 10, 10>} : (tensor<1x12x12x10x10x10xf32>) -> tensor<10x120x120x100x100x100xf32>
916+
%1 = tosa.slice %0 {size = array<i64: 1, 12, 12, 10, 10, 10>, start = array<i64: 0, 24, 12, 10, 10, 0>} : (tensor<10x120x120x100x100x100xf32>) -> tensor<1x12x12x10x10x10xf32>
917+
return %1 : tensor<1x12x12x10x10x10xf32>
918+
}
919+
920+
// -----
921+
911922
// CHECK-LABEL: func.func @canonicalize_self_concat_slice
912923
// CHECK-SAME: ([[PARAM_0_:%.+]]: tensor<1x2x3x4xf32>) -> tensor<1x2x3x4xf32> {
913924
// CHECK: return [[PARAM_0_]] : tensor<1x2x3x4xf32>

0 commit comments

Comments
 (0)