1
- // RUN: mlir-opt %s -set-llvm-module-datalayout='data-layout=f32:64:64' - -convert-vector-to-llvm='use-vector-alignment=0' --split-input-file | FileCheck %s --check-prefix=MEMREF-ALIGN
1
+ // RUN: mlir-opt %s --convert-vector-to-llvm='use-vector-alignment=0' --split-input-file | FileCheck %s --check-prefix=MEMREF-ALIGN
2
2
// RUN: mlir-opt %s --convert-vector-to-llvm='use-vector-alignment=1' --split-input-file | FileCheck %s --check-prefix=VEC-ALIGN
3
3
4
4
@@ -13,8 +13,8 @@ func.func @load(%base : memref<200x100xf32>, %i : index, %j : index) -> vector<8
13
13
14
14
// ALL-LABEL: func @load
15
15
16
- // VEC-ALIGN: llvm.load %[[GEP]] {alignment = 32 : i64} : !llvm.ptr -> vector<8xf32>
17
- // MEMREF-ALIGN: llvm.load %[[GEP]] {alignment = 4 : i64} : !llvm.ptr -> vector<8xf32>
16
+ // VEC-ALIGN: llvm.load %{{.*}} {alignment = 32 : i64} : !llvm.ptr -> vector<8xf32>
17
+ // MEMREF-ALIGN: llvm.load %{{.*}} {alignment = 4 : i64} : !llvm.ptr -> vector<8xf32>
18
18
19
19
// -----
20
20
@@ -30,8 +30,8 @@ func.func @store(%base : memref<200x100xf32>, %i : index, %j : index) {
30
30
31
31
// ALL-LABEL: func @store
32
32
33
- // VEC-ALIGN: llvm.store %{{.*}}, %[[GEP]] {alignment = 16 : i64} : vector<4xf32>, !llvm.ptr
34
- // MEMREF-ALIGN: llvm.store %{{.*}}, %[[GEP]] {alignment = 4 : i64} : vector<4xf32>, !llvm.ptr
33
+ // VEC-ALIGN: llvm.store %{{.*}}, %{{.*}} {alignment = 16 : i64} : vector<4xf32>, !llvm.ptr
34
+ // MEMREF-ALIGN: llvm.store %{{.*}}, %{{.*}} {alignment = 4 : i64} : vector<4xf32>, !llvm.ptr
35
35
36
36
// -----
37
37
@@ -47,8 +47,8 @@ func.func @masked_load(%base: memref<?xf32>, %mask: vector<16xi1>, %passthru: ve
47
47
48
48
// ALL-LABEL: func @masked_load
49
49
50
- // VEC-ALIGN: %[[L:.*]] = llvm.intr.masked.load %[[P]] , %{{.*}}, %{{.*}} {alignment = 64 : i32} : (!llvm.ptr, vector<16xi1>, vector<16xf32>) -> vector<16xf32>
51
- // MEMREF-ALIGN: %[[L:.*]] = llvm.intr.masked.load %[[P]] , %{{.*}}, %{{.*}} {alignment = 4 : i32} : (!llvm.ptr, vector<16xi1>, vector<16xf32>) -> vector<16xf32>
50
+ // VEC-ALIGN: %[[L:.*]] = llvm.intr.masked.load %{{.*}} , %{{.*}}, %{{.*}} {alignment = 64 : i32} : (!llvm.ptr, vector<16xi1>, vector<16xf32>) -> vector<16xf32>
51
+ // MEMREF-ALIGN: %[[L:.*]] = llvm.intr.masked.load %{{.*}} , %{{.*}}, %{{.*}} {alignment = 4 : i32} : (!llvm.ptr, vector<16xi1>, vector<16xf32>) -> vector<16xf32>
52
52
53
53
// -----
54
54
@@ -64,8 +64,8 @@ func.func @masked_store(%base: memref<?xf32>, %mask: vector<16xi1>, %passthru: v
64
64
65
65
// ALL-LABEL: func @masked_store
66
66
67
- // VEC-ALIGN: llvm.intr.masked.store %{{.*}}, %[[P]] , %{{.*}} {alignment = 64 : i32} : vector<16xf32>, vector<16xi1> into !llvm.ptr
68
- // MEMREF-ALIGN: llvm.intr.masked.store %{{.*}}, %[[P]] , %{{.*}} {alignment = 4 : i32} : vector<16xf32>, vector<16xi1> into !llvm.ptr
67
+ // VEC-ALIGN: llvm.intr.masked.store %{{.*}}, %{{.*}} , %{{.*}} {alignment = 64 : i32} : vector<16xf32>, vector<16xi1> into !llvm.ptr
68
+ // MEMREF-ALIGN: llvm.intr.masked.store %{{.*}}, %{{.*}} , %{{.*}} {alignment = 4 : i32} : vector<16xf32>, vector<16xi1> into !llvm.ptr
69
69
70
70
// -----
71
71
@@ -81,8 +81,8 @@ func.func @scatter(%base: memref<?xf32>, %index: vector<3xi32>, %mask: vector<3x
81
81
82
82
// ALL-LABEL: func @scatter
83
83
84
- // VEC-ALIGN: llvm.intr.masked.scatter %{{.*}}, %[[P]] , %{{.*}} {alignment = 16 : i32} : vector<3xf32>, vector<3xi1> into vector<3x!llvm.ptr>
85
- // MEMREF-ALIGN: llvm.intr.masked.scatter %{{.*}}, %[[P]] , %{{.*}} {alignment = 4 : i32} : vector<3xf32>, vector<3xi1> into vector<3x!llvm.ptr>
84
+ // VEC-ALIGN: llvm.intr.masked.scatter %{{.*}}, %{{.*}} , %{{.*}} {alignment = 16 : i32} : vector<3xf32>, vector<3xi1> into vector<3x!llvm.ptr>
85
+ // MEMREF-ALIGN: llvm.intr.masked.scatter %{{.*}}, %{{.*}} , %{{.*}} {alignment = 4 : i32} : vector<3xf32>, vector<3xi1> into vector<3x!llvm.ptr>
86
86
87
87
// -----
88
88
@@ -98,5 +98,5 @@ func.func @gather(%base: memref<?xf32>, %index: vector<3xi32>, %mask: vector<3xi
98
98
99
99
// ALL-LABEL: func @gather
100
100
101
- // VEC-ALIGN: %[[G:.*]] = llvm.intr.masked.gather %[[P]] , %{{.*}}, %{{.*}} {alignment = 16 : i32} : (vector<3x!llvm.ptr>, vector<3xi1>, vector<3xf32>) -> vector<3xf32>
102
- // MEMREF-ALIGN: %[[G:.*]] = llvm.intr.masked.gather %[[P]] , %{{.*}}, %{{.*}} {alignment = 4 : i32} : (vector<3x!llvm.ptr>, vector<3xi1>, vector<3xf32>) -> vector<3xf32>
101
+ // VEC-ALIGN: %[[G:.*]] = llvm.intr.masked.gather %{{.*}} , %{{.*}}, %{{.*}} {alignment = 16 : i32} : (vector<3x!llvm.ptr>, vector<3xi1>, vector<3xf32>) -> vector<3xf32>
102
+ // MEMREF-ALIGN: %[[G:.*]] = llvm.intr.masked.gather %{{.*}} , %{{.*}}, %{{.*}} {alignment = 4 : i32} : (vector<3x!llvm.ptr>, vector<3xi1>, vector<3xf32>) -> vector<3xf32>
0 commit comments