Skip to content

Commit 844fe8f

Browse files
authored
[mlir][nfc] Rename @genbool_* as @constant_mask_* (#115335)
Renames `@genbool_*` tests as `@constant_mask_*`. That's to better highlight which Op is tested and for better consistency with other test. In addition,`@genbool_2d` is moved _above_ it's counterparts with scalable vectors (again, for consistency).
1 parent b0cfbfd commit 844fe8f

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2685,61 +2685,77 @@ func.func @matrix_ops_index(%A: vector<64xindex>, %B: vector<48xindex>) -> vecto
26852685

26862686
// -----
26872687

2688-
func.func @genbool_0d_f() -> vector<i1> {
2688+
func.func @constant_mask_0d_f() -> vector<i1> {
26892689
%0 = vector.constant_mask [0] : vector<i1>
26902690
return %0 : vector<i1>
26912691
}
2692-
// CHECK-LABEL: func @genbool_0d_f
2692+
// CHECK-LABEL: func @constant_mask_0d_f
26932693
// CHECK: %[[VAL_0:.*]] = arith.constant dense<false> : vector<i1>
26942694
// CHECK: return %[[VAL_0]] : vector<i1>
26952695

26962696
// -----
26972697

2698-
func.func @genbool_0d_t() -> vector<i1> {
2698+
func.func @constant_mask_0d_t() -> vector<i1> {
26992699
%0 = vector.constant_mask [1] : vector<i1>
27002700
return %0 : vector<i1>
27012701
}
2702-
// CHECK-LABEL: func @genbool_0d_t
2702+
// CHECK-LABEL: func @constant_mask_0d_t
27032703
// CHECK: %[[VAL_0:.*]] = arith.constant dense<true> : vector<i1>
27042704
// CHECK: return %[[VAL_0]] : vector<i1>
27052705

27062706
// -----
27072707

2708-
func.func @genbool_1d() -> vector<8xi1> {
2708+
func.func @constant_mask_1d() -> vector<8xi1> {
27092709
%0 = vector.constant_mask [4] : vector<8xi1>
27102710
return %0 : vector<8xi1>
27112711
}
2712-
// CHECK-LABEL: func @genbool_1d
2712+
// CHECK-LABEL: func @constant_mask_1d
27132713
// CHECK: %[[VAL_0:.*]] = arith.constant dense<[true, true, true, true, false, false, false, false]> : vector<8xi1>
27142714
// CHECK: return %[[VAL_0]] : vector<8xi1>
27152715

27162716
// -----
27172717

2718-
func.func @genbool_1d_scalable_all_false() -> vector<[8]xi1> {
2718+
func.func @constant_mask_1d_scalable_all_false() -> vector<[8]xi1> {
27192719
%0 = vector.constant_mask [0] : vector<[8]xi1>
27202720
return %0 : vector<[8]xi1>
27212721
}
2722-
// CHECK-LABEL: func @genbool_1d_scalable_all_false
2722+
// CHECK-LABEL: func @constant_mask_1d_scalable_all_false
27232723
// CHECK: %[[VAL_0:.*]] = arith.constant dense<false> : vector<[8]xi1>
27242724
// CHECK: return %[[VAL_0]] : vector<[8]xi1>
27252725

27262726
// -----
27272727

2728-
func.func @genbool_1d_scalable_all_true() -> vector<[8]xi1> {
2728+
func.func @constant_mask_1d_scalable_all_true() -> vector<[8]xi1> {
27292729
%0 = vector.constant_mask [8] : vector<[8]xi1>
27302730
return %0 : vector<[8]xi1>
27312731
}
2732-
// CHECK-LABEL: func @genbool_1d_scalable_all_true
2732+
// CHECK-LABEL: func @constant_mask_1d_scalable_all_true
27332733
// CHECK: %[[VAL_0:.*]] = arith.constant dense<true> : vector<[8]xi1>
27342734
// CHECK: return %[[VAL_0]] : vector<[8]xi1>
27352735

27362736
// -----
27372737

2738-
func.func @genbool_2d_trailing_scalable() -> vector<4x[4]xi1> {
2738+
func.func @constant_mask_2d() -> vector<4x4xi1> {
2739+
%v = vector.constant_mask [2, 2] : vector<4x4xi1>
2740+
return %v: vector<4x4xi1>
2741+
}
2742+
2743+
// CHECK-LABEL: func @constant_mask_2d
2744+
// CHECK: %[[VAL_0:.*]] = arith.constant dense<[true, true, false, false]> : vector<4xi1>
2745+
// CHECK: %[[VAL_1:.*]] = arith.constant dense<false> : vector<4x4xi1>
2746+
// CHECK: %[[VAL_2:.*]] = builtin.unrealized_conversion_cast %[[VAL_1]] : vector<4x4xi1> to !llvm.array<4 x vector<4xi1>>
2747+
// CHECK: %[[VAL_3:.*]] = llvm.insertvalue %[[VAL_0]], %[[VAL_2]][0] : !llvm.array<4 x vector<4xi1>>
2748+
// CHECK: %[[VAL_4:.*]] = llvm.insertvalue %[[VAL_0]], %[[VAL_3]][1] : !llvm.array<4 x vector<4xi1>>
2749+
// CHECK: %[[VAL_5:.*]] = builtin.unrealized_conversion_cast %[[VAL_4]] : !llvm.array<4 x vector<4xi1>> to vector<4x4xi1>
2750+
// CHECK: return %[[VAL_5]] : vector<4x4xi1>
2751+
2752+
// -----
2753+
2754+
func.func @constant_mask_2d_trailing_scalable() -> vector<4x[4]xi1> {
27392755
%0 = vector.constant_mask [2, 4] : vector<4x[4]xi1>
27402756
return %0 : vector<4x[4]xi1>
27412757
}
2742-
// CHECK-LABEL: func.func @genbool_2d_trailing_scalable
2758+
// CHECK-LABEL: func.func @constant_mask_2d_trailing_scalable
27432759
// CHECK: %[[VAL_0:.*]] = arith.constant dense<true> : vector<[4]xi1>
27442760
// CHECK: %[[VAL_1:.*]] = arith.constant dense<false> : vector<4x[4]xi1>
27452761
// CHECK: %[[VAL_2:.*]] = builtin.unrealized_conversion_cast %[[VAL_1]] : vector<4x[4]xi1> to !llvm.array<4 x vector<[4]xi1>>
@@ -2752,32 +2768,16 @@ func.func @genbool_2d_trailing_scalable() -> vector<4x[4]xi1> {
27522768

27532769
/// Currently, this is not supported as generating the mask would require
27542770
/// unrolling the leading scalable dimension at compile time.
2755-
func.func @cannot_genbool_2d_leading_scalable() -> vector<[4]x4xi1> {
2771+
func.func @negative_constant_mask_2d_leading_scalable() -> vector<[4]x4xi1> {
27562772
%0 = vector.constant_mask [4, 2] : vector<[4]x4xi1>
27572773
return %0 : vector<[4]x4xi1>
27582774
}
2759-
// CHECK-LABEL: func.func @cannot_genbool_2d_leading_scalable
2775+
// CHECK-LABEL: func.func @negative_constant_mask_2d_leading_scalable
27602776
// CHECK: %[[VAL_0:.*]] = vector.constant_mask [4, 2] : vector<[4]x4xi1>
27612777
// CHECK: return %[[VAL_0]] : vector<[4]x4xi1>
27622778

27632779
// -----
27642780

2765-
func.func @genbool_2d() -> vector<4x4xi1> {
2766-
%v = vector.constant_mask [2, 2] : vector<4x4xi1>
2767-
return %v: vector<4x4xi1>
2768-
}
2769-
2770-
// CHECK-LABEL: func @genbool_2d
2771-
// CHECK: %[[VAL_0:.*]] = arith.constant dense<[true, true, false, false]> : vector<4xi1>
2772-
// CHECK: %[[VAL_1:.*]] = arith.constant dense<false> : vector<4x4xi1>
2773-
// CHECK: %[[VAL_2:.*]] = builtin.unrealized_conversion_cast %[[VAL_1]] : vector<4x4xi1> to !llvm.array<4 x vector<4xi1>>
2774-
// CHECK: %[[VAL_3:.*]] = llvm.insertvalue %[[VAL_0]], %[[VAL_2]][0] : !llvm.array<4 x vector<4xi1>>
2775-
// CHECK: %[[VAL_4:.*]] = llvm.insertvalue %[[VAL_0]], %[[VAL_3]][1] : !llvm.array<4 x vector<4xi1>>
2776-
// CHECK: %[[VAL_5:.*]] = builtin.unrealized_conversion_cast %[[VAL_4]] : !llvm.array<4 x vector<4xi1>> to vector<4x4xi1>
2777-
// CHECK: return %[[VAL_5]] : vector<4x4xi1>
2778-
2779-
// -----
2780-
27812781
func.func @create_mask_0d(%a : index) -> vector<i1> {
27822782
%v = vector.create_mask %a : vector<i1>
27832783
return %v: vector<i1>

0 commit comments

Comments
 (0)