[Mlir-commits] [mlir] 1e4e891 - [mlir][sme][nfc] Split tests into a separate file

Andrzej Warzynski llvmlistbot at llvm.org
Fri Aug 11 05:51:26 PDT 2023


Author: Andrzej Warzynski
Date: 2023-08-11T12:50:47Z
New Revision: 1e4e8914568750d2a5ee7ed13f66b1478522d515

URL: https://github.com/llvm/llvm-project/commit/1e4e8914568750d2a5ee7ed13f66b1478522d515
DIFF: https://github.com/llvm/llvm-project/commit/1e4e8914568750d2a5ee7ed13f66b1478522d515.diff

LOG: [mlir][sme][nfc] Split tests into a separate file

As per the suggestion in https://reviews.llvm.org/D156980, moving tests
for `arith.constant dense<0>` to a dedicated file

Added: 
    mlir/test/Dialect/ArmSME/arith-ops-to-sme.mlir

Modified: 
    mlir/test/Dialect/ArmSME/vector-ops-to-sme.mlir

Removed: 
    


################################################################################
diff  --git a/mlir/test/Dialect/ArmSME/arith-ops-to-sme.mlir b/mlir/test/Dialect/ArmSME/arith-ops-to-sme.mlir
new file mode 100644
index 00000000000000..a08646cdca9aef
--- /dev/null
+++ b/mlir/test/Dialect/ArmSME/arith-ops-to-sme.mlir
@@ -0,0 +1,85 @@
+// RUN: mlir-opt %s -convert-vector-to-arm-sme -split-input-file -allow-unregistered-dialect | FileCheck %s
+
+// =============================================================================
+// arith.constant dense<0> to arm_sme.zero
+// =============================================================================
+
+// -----
+
+// CHECK-LABEL: @arith_constant_dense_2d_zero_i8
+// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[16]x[16]xi8>
+func.func @arith_constant_dense_2d_zero_i8() {
+  %zero = arith.constant dense<0> : vector<[16]x[16]xi8>
+  "prevent.dce"(%zero) : (vector<[16]x[16]xi8>) -> ()
+  return
+}
+
+// -----
+
+// CHECK-LABEL: @arith_constant_dense_2d_zero_i16
+// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[8]x[8]xi16>
+func.func @arith_constant_dense_2d_zero_i16() {
+  %zero = arith.constant dense<0> : vector<[8]x[8]xi16>
+  "prevent.dce"(%zero) : (vector<[8]x[8]xi16>) -> ()
+  return
+}
+
+// -----
+
+// CHECK-LABEL: @arith_constant_dense_2d_zero_i32
+// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[4]x[4]xi32>
+func.func @arith_constant_dense_2d_zero_i32() {
+  %zero = arith.constant dense<0> : vector<[4]x[4]xi32>
+  "prevent.dce"(%zero) : (vector<[4]x[4]xi32>) -> ()
+  return
+}
+
+// -----
+
+// CHECK-LABEL: @arith_constant_dense_2d_zero_i64
+// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[2]x[2]xi64>
+func.func @arith_constant_dense_2d_zero_i64() {
+  %zero = arith.constant dense<0> : vector<[2]x[2]xi64>
+  "prevent.dce"(%zero) : (vector<[2]x[2]xi64>) -> ()
+  return
+}
+
+// -----
+
+// CHECK-LABEL: @arith_constant_dense_2d_zero_f16
+// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[8]x[8]xf16>
+func.func @arith_constant_dense_2d_zero_f16() {
+  %zero = arith.constant dense<0.0> : vector<[8]x[8]xf16>
+  "prevent.dce"(%zero) : (vector<[8]x[8]xf16>) -> ()
+  return
+}
+
+// -----
+
+// CHECK-LABEL: @arith_constant_dense_2d_zero_bf16
+// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[8]x[8]xbf16>
+func.func @arith_constant_dense_2d_zero_bf16() {
+  %zero = arith.constant dense<0.0> : vector<[8]x[8]xbf16>
+  "prevent.dce"(%zero) : (vector<[8]x[8]xbf16>) -> ()
+  return
+}
+
+// -----
+
+// CHECK-LABEL: @arith_constant_dense_2d_zero_f32
+// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[4]x[4]xf32>
+func.func @arith_constant_dense_2d_zero_f32() {
+  %zero = arith.constant dense<0.0> : vector<[4]x[4]xf32>
+  "prevent.dce"(%zero) : (vector<[4]x[4]xf32>) -> ()
+  return
+}
+
+// -----
+
+// CHECK-LABEL: @arith_constant_dense_2d_zero_f64
+// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[2]x[2]xf64>
+func.func @arith_constant_dense_2d_zero_f64() {
+  %zero = arith.constant dense<0.0> : vector<[2]x[2]xf64>
+  "prevent.dce"(%zero) : (vector<[2]x[2]xf64>) -> ()
+  return
+}

diff  --git a/mlir/test/Dialect/ArmSME/vector-ops-to-sme.mlir b/mlir/test/Dialect/ArmSME/vector-ops-to-sme.mlir
index 87ed185947adc6..76e601da73738d 100644
--- a/mlir/test/Dialect/ArmSME/vector-ops-to-sme.mlir
+++ b/mlir/test/Dialect/ArmSME/vector-ops-to-sme.mlir
@@ -153,87 +153,3 @@ func.func @transfer_write_2d_zero__non_memref_type(%arg0 : tensor<?x?xi8>) -> te
   %0 = vector.transfer_write %cst, %arg0[%c0, %c0] {in_bounds = [true, true]} : vector<[16]x[16]xi8>, tensor<?x?xi8>
   return %0 : tensor<?x?xi8>
 }
-
-// =============================================================================
-// arith.constant dense<0> to arm_sme.zero
-// =============================================================================
-
-// -----
-
-// CHECK-LABEL: @arith_constant_dense_2d_zero_i8
-// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[16]x[16]xi8>
-func.func @arith_constant_dense_2d_zero_i8() {
-  %zero = arith.constant dense<0> : vector<[16]x[16]xi8>
-  "prevent.dce"(%zero) : (vector<[16]x[16]xi8>) -> ()
-  return
-}
-
-// -----
-
-// CHECK-LABEL: @arith_constant_dense_2d_zero_i16
-// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[8]x[8]xi16>
-func.func @arith_constant_dense_2d_zero_i16() {
-  %zero = arith.constant dense<0> : vector<[8]x[8]xi16>
-  "prevent.dce"(%zero) : (vector<[8]x[8]xi16>) -> ()
-  return
-}
-
-// -----
-
-// CHECK-LABEL: @arith_constant_dense_2d_zero_i32
-// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[4]x[4]xi32>
-func.func @arith_constant_dense_2d_zero_i32() {
-  %zero = arith.constant dense<0> : vector<[4]x[4]xi32>
-  "prevent.dce"(%zero) : (vector<[4]x[4]xi32>) -> ()
-  return
-}
-
-// -----
-
-// CHECK-LABEL: @arith_constant_dense_2d_zero_i64
-// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[2]x[2]xi64>
-func.func @arith_constant_dense_2d_zero_i64() {
-  %zero = arith.constant dense<0> : vector<[2]x[2]xi64>
-  "prevent.dce"(%zero) : (vector<[2]x[2]xi64>) -> ()
-  return
-}
-
-// -----
-
-// CHECK-LABEL: @arith_constant_dense_2d_zero_f16
-// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[8]x[8]xf16>
-func.func @arith_constant_dense_2d_zero_f16() {
-  %zero = arith.constant dense<0.0> : vector<[8]x[8]xf16>
-  "prevent.dce"(%zero) : (vector<[8]x[8]xf16>) -> ()
-  return
-}
-
-// -----
-
-// CHECK-LABEL: @arith_constant_dense_2d_zero_bf16
-// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[8]x[8]xbf16>
-func.func @arith_constant_dense_2d_zero_bf16() {
-  %zero = arith.constant dense<0.0> : vector<[8]x[8]xbf16>
-  "prevent.dce"(%zero) : (vector<[8]x[8]xbf16>) -> ()
-  return
-}
-
-// -----
-
-// CHECK-LABEL: @arith_constant_dense_2d_zero_f32
-// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[4]x[4]xf32>
-func.func @arith_constant_dense_2d_zero_f32() {
-  %zero = arith.constant dense<0.0> : vector<[4]x[4]xf32>
-  "prevent.dce"(%zero) : (vector<[4]x[4]xf32>) -> ()
-  return
-}
-
-// -----
-
-// CHECK-LABEL: @arith_constant_dense_2d_zero_f64
-// CHECK: %[[ZERO:.*]] = arm_sme.zero : vector<[2]x[2]xf64>
-func.func @arith_constant_dense_2d_zero_f64() {
-  %zero = arith.constant dense<0.0> : vector<[2]x[2]xf64>
-  "prevent.dce"(%zero) : (vector<[2]x[2]xf64>) -> ()
-  return
-}


        


More information about the Mlir-commits mailing list