10
10
11
11
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
12
12
13
- @v4f32 = global ptr zeroinitializer , align 8
14
- @v8i32 = global ptr zeroinitializer , align 8
15
- @v4i64 = global ptr zeroinitializer , align 8
16
-
17
13
;;;;;;;;;;;;;;;; STORE
18
14
declare void @llvm.masked.store.v4f32.p0 (<4 x float >, ptr , i32 , <4 x i1 >) argmemonly nounwind
19
15
declare void @llvm.masked.store.v8i32.p0 (<8 x i32 >, ptr , i32 , <8 x i1 >) argmemonly nounwind
20
16
declare void @llvm.masked.store.v4p0.p0 (<4 x ptr >, ptr , i32 , <4 x i1 >) argmemonly nounwind
21
17
22
- define void @store.v4f32.1110 (<4 x float > %arg ) sanitize_address {
18
+ define void @store.v4f32.1110 (ptr %p , <4 x float > %arg ) sanitize_address {
23
19
; ALL-LABEL: @store.v4f32.1110
24
- %p = load ptr , ptr @v4f32 , align 8
25
20
; NOSTORE-NOT: call void @__asan_store
26
21
; STORE: [[GEP0:%[0-9A-Za-z]+]] = getelementptr <4 x float>, ptr %p, i64 0, i64 0
27
22
; STORE: [[PGEP0:%[0-9A-Za-z]+]] = ptrtoint ptr [[GEP0]] to i64
@@ -37,9 +32,8 @@ define void @store.v4f32.1110(<4 x float> %arg) sanitize_address {
37
32
ret void
38
33
}
39
34
40
- define void @store.v8i32.10010110 (<8 x i32 > %arg ) sanitize_address {
35
+ define void @store.v8i32.10010110 (ptr %p , <8 x i32 > %arg ) sanitize_address {
41
36
; ALL-LABEL: @store.v8i32.10010110
42
- %p = load ptr , ptr @v8i32 , align 8
43
37
; NOSTORE-NOT: call void @__asan_store
44
38
; STORE: [[GEP0:%[0-9A-Za-z]+]] = getelementptr <8 x i32>, ptr %p, i64 0, i64 0
45
39
; STORE: [[PGEP0:%[0-9A-Za-z]+]] = ptrtoint ptr [[GEP0]] to i64
@@ -58,9 +52,8 @@ define void @store.v8i32.10010110(<8 x i32> %arg) sanitize_address {
58
52
ret void
59
53
}
60
54
61
- define void @store.v4i64.0001 (<4 x ptr > %arg ) sanitize_address {
55
+ define void @store.v4i64.0001 (ptr %p , <4 x ptr > %arg ) sanitize_address {
62
56
; ALL-LABEL: @store.v4i64.0001
63
- %p = load ptr , ptr @v4i64 , align 8
64
57
; NOSTORE-NOT: call void @__asan_store
65
58
; STORE: [[GEP3:%[0-9A-Za-z]+]] = getelementptr <4 x ptr>, ptr %p, i64 0, i64 3
66
59
; STORE: [[PGEP3:%[0-9A-Za-z]+]] = ptrtoint ptr [[GEP3]] to i64
@@ -70,9 +63,8 @@ define void @store.v4i64.0001(<4 x ptr> %arg) sanitize_address {
70
63
ret void
71
64
}
72
65
73
- define void @store.v4f32.variable (<4 x float > %arg , <4 x i1 > %mask ) sanitize_address {
66
+ define void @store.v4f32.variable (ptr %p , <4 x float > %arg , <4 x i1 > %mask ) sanitize_address {
74
67
; ALL-LABEL: @store.v4f32.variable
75
- %p = load ptr , ptr @v4f32 , align 8
76
68
; STORE: [[MASK0:%[0-9A-Za-z]+]] = extractelement <4 x i1> %mask, i64 0
77
69
; STORE: br i1 [[MASK0]], label %[[THEN0:[0-9A-Za-z]+]], label %[[AFTER0:[0-9A-Za-z]+]]
78
70
; STORE: [[THEN0]]:
@@ -115,9 +107,8 @@ define void @store.v4f32.variable(<4 x float> %arg, <4 x i1> %mask) sanitize_add
115
107
}
116
108
117
109
;; Store using two masked.stores, which should instrument them both.
118
- define void @store.v4f32.1010.split (<4 x float > %arg ) sanitize_address {
110
+ define void @store.v4f32.1010.split (ptr %p , <4 x float > %arg ) sanitize_address {
119
111
; BOTH-LABEL: @store.v4f32.1010.split
120
- %p = load ptr , ptr @v4f32 , align 8
121
112
; STORE: [[GEP0:%[0-9A-Za-z]+]] = getelementptr <4 x float>, ptr %p, i64 0, i64 0
122
113
; STORE: [[PGEP0:%[0-9A-Za-z]+]] = ptrtoint ptr [[GEP0]] to i64
123
114
; STORE: call void @__asan_store4(i64 [[PGEP0]])
@@ -132,9 +123,8 @@ define void @store.v4f32.1010.split(<4 x float> %arg) sanitize_address {
132
123
}
133
124
134
125
;; Store using a masked.store after a full store. Shouldn't instrument the second one.
135
- define void @store.v4f32.0010.after.full.store (<4 x float > %arg ) sanitize_address {
126
+ define void @store.v4f32.0010.after.full.store (ptr %p , <4 x float > %arg ) sanitize_address {
136
127
; BOTH-LABEL: @store.v4f32.0010.after.full.store
137
- %p = load ptr , ptr @v4f32 , align 8
138
128
; STORE: [[PTRTOINT:%[0-9A-Za-z]+]] = ptrtoint ptr %p to i64
139
129
; STORE: call void @__asan_store16(i64 [[PTRTOINT]])
140
130
; STORE: store <4 x float> %arg, ptr %p
@@ -150,9 +140,8 @@ declare <4 x float> @llvm.masked.load.v4f32.p0(ptr, i32, <4 x i1>, <4 x float>)
150
140
declare <8 x i32 > @llvm.masked.load.v8i32.p0 (ptr , i32 , <8 x i1 >, <8 x i32 >) argmemonly nounwind
151
141
declare <4 x ptr > @llvm.masked.load.v4p0.p0 (ptr , i32 , <4 x i1 >, <4 x ptr >) argmemonly nounwind
152
142
153
- define <8 x i32 > @load.v8i32.11100001 (<8 x i32 > %arg ) sanitize_address {
143
+ define <8 x i32 > @load.v8i32.11100001 (ptr %p , <8 x i32 > %arg ) sanitize_address {
154
144
; ALL-LABEL: @load.v8i32.11100001
155
- %p = load ptr , ptr @v8i32 , align 8
156
145
; NOLOAD-NOT: call void @__asan_load
157
146
; LOAD: [[GEP0:%[0-9A-Za-z]+]] = getelementptr <8 x i32>, ptr %p, i64 0, i64 0
158
147
; LOAD: [[PGEP0:%[0-9A-Za-z]+]] = ptrtoint ptr [[GEP0]] to i64
@@ -171,9 +160,8 @@ define <8 x i32> @load.v8i32.11100001(<8 x i32> %arg) sanitize_address {
171
160
ret <8 x i32 > %res
172
161
}
173
162
174
- define <4 x float > @load.v4f32.1001 (<4 x float > %arg ) sanitize_address {
163
+ define <4 x float > @load.v4f32.1001 (ptr %p , <4 x float > %arg ) sanitize_address {
175
164
; ALL-LABEL: @load.v4f32.1001
176
- %p = load ptr , ptr @v4f32 , align 8
177
165
; NOLOAD-NOT: call void @__asan_load
178
166
; LOAD: [[GEP0:%[0-9A-Za-z]+]] = getelementptr <4 x float>, ptr %p, i64 0, i64 0
179
167
; LOAD: [[PGEP0:%[0-9A-Za-z]+]] = ptrtoint ptr [[GEP0]] to i64
@@ -186,9 +174,8 @@ define <4 x float> @load.v4f32.1001(<4 x float> %arg) sanitize_address {
186
174
ret <4 x float > %res
187
175
}
188
176
189
- define <4 x ptr > @load.v4i64.0001 (<4 x ptr > %arg ) sanitize_address {
177
+ define <4 x ptr > @load.v4i64.0001 (ptr %p , <4 x ptr > %arg ) sanitize_address {
190
178
; ALL-LABEL: @load.v4i64.0001
191
- %p = load ptr , ptr @v4i64 , align 8
192
179
; NOLOAD-NOT: call void @__asan_load
193
180
; LOAD: [[GEP3:%[0-9A-Za-z]+]] = getelementptr <4 x ptr>, ptr %p, i64 0, i64 3
194
181
; LOAD: [[PGEP3:%[0-9A-Za-z]+]] = ptrtoint ptr [[GEP3]] to i64
@@ -198,9 +185,8 @@ define <4 x ptr> @load.v4i64.0001(<4 x ptr> %arg) sanitize_address {
198
185
ret <4 x ptr > %res
199
186
}
200
187
201
- define <4 x float > @load.v4f32.variable (<4 x float > %arg , <4 x i1 > %mask ) sanitize_address {
188
+ define <4 x float > @load.v4f32.variable (ptr %p , <4 x float > %arg , <4 x i1 > %mask ) sanitize_address {
202
189
; ALL-LABEL: @load.v4f32.variable
203
- %p = load ptr , ptr @v4f32 , align 8
204
190
; LOAD: [[MASK0:%[0-9A-Za-z]+]] = extractelement <4 x i1> %mask, i64 0
205
191
; LOAD: br i1 [[MASK0]], label %[[THEN0:[0-9A-Za-z]+]], label %[[AFTER0:[0-9A-Za-z]+]]
206
192
; LOAD: [[THEN0]]:
@@ -243,9 +229,8 @@ define <4 x float> @load.v4f32.variable(<4 x float> %arg, <4 x i1> %mask) saniti
243
229
}
244
230
245
231
;; Load using two masked.loads, which should instrument them both.
246
- define <4 x float > @load.v4f32.1001.split (<4 x float > %arg ) sanitize_address {
232
+ define <4 x float > @load.v4f32.1001.split (ptr %p , <4 x float > %arg ) sanitize_address {
247
233
; BOTH-LABEL: @load.v4f32.1001
248
- %p = load ptr , ptr @v4f32 , align 8
249
234
; LOAD: [[GEP0:%[0-9A-Za-z]+]] = getelementptr <4 x float>, ptr %p, i64 0, i64 0
250
235
; LOAD: [[PGEP0:%[0-9A-Za-z]+]] = ptrtoint ptr [[GEP0]] to i64
251
236
; LOAD: call void @__asan_load4(i64 [[PGEP0]])
@@ -260,9 +245,8 @@ define <4 x float> @load.v4f32.1001.split(<4 x float> %arg) sanitize_address {
260
245
}
261
246
262
247
;; Load using a masked.load after a full load. Shouldn't instrument the second one.
263
- define <4 x float > @load.v4f32.1001.after.full.load (<4 x float > %arg ) sanitize_address {
248
+ define <4 x float > @load.v4f32.1001.after.full.load (ptr %p , <4 x float > %arg ) sanitize_address {
264
249
; BOTH-LABEL: @load.v4f32.1001.after.full.load
265
- %p = load ptr , ptr @v4f32 , align 8
266
250
; LOAD: [[PTRTOINT:%[0-9A-Za-z]+]] = ptrtoint ptr %p to i64
267
251
; LOAD: call void @__asan_load16(i64 [[PTRTOINT]])
268
252
; LOAD: %res = load <4 x float>, ptr %p
0 commit comments