[Mlir-commits] [mlir] [mlir][vector][test] Split tests from vector-transfer-flatten.mlir (PR #102584)

Benjamin Maxwell llvmlistbot at llvm.org
Fri Aug 9 06:09:31 PDT 2024


================
@@ -538,186 +538,6 @@ func.func @transfer_write_non_contiguous_src(
 
 // -----
 
-///----------------------------------------------------------------------------------------
-/// [Pattern: DropUnitDimFromElementwiseOps]
-///
-/// TODO: Move to a dedicated file - there's no "flattening" in the following tests
-/// TODO: Potential duplication with tests from:
-///   * "vector-dropleadunitdim-transforms.mlir" 
-///   * "vector-transfer-drop-unit-dims-patterns.mlir"
-///----------------------------------------------------------------------------------------
-
-func.func @fold_unit_dim_add_basic(%vec : vector<1x8xi32>) -> vector<1x8xi32> {
-   %res = arith.addi %vec, %vec : vector<1x8xi32>
-   return %res : vector<1x8xi32>
-}
-// CHECK-LABEL:   func.func @fold_unit_dim_add_basic(
-// CHECK-SAME:      %[[VAL_0:.*]]: vector<1x8xi32>) -> vector<1x8xi32> {
-// CHECK:           %[[VAL_1:.*]] = vector.shape_cast %[[VAL_0]] : vector<1x8xi32> to vector<8xi32>
-// CHECK:           %[[VAL_2:.*]] = vector.shape_cast %[[VAL_0]] : vector<1x8xi32> to vector<8xi32>
-// CHECK:           %[[VAL_3:.*]] = arith.addi %[[VAL_1]], %[[VAL_2]] : vector<8xi32>
-// CHECK:           %[[VAL_4:.*]] = vector.shape_cast %[[VAL_3]] : vector<8xi32> to vector<1x8xi32>
-// CHECK:           return %[[VAL_4]] : vector<1x8xi32>
-
-// CHECK-128B-LABEL: func @fold_unit_dim_add_basic(
-//   CHECK-128B-NOT:   memref.collapse_shape
-
-// -----
-
-func.func @fold_unit_dim_add_leading_and_trailing(%vec : vector<1x8x1xi32>) -> vector<1x8x1xi32> {
-   %res = arith.addi %vec, %vec : vector<1x8x1xi32>
-   return %res : vector<1x8x1xi32>
-}
-// CHECK-LABEL:   func.func @fold_unit_dim_add_leading_and_trailing(
-// CHECK-SAME:      %[[VAL_0:.*]]: vector<1x8x1xi32>) -> vector<1x8x1xi32> {
-// CHECK:           %[[VAL_1:.*]] = vector.shape_cast %[[VAL_0]] : vector<1x8x1xi32> to vector<8xi32>
-// CHECK:           %[[VAL_2:.*]] = vector.shape_cast %[[VAL_0]] : vector<1x8x1xi32> to vector<8xi32>
-// CHECK:           %[[VAL_3:.*]] = arith.addi %[[VAL_1]], %[[VAL_2]] : vector<8xi32>
-// CHECK:           %[[VAL_4:.*]] = vector.shape_cast %[[VAL_3]] : vector<8xi32> to vector<1x8x1xi32>
-// CHECK:           return %[[VAL_4]] : vector<1x8x1xi32>
-
-// CHECK-128B-LABEL: func @fold_unit_dim_add_leading_and_trailing(
-//   CHECK-128B-NOT:   memref.collapse_shape
-
-// -----
-
-func.func @fold_unit_dim_add(%vec_0 : vector<8x1xi32>,
-                             %vec_1 : vector<1x8xi32>) -> vector<8xi32> {
-   %sc_vec_0 = vector.shape_cast %vec_0 : vector<8x1xi32> to vector<1x8xi32>
-   %add = arith.addi %sc_vec_0, %vec_1 : vector<1x8xi32>
-   %res = vector.shape_cast %add : vector<1x8xi32> to vector<8xi32>
-   return %res : vector<8xi32>
-}
-
-// CHECK-LABEL:   func.func @fold_unit_dim_add(
-// CHECK-SAME:      %[[VAL_0:.*]]: vector<8x1xi32>,
-// CHECK-SAME:      %[[VAL_1:.*]]: vector<1x8xi32>) -> vector<8xi32> {
-// CHECK:           %[[VAL_2:.*]] = vector.shape_cast %[[VAL_0]] : vector<8x1xi32> to vector<8xi32>
-// CHECK:           %[[VAL_3:.*]] = vector.shape_cast %[[VAL_1]] : vector<1x8xi32> to vector<8xi32>
-// CHECK:           %[[VAL_4:.*]] = arith.addi %[[VAL_2]], %[[VAL_3]] : vector<8xi32>
-// CHECK:           return %[[VAL_4]] : vector<8xi32>
-
-// CHECK-128B-LABEL: func @fold_unit_dim_add(
-//   CHECK-128B-NOT:   memref.collapse_shape
----------------
MacDue wrote:

Could you explain that in the summary? I didn't see the reason these were removed there, which is why I asked about it. :slightly_smiling_face: 

https://github.com/llvm/llvm-project/pull/102584


More information about the Mlir-commits mailing list