Skip to content

Commit 56c2335

Browse files
committed
Make operations parameters in test
1 parent 0eb1b44 commit 56c2335

File tree

2 files changed

+13
-20
lines changed

2 files changed

+13
-20
lines changed

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,8 +1795,7 @@ func.func @store_0d(%memref : memref<200x100xf32>, %i : index, %j : index) {
17951795

17961796
// -----
17971797

1798-
func.func @store_alignment(%memref : memref<200x100xf32>, %i : index, %j : index) {
1799-
%val = arith.constant dense<11.0> : vector<4xf32>
1798+
func.func @store_alignment(%memref : memref<200x100xf32>, %i : index, %j : index, %val : vector<4xf32>) {
18001799
vector.store %val, %memref[%i, %j] {alignment = 8} : memref<200x100xf32>, vector<4xf32>
18011800
return
18021801
}
@@ -1860,9 +1859,8 @@ func.func @masked_load_index_scalable(%arg0: memref<?xindex>, %arg1: vector<[16]
18601859

18611860
// -----
18621861

1863-
func.func @masked_load_alignment(%arg0: memref<?xf32>, %arg1: vector<16xi1>, %arg2: vector<16xf32>) -> vector<16xf32> {
1864-
%c0 = arith.constant 0: index
1865-
%0 = vector.maskedload %arg0[%c0], %arg1, %arg2 { alignment = 2 } : memref<?xf32>, vector<16xi1>, vector<16xf32> into vector<16xf32>
1862+
func.func @masked_load_alignment(%arg0: memref<?xf32>, %arg1: vector<16xi1>, %arg2: vector<16xf32>, %arg3: index) -> vector<16xf32> {
1863+
%0 = vector.maskedload %arg0[%arg3], %arg1, %arg2 { alignment = 2 } : memref<?xf32>, vector<16xi1>, vector<16xf32> into vector<16xf32>
18661864
return %0 : vector<16xf32>
18671865
}
18681866

@@ -1923,9 +1921,8 @@ func.func @masked_store_index_scalable(%arg0: memref<?xindex>, %arg1: vector<[16
19231921

19241922
// -----
19251923

1926-
func.func @masked_store_alignment(%arg0: memref<?xf32>, %arg1: vector<16xi1>, %arg2: vector<16xf32>) {
1927-
%c0 = arith.constant 0: index
1928-
vector.maskedstore %arg0[%c0], %arg1, %arg2 { alignment = 2 } : memref<?xf32>, vector<16xi1>, vector<16xf32>
1924+
func.func @masked_store_alignment(%arg0: memref<?xf32>, %arg1: vector<16xi1>, %arg2: vector<16xf32>, %arg3: index) {
1925+
vector.maskedstore %arg0[%arg3], %arg1, %arg2 { alignment = 2 } : memref<?xf32>, vector<16xi1>, vector<16xf32>
19291926
return
19301927
}
19311928

mlir/test/Dialect/Vector/invalid.mlir

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,19 +1309,17 @@ func.func @store_memref_index_mismatch(%base : memref<?xf32>, %value : vector<16
13091309
// vector.maskedload
13101310
//===----------------------------------------------------------------------===//
13111311

1312-
func.func @maskedload_negative_alignment(%base: memref<?xf32>, %mask: vector<16xi1>, %pass: vector<16xf32>) {
1313-
%c0 = arith.constant 0 : index
1312+
func.func @maskedload_negative_alignment(%base: memref<?xf32>, %mask: vector<16xi1>, %pass: vector<16xf32>, %index: index) {
13141313
// expected-error@+1 {{'vector.maskedload' op attribute 'alignment' failed to satisfy constraint: 64-bit signless integer attribute whose value is positive and whose value is a power of two > 0}}
1315-
%val = vector.maskedload %base[%c0], %mask, %pass { alignment = -1 } : memref<?xf32>, vector<16xi1>, vector<16xf32> into vector<16xf32>
1314+
%val = vector.maskedload %base[%index], %mask, %pass { alignment = -1 } : memref<?xf32>, vector<16xi1>, vector<16xf32> into vector<16xf32>
13161315
return
13171316
}
13181317

13191318
// -----
13201319

1321-
func.func @maskedload_nonpower2_alignment(%base: memref<?xf32>, %mask: vector<16xi1>, %pass: vector<16xf32>) {
1322-
%c0 = arith.constant 0 : index
1320+
func.func @maskedload_nonpower2_alignment(%base: memref<?xf32>, %mask: vector<16xi1>, %pass: vector<16xf32>, %index: index) {
13231321
// expected-error@+1 {{'vector.maskedload' op attribute 'alignment' failed to satisfy constraint: 64-bit signless integer attribute whose value is positive and whose value is a power of two > 0}}
1324-
%val = vector.maskedload %base[%c0], %mask, %pass { alignment = 3 } : memref<?xf32>, vector<16xi1>, vector<16xf32> into vector<16xf32>
1322+
%val = vector.maskedload %base[%index], %mask, %pass { alignment = 3 } : memref<?xf32>, vector<16xi1>, vector<16xf32> into vector<16xf32>
13251323
return
13261324
}
13271325

@@ -1362,19 +1360,17 @@ func.func @maskedload_memref_mismatch(%base: memref<?xf32>, %mask: vector<16xi1>
13621360
// vector.maskedstore
13631361
//===----------------------------------------------------------------------===//
13641362

1365-
func.func @maskedstore_negative_alignment(%base: memref<?xf32>, %mask: vector<16xi1>, %value: vector<16xf32>) {
1366-
%c0 = arith.constant 0 : index
1363+
func.func @maskedstore_negative_alignment(%base: memref<?xf32>, %mask: vector<16xi1>, %value: vector<16xf32>, %index: index) {
13671364
// expected-error@+1 {{'vector.maskedstore' op attribute 'alignment' failed to satisfy constraint: 64-bit signless integer attribute whose value is positive and whose value is a power of two > 0}}
1368-
vector.maskedstore %base[%c0], %mask, %value { alignment = -1 } : memref<?xf32>, vector<16xi1>, vector<16xf32> into vector<16xf32>
1365+
vector.maskedstore %base[%index], %mask, %value { alignment = -1 } : memref<?xf32>, vector<16xi1>, vector<16xf32> into vector<16xf32>
13691366
return
13701367
}
13711368

13721369
// -----
13731370

1374-
func.func @maskedload_nonpower2_alignment(%base: memref<?xf32>, %mask: vector<16xi1>, %value: vector<16xf32>) {
1375-
%c0 = arith.constant 0 : index
1371+
func.func @maskedload_nonpower2_alignment(%base: memref<?xf32>, %mask: vector<16xi1>, %value: vector<16xf32>, %index: index) {
13761372
// expected-error@+1 {{'vector.maskedstore' op attribute 'alignment' failed to satisfy constraint: 64-bit signless integer attribute whose value is positive and whose value is a power of two > 0}}
1377-
vector.maskedstore %base[%c0], %mask, %value { alignment = 3 } : memref<?xf32>, vector<16xi1>, vector<16xf32> into vector<16xf32>
1373+
vector.maskedstore %base[%index], %mask, %value { alignment = 3 } : memref<?xf32>, vector<16xi1>, vector<16xf32> into vector<16xf32>
13781374
return
13791375
}
13801376

0 commit comments

Comments
 (0)