@@ -691,6 +691,31 @@ func.func @tile_fold(%arg0: tensor<3x4xf32>) -> tensor<3x4xf32> {
691691
692692// -----
693693
694+ // CHECK-LABEL: func.func @tile_fold_consecutive
695+ func.func @tile_fold_consecutive (%arg0: tensor <3 x4 xf32 >) -> tensor <6 x16 xf32 > {
696+ // CHECK-SAME: ([[PARAM_0_:%.+]]: tensor<3x4xf32>) -> tensor<6x16xf32> {
697+ // CHECK: [[VAR_0_:%.+]] = tosa.tile [[PARAM_0_]] {multiples = array<i64: 2, 4>} : (tensor<3x4xf32>) -> tensor<6x16xf32>
698+ // CHECK: return [[VAR_0_]] : tensor<6x16xf32>
699+ %0 = tosa.tile %arg0 { multiples = array<i64 : 1 , 2 > }: (tensor <3 x4 xf32 >) -> tensor <3 x8 xf32 >
700+ %1 = tosa.tile %0 { multiples = array<i64 : 2 , 2 > }: (tensor <3 x8 xf32 >) -> tensor <6 x16 xf32 >
701+ return %1 : tensor <6 x16 xf32 >
702+ }
703+
704+ // -----
705+
706+ // CHECK-LABEL: func.func @tile_no_fold_consecutive_multi_use
707+ func.func @tile_no_fold_consecutive_multi_use (%arg0: tensor <3 x4 xf32 >) -> (tensor <3 x8 xf32 >, tensor <6 x16 xf32 >) {
708+ // CHECK-SAME: ([[PARAM_0_:%.+]]: tensor<3x4xf32>) -> (tensor<3x8xf32>, tensor<6x16xf32>) {
709+ // CHECK: [[VAR_0_:%.+]] = tosa.tile [[PARAM_0_]] {multiples = array<i64: 1, 2>} : (tensor<3x4xf32>) -> tensor<3x8xf32>
710+ // CHECK: [[VAR_1_:%.+]] = tosa.tile [[VAR_0_]] {multiples = array<i64: 2, 2>} : (tensor<3x8xf32>) -> tensor<6x16xf32>
711+ // CHECK: return [[VAR_0_]], [[VAR_1_]] : tensor<3x8xf32>, tensor<6x16xf32>
712+ %0 = tosa.tile %arg0 { multiples = array<i64 : 1 , 2 > }: (tensor <3 x4 xf32 >) -> tensor <3 x8 xf32 >
713+ %1 = tosa.tile %0 { multiples = array<i64 : 2 , 2 > }: (tensor <3 x8 xf32 >) -> tensor <6 x16 xf32 >
714+ return %0 , %1 : tensor <3 x8 xf32 >, tensor <6 x16 xf32 >
715+ }
716+
717+ // -----
718+
694719// CHECK-LABEL: @tile_nofold
695720func.func @tile_nofold (%arg0: tensor <3 x4 xf32 >) -> tensor <3 x8 xf32 > {
696721 // CHECK: tosa.tile
0 commit comments