Skip to content

Commit dc97457

Browse files
authored
[mlir][ArmSME][test] Make use of arm_sme.streaming_vl (NFC) (llvm#77322)
1 parent 21aacb0 commit dc97457

File tree

7 files changed

+8
-38
lines changed

7 files changed

+8
-38
lines changed

mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/fill-2d.mlir

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,9 @@ func.func @entry() {
2020

2121
%c123_f32 = arith.constant 123.0 : f32
2222

23-
%min_elts_s = arith.constant 4 : index
24-
%vscale = vector.vscale
25-
2623
// "svl" refers to the Streaming Vector Length and "svl_s" the number of
2724
// 32-bit elements in a vector of SVL bits.
28-
%svl_s = arith.muli %min_elts_s, %vscale : index
25+
%svl_s = arm_sme.streaming_vl <word>
2926

3027
%tile_init = bufferization.alloc_tensor(%svl_s, %svl_s) : tensor<?x?xf32>
3128

mlir/test/Integration/Dialect/Vector/CPU/ArmSME/test-load-vertical.mlir

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ func.func @entry() {
1717
%c1_i32 = arith.constant 1 : i32
1818

1919
// Calculate the size of a 32-bit tile, e.g. ZA{n}.s.
20-
%vscale = vector.vscale
21-
%min_elts_s = arith.constant 4 : index
22-
%svl_s = arith.muli %min_elts_s, %vscale : index
20+
%svl_s = arm_sme.streaming_vl <word>
2321
%za_s_size = arith.muli %svl_s, %svl_s : index
2422

2523
// Allocate memory.

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,6 @@ func.func @initialize_memory(%d0 : index, %d1 : index) -> memref<?x?xf32> {
134134
return %A : memref<?x?xf32>
135135
}
136136

137-
// This will be made a streaming function by enable-arm-streaming so return SVL.
138-
func.func @get_svl() -> index {
139-
%vscale = vector.vscale
140-
return %vscale : index
141-
}
142-
143137
func.func @entry() {
144138
%c0 = arith.constant 0 : index
145139
%c1 = arith.constant 1 : index
@@ -148,8 +142,7 @@ func.func @entry() {
148142

149143
// Allocate enough memory to load a 32-bit tile plus a tiny bit more to test
150144
// non-zero offsets while remaining inbounds.
151-
%svl = call @get_svl() : () -> index
152-
%svl_s = arith.muli %c4, %svl : index
145+
%svl_s = arm_sme.streaming_vl <word>
153146
%svl_s_plus_two = arith.addi %svl_s, %c2 : index
154147

155148
%A = call @initialize_memory(%svl_s_plus_two, %svl_s_plus_two) : (index, index) -> memref<?x?xf32>

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,6 @@ func.func @initialize_memory(%d0 : index, %d1 : index) -> memref<?x?xf32> {
9696
return %A : memref<?x?xf32>
9797
}
9898

99-
// This will be made a streaming function by enable-arm-streaming so return SVL.
100-
func.func @get_svl() -> index {
101-
%vscale = vector.vscale
102-
return %vscale : index
103-
}
104-
10599
func.func @entry() {
106100
%c0 = arith.constant 0 : index
107101
%c2 = arith.constant 2 : index
@@ -111,8 +105,7 @@ func.func @entry() {
111105
//
112106
// Allocate enough memory to load a 32-bit tile plus a tiny bit more to test
113107
// non-zero offsets while remaining inbounds.
114-
%svl = call @get_svl() : () -> index
115-
%svl_s = arith.muli %c4, %svl : index
108+
%svl_s = arm_sme.streaming_vl <word>
116109
%svl_s_plus_two = arith.addi %svl_s, %c2 : index
117110
%A = call @initialize_memory(%svl_s_plus_two, %svl_s_plus_two) : (index, index) -> memref<?x?xf32>
118111

mlir/test/Integration/Dialect/Vector/CPU/ArmSME/test-transpose.mlir

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ func.func @entry() {
1717
%c1_i32 = arith.constant 1 : i32
1818

1919
// Calculate the size of a 32-bit tile, e.g. ZA{n}.s.
20-
%vscale = vector.vscale
21-
%min_elts_s = arith.constant 4 : index
22-
%svl_s = arith.muli %min_elts_s, %vscale : index
20+
%svl_s = arm_sme.streaming_vl <word>
2321
%za_s_size = arith.muli %svl_s, %svl_s : index
2422

2523
// Allocate memory.

mlir/test/Integration/Dialect/Vector/CPU/ArmSME/vector-load-store.mlir

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,9 @@ func.func @za0_d_f64() -> i32 {
2424
%c1_f64 = arith.constant 1.0 : f64
2525
%c1_index = arith.constant 1 : index
2626

27-
%min_elts_d = arith.constant 2 : index
28-
%vscale = vector.vscale
29-
3027
// "svl" refers to the Streaming Vector Length and "svl_d" the number of
3128
// 64-bit elements in a vector of SVL bits.
32-
%svl_d = arith.muli %min_elts_d, %vscale : index
29+
%svl_d = arm_sme.streaming_vl <double>
3330

3431
// Allocate "mem1" and fill each "row" with row number.
3532
//
@@ -170,13 +167,10 @@ func.func @load_store_two_za_s_tiles() -> i32 {
170167
%c1_index = arith.constant 1 : index
171168
%c2_index = arith.constant 2 : index
172169

173-
%min_elts_s = arith.constant 4 : index
174-
%vscale = vector.vscale
175-
176170
// "svl" refers to the Streaming Vector Length and "svl_s" can mean either:
177171
// * the number of 32-bit elements in a vector of SVL bits.
178172
// * the number of tile slices (1d vectors) in a 32-bit element tile.
179-
%svl_s = arith.muli %min_elts_s, %vscale : index
173+
%svl_s = arm_sme.streaming_vl <word>
180174

181175
// Allocate memory for two 32-bit element tiles.
182176
%size_of_tile = arith.muli %svl_s, %svl_s : index

mlir/test/Integration/Dialect/Vector/CPU/ArmSME/vector-ops.mlir

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@ func.func @entry() -> i32 {
1414
%c1_i8 = arith.constant 1 : i8
1515
%c1_index = arith.constant 1 : index
1616

17-
%c16 = arith.constant 16 : index
18-
%vscale = vector.vscale
19-
2017
// "svl" refers to the Streaming Vector Length and "svl_b" the number of
2118
// 8-bit elements in a vector of SVL bits.
22-
%svl_b = arith.muli %c16, %vscale : index
19+
%svl_b = arm_sme.streaming_vl <byte>
2320

2421
// Allocate memory and fill with ones.
2522
//

0 commit comments

Comments
 (0)