@@ -1068,16 +1068,16 @@ module attributes {transform.with_named_sequence} {
1068
1068
// CHECK-SAME: %[[DEST:.*]]: tensor<?x?xf32>,
1069
1069
// CHECK-SAME: %[[SRC:.*]]: tensor<?x?x16x2xf32>
1070
1070
func.func @test_vectorize_dynamic_shapes_unpack_scalable_vec (%dest: tensor <?x?xf32 >, %src: tensor <?x?x16 x2 xf32 >) -> tensor <?x?xf32 > {
1071
- // CHECK: %[[CST :.*]] = arith.constant 0.000000e+00
1072
- // CHECK: %[[C01:.*]] = arith.constant 0
1073
- // CHECK: %[[C02:.*]] = arith.constant 0
1071
+ // CHECK-DAG : %[[PAD :.*]] = ub.poison : f32
1072
+ // CHECK-DAG : %[[C01:.*]] = arith.constant 0
1073
+ // CHECK-DAG : %[[C02:.*]] = arith.constant 0
1074
1074
// CHECK: %[[DIM4:.*]] = tensor.dim %[[SRC]], %[[C02]] : tensor<?x?x16x2xf32>
1075
1075
// CHECK: %[[CNST14:.*]] = arith.constant 1
1076
1076
// CHECK: %[[DIM6:.*]] = tensor.dim %[[SRC]], %[[CNST14]] : tensor<?x?x16x2xf32>
1077
1077
// CHECK: %[[CNST16:.*]] = arith.constant 16 : index
1078
1078
// CHECK: %[[CNST2:.*]] = arith.constant 2 : index
1079
1079
// CHECK: %[[MASK_READ:.*]] = vector.create_mask %[[DIM4]], %[[DIM6]], %[[CNST16]], %[[CNST2]] : vector<2x1x[16]x2xi1>
1080
- // CHECK: %[[READ:.*]] = vector.mask %[[MASK_READ]] {{.*}} vector.transfer_read %{{.*}} : tensor<?x?x16x2xf32>, vector<2x1x[16]x2xf32> } : vector<2x1x[16]x2xi1> -> vector<2x1x[16]x2xf32>
1080
+ // CHECK: %[[READ:.*]] = vector.mask %[[MASK_READ]] {{.*}} vector.transfer_read %{{.*}} %[[PAD]] {{.*}} : tensor<?x?x16x2xf32>, vector<2x1x[16]x2xf32> } : vector<2x1x[16]x2xi1> -> vector<2x1x[16]x2xf32>
1081
1081
// CHECK: %[[TR:.*]] = vector.transpose %[[READ]], [0, 3, 1, 2] : vector<2x1x[16]x2xf32> to vector<2x2x1x[16]xf32>
1082
1082
// CHECK: %[[SC:.*]] = vector.shape_cast %[[TR]] : vector<2x2x1x[16]xf32> to vector<4x[16]xf32>
1083
1083
// CHECK: %[[MASK_WRITE:.*]] = vector.create_mask {{.*}} : vector<4x[16]xi1>
@@ -1100,17 +1100,17 @@ module attributes {transform.with_named_sequence} {
1100
1100
// CHECK-SAME: %[[DEST:.*]]: tensor<?x?xf32>,
1101
1101
// CHECK-SAME: %[[SRC:.*]]: tensor<?x?x?x2xf32>
1102
1102
func.func @test_vectorize_dynamic_shapes_unpack_scalable_vec_and_tile_size (%dest: tensor <?x?xf32 >, %src: tensor <?x?x?x2 xf32 >) -> tensor <?x?xf32 > {
1103
- // CHECK: %[[CST :.*]] = arith.constant 0.000000e+00
1104
- // CHECK: %[[C01:.*]] = arith.constant 0
1105
- // CHECK: %[[C02:.*]] = arith.constant 0
1103
+ // CHECK-DAG : %[[PAD :.*]] = ub.poison : f32
1104
+ // CHECK-DAG : %[[C01:.*]] = arith.constant 0
1105
+ // CHECK-DAG : %[[C02:.*]] = arith.constant 0
1106
1106
// CHECK: %[[DIM4:.*]] = tensor.dim %[[SRC]], %[[C02]] : tensor<?x?x?x2xf32>
1107
1107
// CHECK: %[[C1_2:.*]] = arith.constant 1
1108
1108
// CHECK: %[[DIM6:.*]] = tensor.dim %[[SRC]], %[[C1_2]] : tensor<?x?x?x2xf32>
1109
1109
// CHECK: %[[C2:.*]] = arith.constant 2 : index
1110
1110
// CHECK: %[[DIM_2:.*]] = tensor.dim %[[SRC]], %[[C2]] : tensor<?x?x?x2xf32>
1111
1111
// CHECK: %[[C2_1:.*]] = arith.constant 2 : index
1112
1112
// CHECK: %[[MASK_READ:.*]] = vector.create_mask %[[DIM4]], %[[DIM6]], %[[DIM_2]], %[[C2_1]] : vector<2x1x[16]x2xi1>
1113
- // CHECK: %[[READ:.*]] = vector.mask %[[MASK_READ]] {{.*}} vector.transfer_read %{{.*}} : tensor<?x?x?x2xf32>, vector<2x1x[16]x2xf32> } : vector<2x1x[16]x2xi1> -> vector<2x1x[16]x2xf32>
1113
+ // CHECK: %[[READ:.*]] = vector.mask %[[MASK_READ]] {{.*}} vector.transfer_read %{{.*}} %[[PAD]] {{.*}} : tensor<?x?x?x2xf32>, vector<2x1x[16]x2xf32> } : vector<2x1x[16]x2xi1> -> vector<2x1x[16]x2xf32>
1114
1114
// CHECK: %[[TR:.*]] = vector.transpose %[[READ]], [0, 3, 1, 2] : vector<2x1x[16]x2xf32> to vector<2x2x1x[16]xf32>
1115
1115
// CHECK: %[[SC:.*]] = vector.shape_cast %[[TR]] : vector<2x2x1x[16]xf32> to vector<4x[16]xf32>
1116
1116
// CHECK: %[[MASK_WRITE:.*]] = vector.create_mask {{.*}} : vector<4x[16]xi1>
@@ -1138,14 +1138,14 @@ module attributes {transform.with_named_sequence} {
1138
1138
// CHECK-SAME: %[[SRC:.*]]: tensor<8x8x32x16xf32>
1139
1139
// CHECK-SAME: %[[DEST:.*]]: tensor<256x128xf32>
1140
1140
func.func @test_vectorize_unpack (%source: tensor <8 x8 x32 x16 xf32 >, %dest: tensor <256 x128 xf32 >) -> tensor <256 x128 xf32 > {
1141
- // CHECK: %[[CST :.*]] = arith.constant 0.000000e+00 : f32
1142
- // CHECK: %[[C0:.*]]= arith.constant 0 : index
1143
- // CHECK: %[[C8:.*]] = arith.constant 8 : index
1144
- // CHECK: %[[C80:.*]] = arith.constant 8 : index
1145
- // CHECK: %[[C32:.*]] = arith.constant 32 : index
1146
- // CHECK: %[[C16:.*]] = arith.constant 16 : index
1141
+ // CHECK-DAG : %[[PAD :.*]] = ub.poison : f32
1142
+ // CHECK-DAG : %[[C0:.*]]= arith.constant 0 : index
1143
+ // CHECK-DAG : %[[C8:.*]] = arith.constant 8 : index
1144
+ // CHECK-DAG : %[[C80:.*]] = arith.constant 8 : index
1145
+ // CHECK-DAG : %[[C32:.*]] = arith.constant 32 : index
1146
+ // CHECK-DAG : %[[C16:.*]] = arith.constant 16 : index
1147
1147
// CHECK: %[[MSK0:.*]] = vector.create_mask %[[C8]], %[[C80]], %[[C32]], %[[C16]] : vector<16x8x32x16xi1>
1148
- // CHECK: %[[READ0:.*]] = vector.mask %[[MSK0]] { vector.transfer_read %[[SRC]]{{.*}}} : vector<16x8x32x16xi1> -> vector<16x8x32x16xf32>
1148
+ // CHECK: %[[READ0:.*]] = vector.mask %[[MSK0]] { vector.transfer_read %[[SRC]]{{.*}} %[[PAD]] {{.*} } : vector<16x8x32x16xi1> -> vector<16x8x32x16xf32>
1149
1149
// CHECK: %[[TRANSP0:.*]] = vector.transpose %[[READ0]], [0, 2, 1, 3] : vector<16x8x32x16xf32> to vector<16x32x8x16xf32>
1150
1150
// CHECK: %[[SHAPC:.*]] = vector.shape_cast %[[TRANSP0]] : vector<16x32x8x16xf32> to vector<512x128xf32>
1151
1151
// CHECK: %[[C01:.*]] = arith.constant 0 : index
@@ -1171,9 +1171,9 @@ func.func @test_vectorize_unpack(%source: tensor<8x8x32x16xf32>, %dest: tensor<2
1171
1171
// CHECK-SAME: %[[SRC:.*]]: tensor<8x8x32x16xf32>
1172
1172
// CHECK-SAME: %[[DEST:.*]]: tensor<256x128xf32>
1173
1173
func.func @test_vectorize_unpack_no_masks (%source: tensor <8 x8 x32 x16 xf32 >, %dest: tensor <256 x128 xf32 >) -> tensor <256 x128 xf32 > {
1174
- // CHECK: %[[CST :.*]] = arith.constant 0.000000e+00 : f32
1175
- // CHECK: %[[C0:.*]] = arith.constant 0 : index
1176
- // CHECK: %[[READ:.*]] = vector.transfer_read %[[SRC]]{{.*}}} : tensor<8x8x32x16xf32>, vector<8x8x32x16xf32>
1174
+ // CHECK-DAG : %[[PAD :.*]] = ub.poison : f32
1175
+ // CHECK-AD : %[[C0:.*]] = arith.constant 0 : index
1176
+ // CHECK: %[[READ:.*]] = vector.transfer_read %[[SRC]]{{.*}} %[[PAD]] {{.*} } : tensor<8x8x32x16xf32>, vector<8x8x32x16xf32>
1177
1177
// CHECK: %[[TRANSP:.*]] = vector.transpose %[[READ]], [0, 2, 1, 3] : vector<8x8x32x16xf32> to vector<8x32x8x16xf32>
1178
1178
// CHECK: %[[SHAPC:.*]] = vector.shape_cast %[[TRANSP]] : vector<8x32x8x16xf32> to vector<256x128xf32>
1179
1179
// CHECK: %[[C00:.*]] = arith.constant 0 : index
@@ -1196,9 +1196,9 @@ func.func @test_vectorize_unpack_no_masks(%source: tensor<8x8x32x16xf32>, %dest:
1196
1196
// CHECK-SAME: %[[SRC:.*]]: tensor<8x8x32x16xf32>
1197
1197
// CHECK-SAME: %[[DEST:.*]]: tensor<256x128xf32>
1198
1198
func.func @test_vectorize_unpack_with_outer_perm (%source: tensor <8 x8 x32 x16 xf32 >, %dest: tensor <256 x128 xf32 >) -> tensor <256 x128 xf32 > {
1199
- // CHECK: %[[CST :.*]] = arith.constant 0.000000e+00 : f32
1200
- // CHECK: %[[C0:.*]] = arith.constant 0 : index
1201
- // CHECK: %[[READ:.*]] = vector.transfer_read %[[SRC]]{{.*}}} : tensor<8x8x32x16xf32>, vector<8x8x32x16xf32>
1199
+ // CHECK-DAG : %[[PAD :.*]] = ub.poison : f32
1200
+ // CHECK-DAG : %[[C0:.*]] = arith.constant 0 : index
1201
+ // CHECK: %[[READ:.*]] = vector.transfer_read %[[SRC]]{{.*}} %[[PAD]] {{.*} } : tensor<8x8x32x16xf32>, vector<8x8x32x16xf32>
1202
1202
// CHECK: %[[TRANSP:.*]] = vector.transpose %[[READ]], [1, 2, 0, 3] : vector<8x8x32x16xf32> to vector<8x32x8x16xf32>
1203
1203
// CHECK: %[[SHAPC:.*]] = vector.shape_cast %[[TRANSP]] : vector<8x32x8x16xf32> to vector<256x128xf32>
1204
1204
// CHECK: %[[C00:.*]] = arith.constant 0 : index
@@ -1221,9 +1221,9 @@ func.func @test_vectorize_unpack_no_masks(%source: tensor<8x8x32x16xf32>, %dest:
1221
1221
// CHECK-SAME: %[[SRC:.*]]: tensor<8x8x32x16xf32>
1222
1222
// CHECK-SAME: %[[DEST:.*]]: tensor<256x128xf32>
1223
1223
func.func @test_vectorize_unpack_no_vector_sizes (%source: tensor <8 x8 x32 x16 xf32 >, %dest: tensor <256 x128 xf32 >) -> tensor <256 x128 xf32 > {
1224
- // CHECK: %[[CST :.*]] = arith.constant 0.000000e+00 : f32
1225
- // CHECK: %[[C0:.*]] = arith.constant 0 : index
1226
- // CHECK: %[[READ:.*]] = vector.transfer_read %[[SRC]]{{.*}}} : tensor<8x8x32x16xf32>, vector<8x8x32x16xf32>
1224
+ // CHECK-DAG : %[[PAD :.*]] = ub.poison : f32
1225
+ // CHECK-DAG : %[[C0:.*]] = arith.constant 0 : index
1226
+ // CHECK: %[[READ:.*]] = vector.transfer_read %[[SRC]]{{.*}} %[[PAD]] {{.*} } : tensor<8x8x32x16xf32>, vector<8x8x32x16xf32>
1227
1227
// CHECK: %[[TRANSP:.*]] = vector.transpose %[[READ]], [0, 2, 1, 3] : vector<8x8x32x16xf32> to vector<8x32x8x16xf32>
1228
1228
// CHECK: %[[SHAPC:.*]] = vector.shape_cast %[[TRANSP]] : vector<8x32x8x16xf32> to vector<256x128xf32>
1229
1229
// CHECK: %[[C00:.*]] = arith.constant 0 : index
@@ -1246,9 +1246,9 @@ func.func @test_vectorize_unpack_no_vector_sizes(%source: tensor<8x8x32x16xf32>,
1246
1246
// CHECK-SAME: %[[SRC:.*]]: tensor<8x4x16x16xf32>
1247
1247
// CHECK-SAME: %[[DEST:.*]]: tensor<64x127xf32>
1248
1248
func.func @test_vectorize_unpack_no_vector_sizes_slice_output (%source: tensor <8 x4 x16 x16 xf32 >, %dest: tensor <64 x127 xf32 >) -> tensor <64 x127 xf32 > {
1249
- // CHECK: %[[CST :.*]] = arith.constant 0.000000e+00 : f32
1250
- // CHECK: %[[C0:.*]] = arith.constant 0 : index
1251
- // CHECK: %[[READ:.*]] = vector.transfer_read %[[SRC]]{{.*}}} : tensor<8x4x16x16xf32>, vector<8x4x16x16xf32>
1249
+ // CHECK-DAG : %[[PAD :.*]] = ub.poison : f32
1250
+ // CHECK-DAG : %[[C0:.*]] = arith.constant 0 : index
1251
+ // CHECK: %[[READ:.*]] = vector.transfer_read %[[SRC]]{{.*}} %[[PAD]] {{.*} } : tensor<8x4x16x16xf32>, vector<8x4x16x16xf32>
1252
1252
// CHECK: %[[TRANSP:.*]] = vector.transpose %[[READ]], [1, 2, 0, 3] : vector<8x4x16x16xf32> to vector<4x16x8x16xf32>
1253
1253
// CHECK: %[[SHAPC:.*]] = vector.shape_cast %[[TRANSP]] : vector<4x16x8x16xf32> to vector<64x128xf32>
1254
1254
// CHECK: %[[C00:.*]] = arith.constant 0 : index
@@ -1275,9 +1275,9 @@ func.func @test_vectorize_unpack_no_vector_sizes_permute(%source: tensor<4x7x4xf
1275
1275
%0 = linalg.unpack %source outer_dims_perm =[1 , 0 ] inner_dims_pos = [1 ] inner_tiles = [4 ] into %dest : tensor <4 x7 x4 xf32 > -> tensor <7 x16 xf32 >
1276
1276
return %0 : tensor <7 x16 xf32 >
1277
1277
}
1278
- // CHECK: %[[CST :.*]] = arith.constant 0.000000e+00 : f32
1279
- // CHECK: %[[C0:.*]] = arith.constant 0 : index
1280
- // CHECK: %[[READ:.*]] = vector.transfer_read %[[SRC]]{{.*}}} : tensor<4x7x4xf32>, vector<4x7x4xf32>
1278
+ // CHECK-DAG : %[[PAD :.*]] = ub.poison : f32
1279
+ // CHECK-DAG : %[[C0:.*]] = arith.constant 0 : index
1280
+ // CHECK: %[[READ:.*]] = vector.transfer_read %[[SRC]]{{.*}} %[[PAD]] {{.*} } : tensor<4x7x4xf32>, vector<4x7x4xf32>
1281
1281
// CHECK: %[[TRANSP:.*]] = vector.transpose %[[READ]], [1, 0, 2] : vector<4x7x4xf32> to vector<7x4x4xf32>
1282
1282
// CHECK: %[[SHAPC:.*]] = vector.shape_cast %[[TRANSP]] : vector<7x4x4xf32> to vector<7x16xf32>
1283
1283
// CHECK: %[[C00:.*]] = arith.constant 0 : index
0 commit comments