1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -basicaa -dse -S | FileCheck %s
3 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
5 %struct.vec2 = type { <4 x i32>, <4 x i32> }
6 %struct.vec2plusi = type { <4 x i32>, <4 x i32>, i32 }
8 @glob1 = global %struct.vec2 zeroinitializer, align 16
9 @glob2 = global %struct.vec2plusi zeroinitializer, align 16
11 define void @write24to28(i32* nocapture %p) nounwind uwtable ssp {
12 ; CHECK-LABEL: @write24to28(
14 ; CHECK-NEXT: [[ARRAYIDX0:%.*]] = getelementptr inbounds i32, i32* [[P:%.*]], i64 1
15 ; CHECK-NEXT: [[P3:%.*]] = bitcast i32* [[ARRAYIDX0]] to i8*
16 ; CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* align 4 [[P3]], i8 0, i64 24, i1 false)
17 ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 7
18 ; CHECK-NEXT: store i32 1, i32* [[ARRAYIDX1]], align 4
19 ; CHECK-NEXT: ret void
22 %arrayidx0 = getelementptr inbounds i32, i32* %p, i64 1
23 %p3 = bitcast i32* %arrayidx0 to i8*
24 call void @llvm.memset.p0i8.i64(i8* align 4 %p3, i8 0, i64 28, i1 false)
25 %arrayidx1 = getelementptr inbounds i32, i32* %p, i64 7
26 store i32 1, i32* %arrayidx1, align 4
30 define void @write24to28_atomic(i32* nocapture %p) nounwind uwtable ssp {
31 ; CHECK-LABEL: @write24to28_atomic(
33 ; CHECK-NEXT: [[ARRAYIDX0:%.*]] = getelementptr inbounds i32, i32* [[P:%.*]], i64 1
34 ; CHECK-NEXT: [[P3:%.*]] = bitcast i32* [[ARRAYIDX0]] to i8*
35 ; CHECK-NEXT: call void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* align 4 [[P3]], i8 0, i64 24, i32 4)
36 ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 7
37 ; CHECK-NEXT: store atomic i32 1, i32* [[ARRAYIDX1]] unordered, align 4
38 ; CHECK-NEXT: ret void
41 %arrayidx0 = getelementptr inbounds i32, i32* %p, i64 1
42 %p3 = bitcast i32* %arrayidx0 to i8*
43 call void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* align 4 %p3, i8 0, i64 28, i32 4)
44 %arrayidx1 = getelementptr inbounds i32, i32* %p, i64 7
45 store atomic i32 1, i32* %arrayidx1 unordered, align 4
49 ; Atomicity of the store is weaker from the memset
50 define void @write24to28_atomic_weaker(i32* nocapture %p) nounwind uwtable ssp {
51 ; CHECK-LABEL: @write24to28_atomic_weaker(
53 ; CHECK-NEXT: [[ARRAYIDX0:%.*]] = getelementptr inbounds i32, i32* [[P:%.*]], i64 1
54 ; CHECK-NEXT: [[P3:%.*]] = bitcast i32* [[ARRAYIDX0]] to i8*
55 ; CHECK-NEXT: call void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* align 4 [[P3]], i8 0, i64 24, i32 4)
56 ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 7
57 ; CHECK-NEXT: store i32 1, i32* [[ARRAYIDX1]], align 4
58 ; CHECK-NEXT: ret void
61 %arrayidx0 = getelementptr inbounds i32, i32* %p, i64 1
62 %p3 = bitcast i32* %arrayidx0 to i8*
63 call void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* align 4 %p3, i8 0, i64 28, i32 4)
64 %arrayidx1 = getelementptr inbounds i32, i32* %p, i64 7
65 store i32 1, i32* %arrayidx1, align 4
69 define void @write28to32(i32* nocapture %p) nounwind uwtable ssp {
70 ; CHECK-LABEL: @write28to32(
72 ; CHECK-NEXT: [[P3:%.*]] = bitcast i32* [[P:%.*]] to i8*
73 ; CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* align 4 [[P3]], i8 0, i64 28, i1 false)
74 ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 7
75 ; CHECK-NEXT: store i32 1, i32* [[ARRAYIDX1]], align 4
76 ; CHECK-NEXT: ret void
79 %p3 = bitcast i32* %p to i8*
80 call void @llvm.memset.p0i8.i64(i8* align 4 %p3, i8 0, i64 32, i1 false)
81 %arrayidx1 = getelementptr inbounds i32, i32* %p, i64 7
82 store i32 1, i32* %arrayidx1, align 4
86 define void @write28to32_atomic(i32* nocapture %p) nounwind uwtable ssp {
87 ; CHECK-LABEL: @write28to32_atomic(
89 ; CHECK-NEXT: [[P3:%.*]] = bitcast i32* [[P:%.*]] to i8*
90 ; CHECK-NEXT: call void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* align 4 [[P3]], i8 0, i64 28, i32 4)
91 ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 7
92 ; CHECK-NEXT: store atomic i32 1, i32* [[ARRAYIDX1]] unordered, align 4
93 ; CHECK-NEXT: ret void
96 %p3 = bitcast i32* %p to i8*
97 call void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* align 4 %p3, i8 0, i64 32, i32 4)
98 %arrayidx1 = getelementptr inbounds i32, i32* %p, i64 7
99 store atomic i32 1, i32* %arrayidx1 unordered, align 4
103 define void @dontwrite28to32memset(i32* nocapture %p) nounwind uwtable ssp {
104 ; CHECK-LABEL: @dontwrite28to32memset(
106 ; CHECK-NEXT: [[P3:%.*]] = bitcast i32* [[P:%.*]] to i8*
107 ; CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* align 16 [[P3]], i8 0, i64 32, i1 false)
108 ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 7
109 ; CHECK-NEXT: store i32 1, i32* [[ARRAYIDX1]], align 4
110 ; CHECK-NEXT: ret void
113 %p3 = bitcast i32* %p to i8*
114 call void @llvm.memset.p0i8.i64(i8* align 16 %p3, i8 0, i64 32, i1 false)
115 %arrayidx1 = getelementptr inbounds i32, i32* %p, i64 7
116 store i32 1, i32* %arrayidx1, align 4
120 define void @dontwrite28to32memset_atomic(i32* nocapture %p) nounwind uwtable ssp {
121 ; CHECK-LABEL: @dontwrite28to32memset_atomic(
123 ; CHECK-NEXT: [[P3:%.*]] = bitcast i32* [[P:%.*]] to i8*
124 ; CHECK-NEXT: call void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* align 16 [[P3]], i8 0, i64 32, i32 4)
125 ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 7
126 ; CHECK-NEXT: store atomic i32 1, i32* [[ARRAYIDX1]] unordered, align 4
127 ; CHECK-NEXT: ret void
130 %p3 = bitcast i32* %p to i8*
131 call void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* align 16 %p3, i8 0, i64 32, i32 4)
132 %arrayidx1 = getelementptr inbounds i32, i32* %p, i64 7
133 store atomic i32 1, i32* %arrayidx1 unordered, align 4
137 define void @write32to36(%struct.vec2plusi* nocapture %p) nounwind uwtable ssp {
138 ; CHECK-LABEL: @write32to36(
140 ; CHECK-NEXT: [[TMP0:%.*]] = bitcast %struct.vec2plusi* [[P:%.*]] to i8*
141 ; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 [[TMP0]], i8* align 16 bitcast (%struct.vec2plusi* @glob2 to i8*), i64 32, i1 false)
142 ; CHECK-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT_VEC2PLUSI:%.*]], %struct.vec2plusi* [[P]], i64 0, i32 2
143 ; CHECK-NEXT: store i32 1, i32* [[C]], align 4
144 ; CHECK-NEXT: ret void
147 %0 = bitcast %struct.vec2plusi* %p to i8*
148 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 %0, i8* align 16 bitcast (%struct.vec2plusi* @glob2 to i8*), i64 36, i1 false)
149 %c = getelementptr inbounds %struct.vec2plusi, %struct.vec2plusi* %p, i64 0, i32 2
150 store i32 1, i32* %c, align 4
154 define void @write32to36_atomic(%struct.vec2plusi* nocapture %p) nounwind uwtable ssp {
155 ; CHECK-LABEL: @write32to36_atomic(
157 ; CHECK-NEXT: [[TMP0:%.*]] = bitcast %struct.vec2plusi* [[P:%.*]] to i8*
158 ; CHECK-NEXT: tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 16 [[TMP0]], i8* align 16 bitcast (%struct.vec2plusi* @glob2 to i8*), i64 32, i32 4)
159 ; CHECK-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT_VEC2PLUSI:%.*]], %struct.vec2plusi* [[P]], i64 0, i32 2
160 ; CHECK-NEXT: store atomic i32 1, i32* [[C]] unordered, align 4
161 ; CHECK-NEXT: ret void
164 %0 = bitcast %struct.vec2plusi* %p to i8*
165 tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 16 %0, i8* align 16 bitcast (%struct.vec2plusi* @glob2 to i8*), i64 36, i32 4)
166 %c = getelementptr inbounds %struct.vec2plusi, %struct.vec2plusi* %p, i64 0, i32 2
167 store atomic i32 1, i32* %c unordered, align 4
171 ; Atomicity of the store is weaker than the memcpy
172 define void @write32to36_atomic_weaker(%struct.vec2plusi* nocapture %p) nounwind uwtable ssp {
173 ; CHECK-LABEL: @write32to36_atomic_weaker(
175 ; CHECK-NEXT: [[TMP0:%.*]] = bitcast %struct.vec2plusi* [[P:%.*]] to i8*
176 ; CHECK-NEXT: tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 16 [[TMP0]], i8* align 16 bitcast (%struct.vec2plusi* @glob2 to i8*), i64 32, i32 4)
177 ; CHECK-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT_VEC2PLUSI:%.*]], %struct.vec2plusi* [[P]], i64 0, i32 2
178 ; CHECK-NEXT: store i32 1, i32* [[C]], align 4
179 ; CHECK-NEXT: ret void
182 %0 = bitcast %struct.vec2plusi* %p to i8*
183 tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 16 %0, i8* align 16 bitcast (%struct.vec2plusi* @glob2 to i8*), i64 36, i32 4)
184 %c = getelementptr inbounds %struct.vec2plusi, %struct.vec2plusi* %p, i64 0, i32 2
185 store i32 1, i32* %c, align 4
189 define void @write16to32(%struct.vec2* nocapture %p) nounwind uwtable ssp {
190 ; CHECK-LABEL: @write16to32(
192 ; CHECK-NEXT: [[TMP0:%.*]] = bitcast %struct.vec2* [[P:%.*]] to i8*
193 ; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 [[TMP0]], i8* align 16 bitcast (%struct.vec2* @glob1 to i8*), i64 16, i1 false)
194 ; CHECK-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT_VEC2:%.*]], %struct.vec2* [[P]], i64 0, i32 1
195 ; CHECK-NEXT: store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, <4 x i32>* [[C]], align 4
196 ; CHECK-NEXT: ret void
199 %0 = bitcast %struct.vec2* %p to i8*
200 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 %0, i8* align 16 bitcast (%struct.vec2* @glob1 to i8*), i64 32, i1 false)
201 %c = getelementptr inbounds %struct.vec2, %struct.vec2* %p, i64 0, i32 1
202 store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, <4 x i32>* %c, align 4
206 define void @write16to32_atomic(%struct.vec2* nocapture %p) nounwind uwtable ssp {
207 ; CHECK-LABEL: @write16to32_atomic(
209 ; CHECK-NEXT: [[TMP0:%.*]] = bitcast %struct.vec2* [[P:%.*]] to i8*
210 ; CHECK-NEXT: tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 16 [[TMP0]], i8* align 16 bitcast (%struct.vec2* @glob1 to i8*), i64 16, i32 4)
211 ; CHECK-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT_VEC2:%.*]], %struct.vec2* [[P]], i64 0, i32 1
212 ; CHECK-NEXT: store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, <4 x i32>* [[C]], align 4
213 ; CHECK-NEXT: ret void
216 %0 = bitcast %struct.vec2* %p to i8*
217 tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 16 %0, i8* align 16 bitcast (%struct.vec2* @glob1 to i8*), i64 32, i32 4)
218 %c = getelementptr inbounds %struct.vec2, %struct.vec2* %p, i64 0, i32 1
219 store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, <4 x i32>* %c, align 4
223 define void @dontwrite28to32memcpy(%struct.vec2* nocapture %p) nounwind uwtable ssp {
224 ; CHECK-LABEL: @dontwrite28to32memcpy(
226 ; CHECK-NEXT: [[TMP0:%.*]] = bitcast %struct.vec2* [[P:%.*]] to i8*
227 ; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 [[TMP0]], i8* align 16 bitcast (%struct.vec2* @glob1 to i8*), i64 32, i1 false)
228 ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds [[STRUCT_VEC2:%.*]], %struct.vec2* [[P]], i64 0, i32 0, i64 7
229 ; CHECK-NEXT: store i32 1, i32* [[ARRAYIDX1]], align 4
230 ; CHECK-NEXT: ret void
233 %0 = bitcast %struct.vec2* %p to i8*
234 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 %0, i8* align 16 bitcast (%struct.vec2* @glob1 to i8*), i64 32, i1 false)
235 %arrayidx1 = getelementptr inbounds %struct.vec2, %struct.vec2* %p, i64 0, i32 0, i64 7
236 store i32 1, i32* %arrayidx1, align 4
240 define void @dontwrite28to32memcpy_atomic(%struct.vec2* nocapture %p) nounwind uwtable ssp {
241 ; CHECK-LABEL: @dontwrite28to32memcpy_atomic(
243 ; CHECK-NEXT: [[TMP0:%.*]] = bitcast %struct.vec2* [[P:%.*]] to i8*
244 ; CHECK-NEXT: tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 16 [[TMP0]], i8* align 16 bitcast (%struct.vec2* @glob1 to i8*), i64 32, i32 4)
245 ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds [[STRUCT_VEC2:%.*]], %struct.vec2* [[P]], i64 0, i32 0, i64 7
246 ; CHECK-NEXT: store atomic i32 1, i32* [[ARRAYIDX1]] unordered, align 4
247 ; CHECK-NEXT: ret void
250 %0 = bitcast %struct.vec2* %p to i8*
251 tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 16 %0, i8* align 16 bitcast (%struct.vec2* @glob1 to i8*), i64 32, i32 4)
252 %arrayidx1 = getelementptr inbounds %struct.vec2, %struct.vec2* %p, i64 0, i32 0, i64 7
253 store atomic i32 1, i32* %arrayidx1 unordered, align 4
257 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
258 declare void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32) nounwind
259 declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) nounwind
260 declare void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* nocapture, i8, i64, i32) nounwind
262 %struct.trapframe = type { i64, i64, i64 }
264 ; bugzilla 11455 - make sure negative GEP's don't break this optimisation
265 define void @cpu_lwp_fork(%struct.trapframe* %md_regs, i64 %pcb_rsp0) nounwind uwtable noinline ssp {
266 ; CHECK-LABEL: @cpu_lwp_fork(
268 ; CHECK-NEXT: [[TMP0:%.*]] = inttoptr i64 [[PCB_RSP0:%.*]] to %struct.trapframe*
269 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds [[STRUCT_TRAPFRAME:%.*]], %struct.trapframe* [[TMP0]], i64 -1
270 ; CHECK-NEXT: [[TMP1:%.*]] = bitcast %struct.trapframe* [[ADD_PTR]] to i8*
271 ; CHECK-NEXT: [[TMP2:%.*]] = bitcast %struct.trapframe* [[MD_REGS:%.*]] to i8*
272 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[TMP1]], i8* [[TMP2]], i64 24, i1 false)
273 ; CHECK-NEXT: [[TF_TRAPNO:%.*]] = getelementptr inbounds [[STRUCT_TRAPFRAME]], %struct.trapframe* [[TMP0]], i64 -1, i32 1
274 ; CHECK-NEXT: store i64 3, i64* [[TF_TRAPNO]], align 8
275 ; CHECK-NEXT: ret void
278 %0 = inttoptr i64 %pcb_rsp0 to %struct.trapframe*
279 %add.ptr = getelementptr inbounds %struct.trapframe, %struct.trapframe* %0, i64 -1
280 %1 = bitcast %struct.trapframe* %add.ptr to i8*
281 %2 = bitcast %struct.trapframe* %md_regs to i8*
282 call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 24, i1 false)
283 %tf_trapno = getelementptr inbounds %struct.trapframe, %struct.trapframe* %0, i64 -1, i32 1
284 store i64 3, i64* %tf_trapno, align 8
288 define void @write16To23AndThen24To31(i64* nocapture %P, i64 %n64, i32 %n32, i16 %n16, i8 %n8) {
289 ; CHECK-LABEL: @write16To23AndThen24To31(
291 ; CHECK-NEXT: [[BASE0:%.*]] = bitcast i64* [[P:%.*]] to i8*
292 ; CHECK-NEXT: [[MYBASE0:%.*]] = getelementptr inbounds i8, i8* [[BASE0]], i64 0
293 ; CHECK-NEXT: tail call void @llvm.memset.p0i8.i64(i8* align 8 [[MYBASE0]], i8 0, i64 16, i1 false)
294 ; CHECK-NEXT: [[BASE64_2:%.*]] = getelementptr inbounds i64, i64* [[P]], i64 2
295 ; CHECK-NEXT: [[BASE64_3:%.*]] = getelementptr inbounds i64, i64* [[P]], i64 3
296 ; CHECK-NEXT: store i64 3, i64* [[BASE64_2]]
297 ; CHECK-NEXT: store i64 3, i64* [[BASE64_3]]
298 ; CHECK-NEXT: ret void
302 %base0 = bitcast i64* %P to i8*
303 %mybase0 = getelementptr inbounds i8, i8* %base0, i64 0
304 tail call void @llvm.memset.p0i8.i64(i8* align 8 %mybase0, i8 0, i64 32, i1 false)
306 %base64_2 = getelementptr inbounds i64, i64* %P, i64 2
307 %base64_3 = getelementptr inbounds i64, i64* %P, i64 3
309 store i64 3, i64* %base64_2
310 store i64 3, i64* %base64_3
314 define void @write16To23AndThen24To31_atomic(i64* nocapture %P, i64 %n64, i32 %n32, i16 %n16, i8 %n8) {
315 ; CHECK-LABEL: @write16To23AndThen24To31_atomic(
317 ; CHECK-NEXT: [[BASE0:%.*]] = bitcast i64* [[P:%.*]] to i8*
318 ; CHECK-NEXT: [[MYBASE0:%.*]] = getelementptr inbounds i8, i8* [[BASE0]], i64 0
319 ; CHECK-NEXT: tail call void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* align 8 [[MYBASE0]], i8 0, i64 16, i32 8)
320 ; CHECK-NEXT: [[BASE64_2:%.*]] = getelementptr inbounds i64, i64* [[P]], i64 2
321 ; CHECK-NEXT: [[BASE64_3:%.*]] = getelementptr inbounds i64, i64* [[P]], i64 3
322 ; CHECK-NEXT: store atomic i64 3, i64* [[BASE64_2]] unordered, align 8
323 ; CHECK-NEXT: store atomic i64 3, i64* [[BASE64_3]] unordered, align 8
324 ; CHECK-NEXT: ret void
328 %base0 = bitcast i64* %P to i8*
329 %mybase0 = getelementptr inbounds i8, i8* %base0, i64 0
330 tail call void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* align 8 %mybase0, i8 0, i64 32, i32 8)
332 %base64_2 = getelementptr inbounds i64, i64* %P, i64 2
333 %base64_3 = getelementptr inbounds i64, i64* %P, i64 3
335 store atomic i64 3, i64* %base64_2 unordered, align 8
336 store atomic i64 3, i64* %base64_3 unordered, align 8
340 define void @write16To23AndThen24To31_atomic_weaker1(i64* nocapture %P, i64 %n64, i32 %n32, i16 %n16, i8 %n8) {
341 ; CHECK-LABEL: @write16To23AndThen24To31_atomic_weaker1(
343 ; CHECK-NEXT: [[BASE0:%.*]] = bitcast i64* [[P:%.*]] to i8*
344 ; CHECK-NEXT: [[MYBASE0:%.*]] = getelementptr inbounds i8, i8* [[BASE0]], i64 0
345 ; CHECK-NEXT: tail call void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* align 8 [[MYBASE0]], i8 0, i64 16, i32 8)
346 ; CHECK-NEXT: [[BASE64_2:%.*]] = getelementptr inbounds i64, i64* [[P]], i64 2
347 ; CHECK-NEXT: [[BASE64_3:%.*]] = getelementptr inbounds i64, i64* [[P]], i64 3
348 ; CHECK-NEXT: store i64 3, i64* [[BASE64_2]], align 8
349 ; CHECK-NEXT: store atomic i64 3, i64* [[BASE64_3]] unordered, align 8
350 ; CHECK-NEXT: ret void
354 %base0 = bitcast i64* %P to i8*
355 %mybase0 = getelementptr inbounds i8, i8* %base0, i64 0
356 tail call void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* align 8 %mybase0, i8 0, i64 32, i32 8)
358 %base64_2 = getelementptr inbounds i64, i64* %P, i64 2
359 %base64_3 = getelementptr inbounds i64, i64* %P, i64 3
361 store i64 3, i64* %base64_2, align 8
362 store atomic i64 3, i64* %base64_3 unordered, align 8
366 define void @write16To23AndThen24To31_atomic_weaker2(i64* nocapture %P, i64 %n64, i32 %n32, i16 %n16, i8 %n8) {
367 ; CHECK-LABEL: @write16To23AndThen24To31_atomic_weaker2(
369 ; CHECK-NEXT: [[BASE0:%.*]] = bitcast i64* [[P:%.*]] to i8*
370 ; CHECK-NEXT: [[MYBASE0:%.*]] = getelementptr inbounds i8, i8* [[BASE0]], i64 0
371 ; CHECK-NEXT: tail call void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* align 8 [[MYBASE0]], i8 0, i64 16, i32 8)
372 ; CHECK-NEXT: [[BASE64_2:%.*]] = getelementptr inbounds i64, i64* [[P]], i64 2
373 ; CHECK-NEXT: [[BASE64_3:%.*]] = getelementptr inbounds i64, i64* [[P]], i64 3
374 ; CHECK-NEXT: store atomic i64 3, i64* [[BASE64_2]] unordered, align 8
375 ; CHECK-NEXT: store i64 3, i64* [[BASE64_3]], align 8
376 ; CHECK-NEXT: ret void
380 %base0 = bitcast i64* %P to i8*
381 %mybase0 = getelementptr inbounds i8, i8* %base0, i64 0
382 tail call void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* align 8 %mybase0, i8 0, i64 32, i32 8)
384 %base64_2 = getelementptr inbounds i64, i64* %P, i64 2
385 %base64_3 = getelementptr inbounds i64, i64* %P, i64 3
387 store atomic i64 3, i64* %base64_2 unordered, align 8
388 store i64 3, i64* %base64_3, align 8