Skip to content

Commit 0cb98c7

Browse files
authored
[mlir][vector] Replace vector.splat with vector.broadcast in some tests (#152230)
Splat is deprecated, and being prepared for removal in a future release. https://discourse.llvm.org/t/rfc-mlir-vector-deprecate-then-remove-vector-splat/87143/5 The command I used, catches almost every splat op: ``` perl -i -pe 's/vector\.splat\s+(\S+)\s*:\s*vector<((?:\[?\d+\]?x)*)\s*([^>]+)>/vector.broadcast $1 : $3 to vector<$2$3>/g' filename ```
1 parent 44fbeb3 commit 0cb98c7

16 files changed

+53
-53
lines changed

mlir/test/Dialect/Arith/canonicalize.mlir

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ func.func @signExtendConstant() -> i16 {
654654
// CHECK: return %[[cres]]
655655
func.func @signExtendConstantSplat() -> vector<4xi16> {
656656
%c-2 = arith.constant -2 : i8
657-
%splat = vector.splat %c-2 : vector<4xi8>
657+
%splat = vector.broadcast %c-2 : i8 to vector<4xi8>
658658
%ext = arith.extsi %splat : vector<4xi8> to vector<4xi16>
659659
return %ext : vector<4xi16>
660660
}
@@ -682,7 +682,7 @@ func.func @unsignedExtendConstant() -> i16 {
682682
// CHECK: return %[[cres]]
683683
func.func @unsignedExtendConstantSplat() -> vector<4xi16> {
684684
%c2 = arith.constant 2 : i8
685-
%splat = vector.splat %c2 : vector<4xi8>
685+
%splat = vector.broadcast %c2 : i8 to vector<4xi8>
686686
%ext = arith.extui %splat : vector<4xi8> to vector<4xi16>
687687
return %ext : vector<4xi16>
688688
}
@@ -866,7 +866,7 @@ func.func @truncExtsiVector(%arg0: vector<2xi32>) -> vector<2xi16> {
866866
// CHECK: return %[[cres]]
867867
func.func @truncConstantSplat() -> vector<4xi8> {
868868
%c-2 = arith.constant -2 : i16
869-
%splat = vector.splat %c-2 : vector<4xi16>
869+
%splat = vector.broadcast %c-2 : i16 to vector<4xi16>
870870
%trunc = arith.trunci %splat : vector<4xi16> to vector<4xi8>
871871
return %trunc : vector<4xi8>
872872
}
@@ -2334,7 +2334,7 @@ func.func @constant_FPtoUI_splat() -> vector<4xi32> {
23342334
// CHECK: %[[C0:.+]] = arith.constant dense<2> : vector<4xi32>
23352335
// CHECK: return %[[C0]]
23362336
%c0 = arith.constant 2.0 : f32
2337-
%splat = vector.splat %c0 : vector<4xf32>
2337+
%splat = vector.broadcast %c0 : f32 to vector<4xf32>
23382338
%res = arith.fptoui %splat : vector<4xf32> to vector<4xi32>
23392339
return %res : vector<4xi32>
23402340
}
@@ -2374,7 +2374,7 @@ func.func @constant_FPtoSI_splat() -> vector<4xi32> {
23742374
// CHECK: %[[C0:.+]] = arith.constant dense<-2> : vector<4xi32>
23752375
// CHECK: return %[[C0]]
23762376
%c0 = arith.constant -2.0 : f32
2377-
%splat = vector.splat %c0 : vector<4xf32>
2377+
%splat = vector.broadcast %c0 : f32 to vector<4xf32>
23782378
%res = arith.fptosi %splat : vector<4xf32> to vector<4xi32>
23792379
return %res : vector<4xi32>
23802380
}
@@ -2413,7 +2413,7 @@ func.func @constant_SItoFP_splat() -> vector<4xf32> {
24132413
// CHECK: %[[C0:.+]] = arith.constant dense<2.000000e+00> : vector<4xf32>
24142414
// CHECK: return %[[C0]]
24152415
%c0 = arith.constant 2 : i32
2416-
%splat = vector.splat %c0 : vector<4xi32>
2416+
%splat = vector.broadcast %c0 : i32 to vector<4xi32>
24172417
%res = arith.sitofp %splat : vector<4xi32> to vector<4xf32>
24182418
return %res : vector<4xf32>
24192419
}
@@ -2442,7 +2442,7 @@ func.func @constant_UItoFP_splat() -> vector<4xf32> {
24422442
// CHECK: %[[C0:.+]] = arith.constant dense<2.000000e+00> : vector<4xf32>
24432443
// CHECK: return %[[C0]]
24442444
%c0 = arith.constant 2 : i32
2445-
%splat = vector.splat %c0 : vector<4xi32>
2445+
%splat = vector.broadcast %c0 : i32 to vector<4xi32>
24462446
%res = arith.uitofp %splat : vector<4xi32> to vector<4xf32>
24472447
return %res : vector<4xf32>
24482448
}

mlir/test/Dialect/Vector/vector-sink.mlir

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func.func @broadcast_scalar_with_bcast_scalable(%arg1: index, %arg2: index) -> v
4040
// CHECK: %[[BCAST:.*]] = vector.broadcast %[[ADD]] : index to vector<1x4xindex>
4141
// CHECK: return %[[BCAST]] : vector<1x4xindex>
4242
func.func @broadcast_scalar_with_bcast_and_splat(%arg1: index, %arg2: index) -> vector<1x4xindex> {
43-
%0 = vector.splat %arg1 : vector<1x4xindex>
43+
%0 = vector.broadcast %arg1 : index to vector<1x4xindex>
4444
%1 = vector.broadcast %arg2 : index to vector<1x4xindex>
4545
%2 = arith.addi %0, %1 : vector<1x4xindex>
4646
return %2 : vector<1x4xindex>
@@ -53,7 +53,7 @@ func.func @broadcast_scalar_with_bcast_and_splat(%arg1: index, %arg2: index) ->
5353
// CHECK: %[[BCAST:.*]] = vector.broadcast %[[ADD]] : index to vector<1x[4]xindex>
5454
// CHECK: return %[[BCAST]] : vector<1x[4]xindex>
5555
func.func @broadcast_scalar_with_bcast_and_splat_scalable(%arg1: index, %arg2: index) -> vector<1x[4]xindex> {
56-
%0 = vector.splat %arg1 : vector<1x[4]xindex>
56+
%0 = vector.broadcast %arg1 : index to vector<1x[4]xindex>
5757
%1 = vector.broadcast %arg2 : index to vector<1x[4]xindex>
5858
%2 = arith.addi %0, %1 : vector<1x[4]xindex>
5959
return %2 : vector<1x[4]xindex>
@@ -94,12 +94,12 @@ func.func @broadcast_vector_scalable(%arg1: vector<[4]xf32>, %arg2: vector<[4]xf
9494
// CHECK-LABEL: func.func @broadcast_scalar_and_vec(
9595
// CHECK-SAME: %[[ARG1:.*]]: index,
9696
// CHECK-SAME: %[[ARG2:.*]]: vector<4xindex>) -> vector<1x4xindex> {
97-
// CHECK: %[[SPLAT:.*]] = vector.splat %[[ARG1]] : vector<1x4xindex>
97+
// CHECK: %[[SPLAT:.*]] = vector.broadcast %[[ARG1]] : index to vector<1x4xindex>
9898
// CHECK: %[[BCAST:.*]] = vector.broadcast %[[ARG2]] : vector<4xindex> to vector<1x4xindex>
9999
// CHECK: %[[ADD:.*]] = arith.addi %[[SPLAT]], %[[BCAST]] : vector<1x4xindex>
100100
// CHECK: return %[[ADD]] : vector<1x4xindex>
101101
func.func @broadcast_scalar_and_vec(%arg1: index, %arg2: vector<4xindex>) -> vector<1x4xindex> {
102-
%0 = vector.splat %arg1 : vector<1x4xindex>
102+
%0 = vector.broadcast %arg1 : index to vector<1x4xindex>
103103
%1 = vector.broadcast %arg2 : vector<4xindex> to vector<1x4xindex>
104104
%2 = arith.addi %0, %1 : vector<1x4xindex>
105105
return %2 : vector<1x4xindex>
@@ -108,12 +108,12 @@ func.func @broadcast_scalar_and_vec(%arg1: index, %arg2: vector<4xindex>) -> vec
108108
// CHECK-LABEL: func.func @broadcast_scalar_and_vec_scalable(
109109
// CHECK-SAME: %[[ARG1:.*]]: index,
110110
// CHECK-SAME: %[[ARG2:.*]]: vector<[4]xindex>) -> vector<1x[4]xindex> {
111-
// CHECK: %[[SPLAT:.*]] = vector.splat %[[ARG1]] : vector<1x[4]xindex>
111+
// CHECK: %[[SPLAT:.*]] = vector.broadcast %[[ARG1]] : index to vector<1x[4]xindex>
112112
// CHECK: %[[BCAST:.*]] = vector.broadcast %[[ARG2]] : vector<[4]xindex> to vector<1x[4]xindex>
113113
// CHECK: %[[ADD:.*]] = arith.addi %[[SPLAT]], %[[BCAST]] : vector<1x[4]xindex>
114114
// CHECK: return %[[ADD]] : vector<1x[4]xindex>
115115
func.func @broadcast_scalar_and_vec_scalable(%arg1: index, %arg2: vector<[4]xindex>) -> vector<1x[4]xindex> {
116-
%0 = vector.splat %arg1 : vector<1x[4]xindex>
116+
%0 = vector.broadcast %arg1 : index to vector<1x[4]xindex>
117117
%1 = vector.broadcast %arg2 : vector<[4]xindex> to vector<1x[4]xindex>
118118
%2 = arith.addi %0, %1 : vector<1x[4]xindex>
119119
return %2 : vector<1x[4]xindex>
@@ -787,7 +787,7 @@ func.func @negative_extract_load_scalable(%arg0: memref<?xf32>, %arg1: index) ->
787787
// CHECK-SAME: (%[[ARG0:.*]]: memref<?xf32>, %[[ARG1:.*]]: index, %[[ARG2:.*]]: f32)
788788
func.func @store_splat(%arg0: memref<?xf32>, %arg1: index, %arg2: f32) {
789789
// CHECK: memref.store %[[ARG2]], %[[ARG0]][%[[ARG1]]] : memref<?xf32>
790-
%0 = vector.splat %arg2 : vector<1xf32>
790+
%0 = vector.broadcast %arg2 : f32 to vector<1xf32>
791791
vector.store %0, %arg0[%arg1] : memref<?xf32>, vector<1xf32>
792792
return
793793
}
@@ -813,40 +813,40 @@ func.func @store_broadcast_1d_to_2d(%arg0: memref<?x?xf32>, %arg1: index, %arg2:
813813
// CHECK-LABEL: @negative_store_scalable
814814
// CHECK-SAME: (%[[ARG0:.*]]: memref<?xf32>, %[[ARG1:.*]]: index, %[[ARG2:.*]]: f32)
815815
func.func @negative_store_scalable(%arg0: memref<?xf32>, %arg1: index, %arg2: f32) {
816-
// CHECK: %[[RES:.*]] = vector.splat %[[ARG2]] : vector<[1]xf32>
816+
// CHECK: %[[RES:.*]] = vector.broadcast %[[ARG2]] : f32 to vector<[1]xf32>
817817
// CHECK: vector.store %[[RES]], %[[ARG0]][%[[ARG1]]] : memref<?xf32>, vector<[1]xf32>
818-
%0 = vector.splat %arg2 : vector<[1]xf32>
818+
%0 = vector.broadcast %arg2 : f32 to vector<[1]xf32>
819819
vector.store %0, %arg0[%arg1] : memref<?xf32>, vector<[1]xf32>
820820
return
821821
}
822822

823823
// CHECK-LABEL: @negative_store_memref_of_vec
824824
// CHECK-SAME: (%[[ARG0:.*]]: memref<?xvector<1xf32>>, %[[ARG1:.*]]: index, %[[ARG2:.*]]: f32)
825825
func.func @negative_store_memref_of_vec(%arg0: memref<?xvector<1xf32>>, %arg1: index, %arg2: f32) {
826-
// CHECK: %[[RES:.*]] = vector.splat %[[ARG2]] : vector<1xf32>
826+
// CHECK: %[[RES:.*]] = vector.broadcast %[[ARG2]] : f32 to vector<1xf32>
827827
// CHECK: vector.store %[[RES]], %[[ARG0]][%[[ARG1]]] : memref<?xvector<1xf32>>, vector<1xf32>
828-
%0 = vector.splat %arg2 : vector<1xf32>
828+
%0 = vector.broadcast %arg2 : f32 to vector<1xf32>
829829
vector.store %0, %arg0[%arg1] : memref<?xvector<1xf32>>, vector<1xf32>
830830
return
831831
}
832832

833833
// CHECK-LABEL: @negative_store_more_than_one_element
834834
// CHECK-SAME: (%[[ARG0:.*]]: memref<?xf32>, %[[ARG1:.*]]: index, %[[ARG2:.*]]: f32)
835835
func.func @negative_store_more_than_one_element(%arg0: memref<?xf32>, %arg1: index, %arg2: f32) {
836-
// CHECK: %[[RES:.*]] = vector.splat %[[ARG2]] : vector<4xf32>
836+
// CHECK: %[[RES:.*]] = vector.broadcast %[[ARG2]] : f32 to vector<4xf32>
837837
// CHECK: vector.store %[[RES]], %[[ARG0]][%[[ARG1]]] : memref<?xf32>, vector<4xf32>
838-
%0 = vector.splat %arg2 : vector<4xf32>
838+
%0 = vector.broadcast %arg2 : f32 to vector<4xf32>
839839
vector.store %0, %arg0[%arg1] : memref<?xf32>, vector<4xf32>
840840
return
841841
}
842842

843843
// CHECK-LABEL: @negative_store_no_single_use
844844
// CHECK-SAME: (%[[ARG0:.*]]: memref<?xf32>, %[[ARG1:.*]]: index, %[[ARG2:.*]]: f32)
845845
func.func @negative_store_no_single_use(%arg0: memref<?xf32>, %arg1: index, %arg2: f32) -> vector<1xf32> {
846-
// CHECK: %[[RES:.*]] = vector.splat %[[ARG2]] : vector<1xf32>
846+
// CHECK: %[[RES:.*]] = vector.broadcast %[[ARG2]] : f32 to vector<1xf32>
847847
// CHECK: vector.store %[[RES]], %[[ARG0]][%[[ARG1]]] : memref<?xf32>, vector<1xf32>
848848
// CHECK: return %[[RES:.*]] : vector<1xf32>
849-
%0 = vector.splat %arg2 : vector<1xf32>
849+
%0 = vector.broadcast %arg2 : f32 to vector<1xf32>
850850
vector.store %0, %arg0[%arg1] : memref<?xf32>, vector<1xf32>
851851
return %0 : vector<1xf32>
852852
}

mlir/test/Dialect/Vector/vector-transfer-to-vector-load-store.mlir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,19 +285,19 @@ func.func @transfer_read_permutations(%mem_0 : memref<?x?xf32>, %mem_1 : memref<
285285
%c0 = arith.constant 0 : index
286286

287287
// CHECK: %[[MASK0:.*]] = vector.broadcast %{{.*}} : i1 to vector<14x7xi1>
288-
%mask0 = vector.splat %m : vector<14x7xi1>
288+
%mask0 = vector.broadcast %m : i1 to vector<14x7xi1>
289289
%0 = vector.transfer_read %mem_1[%c0, %c0, %c0, %c0], %cst, %mask0 {in_bounds = [true, false, true, true], permutation_map = #map0} : memref<?x?x?x?xf32>, vector<7x14x8x16xf32>
290290
// CHECK: vector.transfer_read {{.*}} %[[MASK0]] {in_bounds = [false, true, true, true], permutation_map = #[[$MAP0]]} : memref<?x?x?x?xf32>, vector<14x7x8x16xf32>
291291
// CHECK: vector.transpose %{{.*}}, [1, 0, 2, 3] : vector<14x7x8x16xf32> to vector<7x14x8x16xf32>
292292

293293
// CHECK: %[[MASK1:.*]] = vector.broadcast %{{.*}} : i1 to vector<16x14xi1>
294-
%mask1 = vector.splat %m : vector<16x14xi1>
294+
%mask1 = vector.broadcast %m : i1 to vector<16x14xi1>
295295
%1 = vector.transfer_read %mem_1[%c0, %c0, %c0, %c0], %cst, %mask1 {in_bounds = [true, false, true, false], permutation_map = #map1} : memref<?x?x?x?xf32>, vector<7x14x8x16xf32>
296296
// CHECK: vector.transfer_read {{.*}} %[[MASK1]] {in_bounds = [false, false, true, true], permutation_map = #[[$MAP0]]} : memref<?x?x?x?xf32>, vector<16x14x7x8xf32>
297297
// CHECK: vector.transpose %{{.*}}, [2, 1, 3, 0] : vector<16x14x7x8xf32> to vector<7x14x8x16xf32>
298298

299299
// CHECK: %[[MASK3:.*]] = vector.broadcast %{{.*}} : i1 to vector<14x7xi1>
300-
%mask2 = vector.splat %m : vector<14x7xi1>
300+
%mask2 = vector.broadcast %m : i1 to vector<14x7xi1>
301301
%2 = vector.transfer_read %mem_1[%c0, %c0, %c0, %c0], %cst, %mask2 {in_bounds = [true, false, true, true], permutation_map = #map2} : memref<?x?x?x?xf32>, vector<7x14x8x16xf32>
302302
// CHECK: vector.transfer_read {{.*}} %[[MASK3]] {in_bounds = [false, true, true], permutation_map = #[[$MAP1]]} : memref<?x?x?x?xf32>, vector<14x16x7xf32>
303303
// CHECK: vector.broadcast %{{.*}} : vector<14x16x7xf32> to vector<8x14x16x7xf32>
@@ -337,7 +337,7 @@ func.func @transfer_write_permutations_tensor_masked(
337337
%c0 = arith.constant 0 : index
338338

339339
// CHECK: %[[MASK:.*]] = vector.broadcast %[[M]] : i1 to vector<16x14x7x8xi1>
340-
%mask0 = vector.splat %m : vector<16x14x7x8xi1>
340+
%mask0 = vector.broadcast %m : i1 to vector<16x14x7x8xi1>
341341
%res = vector.transfer_write %vec, %dst[%c0, %c0, %c0, %c0], %mask0 {in_bounds = [true, false, false, true], permutation_map = affine_map<(d0, d1, d2, d3) -> (d2, d1, d3, d0)>} : vector<7x14x8x16xf32>, tensor<?x?x?x?xf32>
342342
// CHECK: %[[NEW_VEC0:.*]] = vector.transpose %{{.*}} [3, 1, 0, 2] : vector<7x14x8x16xf32> to vector<16x14x7x8xf32>
343343
// CHECK: %[[NEW_RES0:.*]] = vector.transfer_write %[[NEW_VEC0]], %[[DST]][%c0, %c0, %c0, %c0], %[[MASK]] {in_bounds = [true, false, true, false]} : vector<16x14x7x8xf32>, tensor<?x?x?x?xf32>

mlir/test/Integration/Dialect/Vector/CPU/ArmSME/outerproduct-f32.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func.func @test_outerproduct_with_accumulator_4x4xf32() {
4646
%c0 = arith.constant 0 : index
4747
%f10 = arith.constant 10.0 : f32
4848

49-
%acc = vector.splat %f10 : vector<[4]x[4]xf32>
49+
%acc = vector.broadcast %f10 : f32 to vector<[4]x[4]xf32>
5050
%vector_i32 = llvm.intr.stepvector : vector<[4]xi32>
5151
%vector = arith.sitofp %vector_i32 : vector<[4]xi32> to vector<[4]xf32>
5252
%tile = vector.outerproduct %vector, %vector, %acc : vector<[4]xf32>, vector<[4]xf32>
@@ -103,7 +103,7 @@ func.func @test_masked_outerproduct_with_accumulator_4x4xf32() {
103103
%ones = arith.constant dense<1> : vector<[4]xi32>
104104
%f10 = arith.constant 10.0 : f32
105105

106-
%acc = vector.splat %f10 : vector<[4]x[4]xf32>
106+
%acc = vector.broadcast %f10 : f32 to vector<[4]x[4]xf32>
107107
%step_vector = llvm.intr.stepvector : vector<[4]xi32>
108108
%vector_i32 = arith.addi %step_vector, %ones : vector<[4]xi32>
109109
%vector = arith.sitofp %vector_i32 : vector<[4]xi32> to vector<[4]xf32>

mlir/test/Integration/Dialect/Vector/CPU/ArmSME/outerproduct-f64.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func.func @test_outerproduct_with_accumulator_2x2xf64() {
5252
%ones = arith.constant dense<1> : vector<[2]xi32>
5353
%f10 = arith.constant 10.0 : f64
5454

55-
%acc = vector.splat %f10 : vector<[2]x[2]xf64>
55+
%acc = vector.broadcast %f10 : f64 to vector<[2]x[2]xf64>
5656
%step_vector = llvm.intr.stepvector : vector<[2]xi32>
5757
%vector_i32 = arith.addi %step_vector, %ones : vector<[2]xi32>
5858
%vector = arith.sitofp %vector_i32 : vector<[2]xi32> to vector<[2]xf64>
@@ -108,7 +108,7 @@ func.func @test_masked_outerproduct_with_accumulator_2x2xf64() {
108108
%ones = arith.constant dense<1> : vector<[2]xi32>
109109
%f10 = arith.constant 10.0 : f64
110110

111-
%acc = vector.splat %f10 : vector<[2]x[2]xf64>
111+
%acc = vector.broadcast %f10 : f64 to vector<[2]x[2]xf64>
112112
%step_vector = llvm.intr.stepvector : vector<[2]xi32>
113113
%vector_i32 = arith.addi %step_vector, %ones : vector<[2]xi32>
114114
%vector = arith.sitofp %vector_i32 : vector<[2]xi32> to vector<[2]xf64>

mlir/test/Integration/Dialect/Vector/CPU/ArmSME/transfer-write-2d.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// Vector store.
1111
func.func @transfer_write_2d(%A : memref<?x?xf32>, %base1: index, %base2: index) {
1212
%c0 = arith.constant 0.0 : f32
13-
%zero = vector.splat %c0 : vector<[4]x[4]xf32>
13+
%zero = vector.broadcast %c0 : f32 to vector<[4]x[4]xf32>
1414
vector.transfer_write %zero, %A[%base1, %base2] {in_bounds=[true, true]} :
1515
vector<[4]x[4]xf32>, memref<?x?xf32>
1616
return
@@ -22,7 +22,7 @@ func.func @transfer_write_2d_mask(%A : memref<?x?xf32>, %base1: index, %base2: i
2222
%c2 = arith.constant 2 : index
2323
%c3 = arith.constant 3 : index
2424
%mask = vector.create_mask %c2, %c3 : vector<[4]x[4]xi1>
25-
%zero = vector.splat %c0 : vector<[4]x[4]xf32>
25+
%zero = vector.broadcast %c0 : f32 to vector<[4]x[4]xf32>
2626
vector.transfer_write %zero, %A[%base1, %base2], %mask {in_bounds=[true, true]} :
2727
vector<[4]x[4]xf32>, memref<?x?xf32>
2828
return

mlir/test/Integration/Dialect/Vector/CPU/ArmSVE/contraction.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func.func @matvec_i32() {
106106
// val = (123 * 314) * 4 * vscale
107107
// so ...
108108
%vscale = vector.vscale
109-
%vscale_v = vector.splat %vscale : vector<3xindex>
109+
%vscale_v = vector.broadcast %vscale : index to vector<3xindex>
110110
%vscale_i32 = arith.index_cast %vscale_v : vector<3xindex> to vector<3xi32>
111111
%mv1_div = arith.divui %mv1, %vscale_i32 : vector<3xi32>
112112
// ... val / vscale = 123 * 314 * 4 = 154488

mlir/test/Integration/Dialect/Vector/CPU/ArmSVE/scalable-interleave.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
func.func @entry() {
88
%f1 = arith.constant 1.0 : f32
99
%f2 = arith.constant 2.0 : f32
10-
%v1 = vector.splat %f1 : vector<[4]xf32>
11-
%v2 = vector.splat %f2 : vector<[4]xf32>
10+
%v1 = vector.broadcast %f1 : f32 to vector<[4]xf32>
11+
%v2 = vector.broadcast %f2 : f32 to vector<[4]xf32>
1212
vector.print %v1 : vector<[4]xf32>
1313
vector.print %v2 : vector<[4]xf32>
1414
//

mlir/test/Integration/Dialect/Vector/CPU/interleave.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
func.func @entry() {
77
%f1 = arith.constant 1.0 : f32
88
%f2 = arith.constant 2.0 : f32
9-
%v1 = vector.splat %f1 : vector<2x4xf32>
10-
%v2 = vector.splat %f2 : vector<2x4xf32>
9+
%v1 = vector.broadcast %f1 : f32 to vector<2x4xf32>
10+
%v2 = vector.broadcast %f2 : f32 to vector<2x4xf32>
1111
vector.print %v1 : vector<2x4xf32>
1212
vector.print %v2 : vector<2x4xf32>
1313
//

mlir/test/Integration/Dialect/Vector/CPU/outerproduct-f32.mlir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
!vector_type_R = vector<7xf32>
1515

1616
func.func @vector_outerproduct_splat_8x8(%fa: f32, %fb: f32, %fc: f32) -> !vector_type_C {
17-
%a = vector.splat %fa: !vector_type_A
18-
%b = vector.splat %fb: !vector_type_B
19-
%c = vector.splat %fc: !vector_type_C
17+
%a = vector.broadcast %fa: f32 to !vector_type_A
18+
%b = vector.broadcast %fb: f32 to !vector_type_B
19+
%c = vector.broadcast %fc: f32 to !vector_type_C
2020
%d = vector.outerproduct %a, %b, %c : !vector_type_A, !vector_type_B
2121
return %d: !vector_type_C
2222
}

0 commit comments

Comments
 (0)