1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -mtriple=aarch64-linux-gnu -atomic-expand %s | FileCheck %s
4 define i8 @atomic8_load_unordered(ptr %a) nounwind uwtable {
5 ; CHECK-LABEL: @atomic8_load_unordered(
7 ; CHECK-NEXT: [[TMP0:%.*]] = load atomic i8, ptr [[A:%.*]] unordered, align 1, !pcsections !0
8 ; CHECK-NEXT: ret i8 [[TMP0]]
11 %0 = load atomic i8, ptr %a unordered, align 1, !pcsections !0
15 define i8 @atomic8_load_monotonic(ptr %a) nounwind uwtable {
16 ; CHECK-LABEL: @atomic8_load_monotonic(
18 ; CHECK-NEXT: [[TMP0:%.*]] = load atomic i8, ptr [[A:%.*]] monotonic, align 1, !pcsections !0
19 ; CHECK-NEXT: ret i8 [[TMP0]]
22 %0 = load atomic i8, ptr %a monotonic, align 1, !pcsections !0
26 define i8 @atomic8_load_acquire(ptr %a) nounwind uwtable {
27 ; CHECK-LABEL: @atomic8_load_acquire(
29 ; CHECK-NEXT: [[TMP0:%.*]] = load atomic i8, ptr [[A:%.*]] acquire, align 1, !pcsections !0
30 ; CHECK-NEXT: ret i8 [[TMP0]]
33 %0 = load atomic i8, ptr %a acquire, align 1, !pcsections !0
37 define i8 @atomic8_load_seq_cst(ptr %a) nounwind uwtable {
38 ; CHECK-LABEL: @atomic8_load_seq_cst(
40 ; CHECK-NEXT: [[TMP0:%.*]] = load atomic i8, ptr [[A:%.*]] seq_cst, align 1, !pcsections !0
41 ; CHECK-NEXT: ret i8 [[TMP0]]
44 %0 = load atomic i8, ptr %a seq_cst, align 1, !pcsections !0
48 define void @atomic8_store_unordered(ptr %a) nounwind uwtable {
49 ; CHECK-LABEL: @atomic8_store_unordered(
51 ; CHECK-NEXT: store atomic i8 0, ptr [[A:%.*]] unordered, align 1, !pcsections !0
52 ; CHECK-NEXT: ret void
55 store atomic i8 0, ptr %a unordered, align 1, !pcsections !0
59 define void @atomic8_store_monotonic(ptr %a) nounwind uwtable {
60 ; CHECK-LABEL: @atomic8_store_monotonic(
62 ; CHECK-NEXT: store atomic i8 0, ptr [[A:%.*]] monotonic, align 1, !pcsections !0
63 ; CHECK-NEXT: ret void
66 store atomic i8 0, ptr %a monotonic, align 1, !pcsections !0
70 define void @atomic8_store_release(ptr %a) nounwind uwtable {
71 ; CHECK-LABEL: @atomic8_store_release(
73 ; CHECK-NEXT: store atomic i8 0, ptr [[A:%.*]] release, align 1, !pcsections !0
74 ; CHECK-NEXT: ret void
77 store atomic i8 0, ptr %a release, align 1, !pcsections !0
81 define void @atomic8_store_seq_cst(ptr %a) nounwind uwtable {
82 ; CHECK-LABEL: @atomic8_store_seq_cst(
84 ; CHECK-NEXT: store atomic i8 0, ptr [[A:%.*]] seq_cst, align 1, !pcsections !0
85 ; CHECK-NEXT: ret void
88 store atomic i8 0, ptr %a seq_cst, align 1, !pcsections !0
92 define void @atomic8_xchg_monotonic(ptr %a) nounwind uwtable {
93 ; CHECK-LABEL: @atomic8_xchg_monotonic(
95 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
96 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
97 ; CHECK: atomicrmw.start:
98 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
99 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 0 monotonic monotonic, align 1, !pcsections !0
100 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
101 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
102 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
103 ; CHECK: atomicrmw.end:
104 ; CHECK-NEXT: ret void
107 atomicrmw xchg ptr %a, i8 0 monotonic, !pcsections !0
111 define void @atomic8_add_monotonic(ptr %a) nounwind uwtable {
112 ; CHECK-LABEL: @atomic8_add_monotonic(
114 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
115 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
116 ; CHECK: atomicrmw.start:
117 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
118 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 [[LOADED]] monotonic monotonic, align 1, !pcsections !0
119 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
120 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
121 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
122 ; CHECK: atomicrmw.end:
123 ; CHECK-NEXT: ret void
126 atomicrmw add ptr %a, i8 0 monotonic, !pcsections !0
130 define void @atomic8_sub_monotonic(ptr %a) nounwind uwtable {
131 ; CHECK-LABEL: @atomic8_sub_monotonic(
133 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
134 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
135 ; CHECK: atomicrmw.start:
136 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
137 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 [[LOADED]] monotonic monotonic, align 1, !pcsections !0
138 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
139 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
140 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
141 ; CHECK: atomicrmw.end:
142 ; CHECK-NEXT: ret void
145 atomicrmw sub ptr %a, i8 0 monotonic, !pcsections !0
149 define void @atomic8_and_monotonic(ptr %a) nounwind uwtable {
150 ; CHECK-LABEL: @atomic8_and_monotonic(
152 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
153 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
154 ; CHECK: atomicrmw.start:
155 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
156 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 0 monotonic monotonic, align 1, !pcsections !0
157 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
158 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
159 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
160 ; CHECK: atomicrmw.end:
161 ; CHECK-NEXT: ret void
164 atomicrmw and ptr %a, i8 0 monotonic, !pcsections !0
168 define void @atomic8_or_monotonic(ptr %a) nounwind uwtable {
169 ; CHECK-LABEL: @atomic8_or_monotonic(
171 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
172 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
173 ; CHECK: atomicrmw.start:
174 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
175 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 [[LOADED]] monotonic monotonic, align 1, !pcsections !0
176 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
177 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
178 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
179 ; CHECK: atomicrmw.end:
180 ; CHECK-NEXT: ret void
183 atomicrmw or ptr %a, i8 0 monotonic, !pcsections !0
187 define void @atomic8_xor_monotonic(ptr %a) nounwind uwtable {
188 ; CHECK-LABEL: @atomic8_xor_monotonic(
190 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
191 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
192 ; CHECK: atomicrmw.start:
193 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
194 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 [[LOADED]] monotonic monotonic, align 1, !pcsections !0
195 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
196 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
197 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
198 ; CHECK: atomicrmw.end:
199 ; CHECK-NEXT: ret void
202 atomicrmw xor ptr %a, i8 0 monotonic, !pcsections !0
206 define void @atomic8_nand_monotonic(ptr %a) nounwind uwtable {
207 ; CHECK-LABEL: @atomic8_nand_monotonic(
209 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
210 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
211 ; CHECK: atomicrmw.start:
212 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
213 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 -1 monotonic monotonic, align 1, !pcsections !0
214 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
215 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
216 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
217 ; CHECK: atomicrmw.end:
218 ; CHECK-NEXT: ret void
221 atomicrmw nand ptr %a, i8 0 monotonic, !pcsections !0
225 define void @atomic8_xchg_acquire(ptr %a) nounwind uwtable {
226 ; CHECK-LABEL: @atomic8_xchg_acquire(
228 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
229 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
230 ; CHECK: atomicrmw.start:
231 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
232 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 0 acquire acquire, align 1, !pcsections !0
233 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
234 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
235 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
236 ; CHECK: atomicrmw.end:
237 ; CHECK-NEXT: ret void
240 atomicrmw xchg ptr %a, i8 0 acquire, !pcsections !0
244 define void @atomic8_add_acquire(ptr %a) nounwind uwtable {
245 ; CHECK-LABEL: @atomic8_add_acquire(
247 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
248 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
249 ; CHECK: atomicrmw.start:
250 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
251 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 [[LOADED]] acquire acquire, align 1, !pcsections !0
252 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
253 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
254 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
255 ; CHECK: atomicrmw.end:
256 ; CHECK-NEXT: ret void
259 atomicrmw add ptr %a, i8 0 acquire, !pcsections !0
263 define void @atomic8_sub_acquire(ptr %a) nounwind uwtable {
264 ; CHECK-LABEL: @atomic8_sub_acquire(
266 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
267 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
268 ; CHECK: atomicrmw.start:
269 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
270 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 [[LOADED]] acquire acquire, align 1, !pcsections !0
271 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
272 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
273 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
274 ; CHECK: atomicrmw.end:
275 ; CHECK-NEXT: ret void
278 atomicrmw sub ptr %a, i8 0 acquire, !pcsections !0
282 define void @atomic8_and_acquire(ptr %a) nounwind uwtable {
283 ; CHECK-LABEL: @atomic8_and_acquire(
285 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
286 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
287 ; CHECK: atomicrmw.start:
288 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
289 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 0 acquire acquire, align 1, !pcsections !0
290 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
291 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
292 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
293 ; CHECK: atomicrmw.end:
294 ; CHECK-NEXT: ret void
297 atomicrmw and ptr %a, i8 0 acquire, !pcsections !0
301 define void @atomic8_or_acquire(ptr %a) nounwind uwtable {
302 ; CHECK-LABEL: @atomic8_or_acquire(
304 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
305 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
306 ; CHECK: atomicrmw.start:
307 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
308 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 [[LOADED]] acquire acquire, align 1, !pcsections !0
309 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
310 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
311 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
312 ; CHECK: atomicrmw.end:
313 ; CHECK-NEXT: ret void
316 atomicrmw or ptr %a, i8 0 acquire, !pcsections !0
320 define void @atomic8_xor_acquire(ptr %a) nounwind uwtable {
321 ; CHECK-LABEL: @atomic8_xor_acquire(
323 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
324 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
325 ; CHECK: atomicrmw.start:
326 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
327 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 [[LOADED]] acquire acquire, align 1, !pcsections !0
328 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
329 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
330 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
331 ; CHECK: atomicrmw.end:
332 ; CHECK-NEXT: ret void
335 atomicrmw xor ptr %a, i8 0 acquire, !pcsections !0
339 define void @atomic8_nand_acquire(ptr %a) nounwind uwtable {
340 ; CHECK-LABEL: @atomic8_nand_acquire(
342 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
343 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
344 ; CHECK: atomicrmw.start:
345 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
346 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 -1 acquire acquire, align 1, !pcsections !0
347 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
348 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
349 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
350 ; CHECK: atomicrmw.end:
351 ; CHECK-NEXT: ret void
354 atomicrmw nand ptr %a, i8 0 acquire, !pcsections !0
358 define void @atomic8_xchg_release(ptr %a) nounwind uwtable {
359 ; CHECK-LABEL: @atomic8_xchg_release(
361 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
362 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
363 ; CHECK: atomicrmw.start:
364 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
365 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 0 release monotonic, align 1, !pcsections !0
366 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
367 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
368 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
369 ; CHECK: atomicrmw.end:
370 ; CHECK-NEXT: ret void
373 atomicrmw xchg ptr %a, i8 0 release, !pcsections !0
377 define void @atomic8_add_release(ptr %a) nounwind uwtable {
378 ; CHECK-LABEL: @atomic8_add_release(
380 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
381 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
382 ; CHECK: atomicrmw.start:
383 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
384 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 [[LOADED]] release monotonic, align 1, !pcsections !0
385 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
386 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
387 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
388 ; CHECK: atomicrmw.end:
389 ; CHECK-NEXT: ret void
392 atomicrmw add ptr %a, i8 0 release, !pcsections !0
396 define void @atomic8_sub_release(ptr %a) nounwind uwtable {
397 ; CHECK-LABEL: @atomic8_sub_release(
399 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
400 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
401 ; CHECK: atomicrmw.start:
402 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
403 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 [[LOADED]] release monotonic, align 1, !pcsections !0
404 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
405 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
406 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
407 ; CHECK: atomicrmw.end:
408 ; CHECK-NEXT: ret void
411 atomicrmw sub ptr %a, i8 0 release, !pcsections !0
415 define void @atomic8_and_release(ptr %a) nounwind uwtable {
416 ; CHECK-LABEL: @atomic8_and_release(
418 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
419 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
420 ; CHECK: atomicrmw.start:
421 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
422 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 0 release monotonic, align 1, !pcsections !0
423 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
424 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
425 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
426 ; CHECK: atomicrmw.end:
427 ; CHECK-NEXT: ret void
430 atomicrmw and ptr %a, i8 0 release, !pcsections !0
434 define void @atomic8_or_release(ptr %a) nounwind uwtable {
435 ; CHECK-LABEL: @atomic8_or_release(
437 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
438 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
439 ; CHECK: atomicrmw.start:
440 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
441 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 [[LOADED]] release monotonic, align 1, !pcsections !0
442 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
443 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
444 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
445 ; CHECK: atomicrmw.end:
446 ; CHECK-NEXT: ret void
449 atomicrmw or ptr %a, i8 0 release, !pcsections !0
453 define void @atomic8_xor_release(ptr %a) nounwind uwtable {
454 ; CHECK-LABEL: @atomic8_xor_release(
456 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
457 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
458 ; CHECK: atomicrmw.start:
459 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
460 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 [[LOADED]] release monotonic, align 1, !pcsections !0
461 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
462 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
463 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
464 ; CHECK: atomicrmw.end:
465 ; CHECK-NEXT: ret void
468 atomicrmw xor ptr %a, i8 0 release, !pcsections !0
472 define void @atomic8_nand_release(ptr %a) nounwind uwtable {
473 ; CHECK-LABEL: @atomic8_nand_release(
475 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
476 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
477 ; CHECK: atomicrmw.start:
478 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
479 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 -1 release monotonic, align 1, !pcsections !0
480 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
481 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
482 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
483 ; CHECK: atomicrmw.end:
484 ; CHECK-NEXT: ret void
487 atomicrmw nand ptr %a, i8 0 release, !pcsections !0
491 define void @atomic8_xchg_acq_rel(ptr %a) nounwind uwtable {
492 ; CHECK-LABEL: @atomic8_xchg_acq_rel(
494 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
495 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
496 ; CHECK: atomicrmw.start:
497 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
498 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 0 acq_rel acquire, align 1, !pcsections !0
499 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
500 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
501 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
502 ; CHECK: atomicrmw.end:
503 ; CHECK-NEXT: ret void
506 atomicrmw xchg ptr %a, i8 0 acq_rel, !pcsections !0
510 define void @atomic8_add_acq_rel(ptr %a) nounwind uwtable {
511 ; CHECK-LABEL: @atomic8_add_acq_rel(
513 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
514 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
515 ; CHECK: atomicrmw.start:
516 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
517 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 [[LOADED]] acq_rel acquire, align 1, !pcsections !0
518 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
519 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
520 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
521 ; CHECK: atomicrmw.end:
522 ; CHECK-NEXT: ret void
525 atomicrmw add ptr %a, i8 0 acq_rel, !pcsections !0
529 define void @atomic8_sub_acq_rel(ptr %a) nounwind uwtable {
530 ; CHECK-LABEL: @atomic8_sub_acq_rel(
532 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
533 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
534 ; CHECK: atomicrmw.start:
535 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
536 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 [[LOADED]] acq_rel acquire, align 1, !pcsections !0
537 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
538 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
539 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
540 ; CHECK: atomicrmw.end:
541 ; CHECK-NEXT: ret void
544 atomicrmw sub ptr %a, i8 0 acq_rel, !pcsections !0
548 define void @atomic8_and_acq_rel(ptr %a) nounwind uwtable {
549 ; CHECK-LABEL: @atomic8_and_acq_rel(
551 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
552 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
553 ; CHECK: atomicrmw.start:
554 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
555 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 0 acq_rel acquire, align 1, !pcsections !0
556 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
557 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
558 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
559 ; CHECK: atomicrmw.end:
560 ; CHECK-NEXT: ret void
563 atomicrmw and ptr %a, i8 0 acq_rel, !pcsections !0
567 define void @atomic8_or_acq_rel(ptr %a) nounwind uwtable {
568 ; CHECK-LABEL: @atomic8_or_acq_rel(
570 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
571 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
572 ; CHECK: atomicrmw.start:
573 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
574 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 [[LOADED]] acq_rel acquire, align 1, !pcsections !0
575 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
576 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
577 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
578 ; CHECK: atomicrmw.end:
579 ; CHECK-NEXT: ret void
582 atomicrmw or ptr %a, i8 0 acq_rel, !pcsections !0
586 define void @atomic8_xor_acq_rel(ptr %a) nounwind uwtable {
587 ; CHECK-LABEL: @atomic8_xor_acq_rel(
589 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
590 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
591 ; CHECK: atomicrmw.start:
592 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
593 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 [[LOADED]] acq_rel acquire, align 1, !pcsections !0
594 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
595 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
596 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
597 ; CHECK: atomicrmw.end:
598 ; CHECK-NEXT: ret void
601 atomicrmw xor ptr %a, i8 0 acq_rel, !pcsections !0
605 define void @atomic8_nand_acq_rel(ptr %a) nounwind uwtable {
606 ; CHECK-LABEL: @atomic8_nand_acq_rel(
608 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
609 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
610 ; CHECK: atomicrmw.start:
611 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
612 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 -1 acq_rel acquire, align 1, !pcsections !0
613 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
614 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
615 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
616 ; CHECK: atomicrmw.end:
617 ; CHECK-NEXT: ret void
620 atomicrmw nand ptr %a, i8 0 acq_rel, !pcsections !0
624 define void @atomic8_xchg_seq_cst(ptr %a) nounwind uwtable {
625 ; CHECK-LABEL: @atomic8_xchg_seq_cst(
627 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
628 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
629 ; CHECK: atomicrmw.start:
630 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
631 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 0 seq_cst seq_cst, align 1, !pcsections !0
632 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
633 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
634 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
635 ; CHECK: atomicrmw.end:
636 ; CHECK-NEXT: ret void
639 atomicrmw xchg ptr %a, i8 0 seq_cst, !pcsections !0
643 define void @atomic8_add_seq_cst(ptr %a) nounwind uwtable {
644 ; CHECK-LABEL: @atomic8_add_seq_cst(
646 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
647 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
648 ; CHECK: atomicrmw.start:
649 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
650 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 [[LOADED]] seq_cst seq_cst, align 1, !pcsections !0
651 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
652 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
653 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
654 ; CHECK: atomicrmw.end:
655 ; CHECK-NEXT: ret void
658 atomicrmw add ptr %a, i8 0 seq_cst, !pcsections !0
662 define void @atomic8_sub_seq_cst(ptr %a) nounwind uwtable {
663 ; CHECK-LABEL: @atomic8_sub_seq_cst(
665 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
666 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
667 ; CHECK: atomicrmw.start:
668 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
669 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 [[LOADED]] seq_cst seq_cst, align 1, !pcsections !0
670 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
671 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
672 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
673 ; CHECK: atomicrmw.end:
674 ; CHECK-NEXT: ret void
677 atomicrmw sub ptr %a, i8 0 seq_cst, !pcsections !0
681 define void @atomic8_and_seq_cst(ptr %a) nounwind uwtable {
682 ; CHECK-LABEL: @atomic8_and_seq_cst(
684 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
685 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
686 ; CHECK: atomicrmw.start:
687 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
688 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 0 seq_cst seq_cst, align 1, !pcsections !0
689 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
690 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
691 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
692 ; CHECK: atomicrmw.end:
693 ; CHECK-NEXT: ret void
696 atomicrmw and ptr %a, i8 0 seq_cst, !pcsections !0
700 define void @atomic8_or_seq_cst(ptr %a) nounwind uwtable {
701 ; CHECK-LABEL: @atomic8_or_seq_cst(
703 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
704 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
705 ; CHECK: atomicrmw.start:
706 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
707 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 [[LOADED]] seq_cst seq_cst, align 1, !pcsections !0
708 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
709 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
710 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
711 ; CHECK: atomicrmw.end:
712 ; CHECK-NEXT: ret void
715 atomicrmw or ptr %a, i8 0 seq_cst, !pcsections !0
719 define void @atomic8_xor_seq_cst(ptr %a) nounwind uwtable {
720 ; CHECK-LABEL: @atomic8_xor_seq_cst(
722 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
723 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
724 ; CHECK: atomicrmw.start:
725 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
726 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 [[LOADED]] seq_cst seq_cst, align 1, !pcsections !0
727 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
728 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
729 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
730 ; CHECK: atomicrmw.end:
731 ; CHECK-NEXT: ret void
734 atomicrmw xor ptr %a, i8 0 seq_cst, !pcsections !0
738 define void @atomic8_nand_seq_cst(ptr %a) nounwind uwtable {
739 ; CHECK-LABEL: @atomic8_nand_seq_cst(
741 ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[A:%.*]], align 1, !pcsections !0
742 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
743 ; CHECK: atomicrmw.start:
744 ; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
745 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 [[LOADED]], i8 -1 seq_cst seq_cst, align 1, !pcsections !0
746 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i8, i1 } [[TMP1]], 1, !pcsections !0
747 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i8, i1 } [[TMP1]], 0, !pcsections !0
748 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
749 ; CHECK: atomicrmw.end:
750 ; CHECK-NEXT: ret void
753 atomicrmw nand ptr %a, i8 0 seq_cst, !pcsections !0
757 define void @atomic8_cas_monotonic(ptr %a) nounwind uwtable {
758 ; CHECK-LABEL: @atomic8_cas_monotonic(
760 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i8 0, i8 1 monotonic monotonic, align 1, !pcsections !0
761 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 0, i8 1 monotonic acquire, align 1, !pcsections !0
762 ; CHECK-NEXT: [[TMP2:%.*]] = cmpxchg ptr [[A]], i8 0, i8 1 monotonic seq_cst, align 1, !pcsections !0
763 ; CHECK-NEXT: ret void
766 cmpxchg ptr %a, i8 0, i8 1 monotonic monotonic, !pcsections !0
767 cmpxchg ptr %a, i8 0, i8 1 monotonic acquire, !pcsections !0
768 cmpxchg ptr %a, i8 0, i8 1 monotonic seq_cst, !pcsections !0
772 define void @atomic8_cas_acquire(ptr %a) nounwind uwtable {
773 ; CHECK-LABEL: @atomic8_cas_acquire(
775 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i8 0, i8 1 acquire monotonic, align 1, !pcsections !0
776 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 0, i8 1 acquire acquire, align 1, !pcsections !0
777 ; CHECK-NEXT: [[TMP2:%.*]] = cmpxchg ptr [[A]], i8 0, i8 1 acquire seq_cst, align 1, !pcsections !0
778 ; CHECK-NEXT: ret void
781 cmpxchg ptr %a, i8 0, i8 1 acquire monotonic, !pcsections !0
782 cmpxchg ptr %a, i8 0, i8 1 acquire acquire, !pcsections !0
783 cmpxchg ptr %a, i8 0, i8 1 acquire seq_cst, !pcsections !0
787 define void @atomic8_cas_release(ptr %a) nounwind uwtable {
788 ; CHECK-LABEL: @atomic8_cas_release(
790 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i8 0, i8 1 release monotonic, align 1, !pcsections !0
791 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 0, i8 1 release acquire, align 1, !pcsections !0
792 ; CHECK-NEXT: [[TMP2:%.*]] = cmpxchg ptr [[A]], i8 0, i8 1 release seq_cst, align 1, !pcsections !0
793 ; CHECK-NEXT: ret void
796 cmpxchg ptr %a, i8 0, i8 1 release monotonic, !pcsections !0
797 cmpxchg ptr %a, i8 0, i8 1 release acquire, !pcsections !0
798 cmpxchg ptr %a, i8 0, i8 1 release seq_cst, !pcsections !0
802 define void @atomic8_cas_acq_rel(ptr %a) nounwind uwtable {
803 ; CHECK-LABEL: @atomic8_cas_acq_rel(
805 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i8 0, i8 1 acq_rel monotonic, align 1, !pcsections !0
806 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 0, i8 1 acq_rel acquire, align 1, !pcsections !0
807 ; CHECK-NEXT: [[TMP2:%.*]] = cmpxchg ptr [[A]], i8 0, i8 1 acq_rel seq_cst, align 1, !pcsections !0
808 ; CHECK-NEXT: ret void
811 cmpxchg ptr %a, i8 0, i8 1 acq_rel monotonic, !pcsections !0
812 cmpxchg ptr %a, i8 0, i8 1 acq_rel acquire, !pcsections !0
813 cmpxchg ptr %a, i8 0, i8 1 acq_rel seq_cst, !pcsections !0
817 define void @atomic8_cas_seq_cst(ptr %a) nounwind uwtable {
818 ; CHECK-LABEL: @atomic8_cas_seq_cst(
820 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i8 0, i8 1 seq_cst monotonic, align 1, !pcsections !0
821 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i8 0, i8 1 seq_cst acquire, align 1, !pcsections !0
822 ; CHECK-NEXT: [[TMP2:%.*]] = cmpxchg ptr [[A]], i8 0, i8 1 seq_cst seq_cst, align 1, !pcsections !0
823 ; CHECK-NEXT: ret void
826 cmpxchg ptr %a, i8 0, i8 1 seq_cst monotonic, !pcsections !0
827 cmpxchg ptr %a, i8 0, i8 1 seq_cst acquire, !pcsections !0
828 cmpxchg ptr %a, i8 0, i8 1 seq_cst seq_cst, !pcsections !0
832 define i16 @atomic16_load_unordered(ptr %a) nounwind uwtable {
833 ; CHECK-LABEL: @atomic16_load_unordered(
835 ; CHECK-NEXT: [[TMP0:%.*]] = load atomic i16, ptr [[A:%.*]] unordered, align 2, !pcsections !0
836 ; CHECK-NEXT: ret i16 [[TMP0]]
839 %0 = load atomic i16, ptr %a unordered, align 2, !pcsections !0
843 define i16 @atomic16_load_monotonic(ptr %a) nounwind uwtable {
844 ; CHECK-LABEL: @atomic16_load_monotonic(
846 ; CHECK-NEXT: [[TMP0:%.*]] = load atomic i16, ptr [[A:%.*]] monotonic, align 2, !pcsections !0
847 ; CHECK-NEXT: ret i16 [[TMP0]]
850 %0 = load atomic i16, ptr %a monotonic, align 2, !pcsections !0
854 define i16 @atomic16_load_acquire(ptr %a) nounwind uwtable {
855 ; CHECK-LABEL: @atomic16_load_acquire(
857 ; CHECK-NEXT: [[TMP0:%.*]] = load atomic i16, ptr [[A:%.*]] acquire, align 2, !pcsections !0
858 ; CHECK-NEXT: ret i16 [[TMP0]]
861 %0 = load atomic i16, ptr %a acquire, align 2, !pcsections !0
865 define i16 @atomic16_load_seq_cst(ptr %a) nounwind uwtable {
866 ; CHECK-LABEL: @atomic16_load_seq_cst(
868 ; CHECK-NEXT: [[TMP0:%.*]] = load atomic i16, ptr [[A:%.*]] seq_cst, align 2, !pcsections !0
869 ; CHECK-NEXT: ret i16 [[TMP0]]
872 %0 = load atomic i16, ptr %a seq_cst, align 2, !pcsections !0
876 define void @atomic16_store_unordered(ptr %a) nounwind uwtable {
877 ; CHECK-LABEL: @atomic16_store_unordered(
879 ; CHECK-NEXT: store atomic i16 0, ptr [[A:%.*]] unordered, align 2, !pcsections !0
880 ; CHECK-NEXT: ret void
883 store atomic i16 0, ptr %a unordered, align 2, !pcsections !0
887 define void @atomic16_store_monotonic(ptr %a) nounwind uwtable {
888 ; CHECK-LABEL: @atomic16_store_monotonic(
890 ; CHECK-NEXT: store atomic i16 0, ptr [[A:%.*]] monotonic, align 2, !pcsections !0
891 ; CHECK-NEXT: ret void
894 store atomic i16 0, ptr %a monotonic, align 2, !pcsections !0
898 define void @atomic16_store_release(ptr %a) nounwind uwtable {
899 ; CHECK-LABEL: @atomic16_store_release(
901 ; CHECK-NEXT: store atomic i16 0, ptr [[A:%.*]] release, align 2, !pcsections !0
902 ; CHECK-NEXT: ret void
905 store atomic i16 0, ptr %a release, align 2, !pcsections !0
909 define void @atomic16_store_seq_cst(ptr %a) nounwind uwtable {
910 ; CHECK-LABEL: @atomic16_store_seq_cst(
912 ; CHECK-NEXT: store atomic i16 0, ptr [[A:%.*]] seq_cst, align 2, !pcsections !0
913 ; CHECK-NEXT: ret void
916 store atomic i16 0, ptr %a seq_cst, align 2, !pcsections !0
920 define void @atomic16_xchg_monotonic(ptr %a) nounwind uwtable {
921 ; CHECK-LABEL: @atomic16_xchg_monotonic(
923 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
924 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
925 ; CHECK: atomicrmw.start:
926 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
927 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 0 monotonic monotonic, align 2, !pcsections !0
928 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
929 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
930 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
931 ; CHECK: atomicrmw.end:
932 ; CHECK-NEXT: ret void
935 atomicrmw xchg ptr %a, i16 0 monotonic, !pcsections !0
939 define void @atomic16_add_monotonic(ptr %a) nounwind uwtable {
940 ; CHECK-LABEL: @atomic16_add_monotonic(
942 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
943 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
944 ; CHECK: atomicrmw.start:
945 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
946 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 [[LOADED]] monotonic monotonic, align 2, !pcsections !0
947 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
948 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
949 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
950 ; CHECK: atomicrmw.end:
951 ; CHECK-NEXT: ret void
954 atomicrmw add ptr %a, i16 0 monotonic, !pcsections !0
958 define void @atomic16_sub_monotonic(ptr %a) nounwind uwtable {
959 ; CHECK-LABEL: @atomic16_sub_monotonic(
961 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
962 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
963 ; CHECK: atomicrmw.start:
964 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
965 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 [[LOADED]] monotonic monotonic, align 2, !pcsections !0
966 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
967 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
968 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
969 ; CHECK: atomicrmw.end:
970 ; CHECK-NEXT: ret void
973 atomicrmw sub ptr %a, i16 0 monotonic, !pcsections !0
977 define void @atomic16_and_monotonic(ptr %a) nounwind uwtable {
978 ; CHECK-LABEL: @atomic16_and_monotonic(
980 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
981 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
982 ; CHECK: atomicrmw.start:
983 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
984 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 0 monotonic monotonic, align 2, !pcsections !0
985 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
986 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
987 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
988 ; CHECK: atomicrmw.end:
989 ; CHECK-NEXT: ret void
992 atomicrmw and ptr %a, i16 0 monotonic, !pcsections !0
996 define void @atomic16_or_monotonic(ptr %a) nounwind uwtable {
997 ; CHECK-LABEL: @atomic16_or_monotonic(
999 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1000 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1001 ; CHECK: atomicrmw.start:
1002 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1003 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 [[LOADED]] monotonic monotonic, align 2, !pcsections !0
1004 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1005 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1006 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1007 ; CHECK: atomicrmw.end:
1008 ; CHECK-NEXT: ret void
1011 atomicrmw or ptr %a, i16 0 monotonic, !pcsections !0
1015 define void @atomic16_xor_monotonic(ptr %a) nounwind uwtable {
1016 ; CHECK-LABEL: @atomic16_xor_monotonic(
1017 ; CHECK-NEXT: entry:
1018 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1019 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1020 ; CHECK: atomicrmw.start:
1021 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1022 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 [[LOADED]] monotonic monotonic, align 2, !pcsections !0
1023 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1024 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1025 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1026 ; CHECK: atomicrmw.end:
1027 ; CHECK-NEXT: ret void
1030 atomicrmw xor ptr %a, i16 0 monotonic, !pcsections !0
1034 define void @atomic16_nand_monotonic(ptr %a) nounwind uwtable {
1035 ; CHECK-LABEL: @atomic16_nand_monotonic(
1036 ; CHECK-NEXT: entry:
1037 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1038 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1039 ; CHECK: atomicrmw.start:
1040 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1041 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 -1 monotonic monotonic, align 2, !pcsections !0
1042 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1043 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1044 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1045 ; CHECK: atomicrmw.end:
1046 ; CHECK-NEXT: ret void
1049 atomicrmw nand ptr %a, i16 0 monotonic, !pcsections !0
1053 define void @atomic16_xchg_acquire(ptr %a) nounwind uwtable {
1054 ; CHECK-LABEL: @atomic16_xchg_acquire(
1055 ; CHECK-NEXT: entry:
1056 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1057 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1058 ; CHECK: atomicrmw.start:
1059 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1060 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 0 acquire acquire, align 2, !pcsections !0
1061 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1062 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1063 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1064 ; CHECK: atomicrmw.end:
1065 ; CHECK-NEXT: ret void
1068 atomicrmw xchg ptr %a, i16 0 acquire, !pcsections !0
1072 define void @atomic16_add_acquire(ptr %a) nounwind uwtable {
1073 ; CHECK-LABEL: @atomic16_add_acquire(
1074 ; CHECK-NEXT: entry:
1075 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1076 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1077 ; CHECK: atomicrmw.start:
1078 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1079 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 [[LOADED]] acquire acquire, align 2, !pcsections !0
1080 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1081 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1082 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1083 ; CHECK: atomicrmw.end:
1084 ; CHECK-NEXT: ret void
1087 atomicrmw add ptr %a, i16 0 acquire, !pcsections !0
1091 define void @atomic16_sub_acquire(ptr %a) nounwind uwtable {
1092 ; CHECK-LABEL: @atomic16_sub_acquire(
1093 ; CHECK-NEXT: entry:
1094 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1095 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1096 ; CHECK: atomicrmw.start:
1097 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1098 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 [[LOADED]] acquire acquire, align 2, !pcsections !0
1099 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1100 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1101 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1102 ; CHECK: atomicrmw.end:
1103 ; CHECK-NEXT: ret void
1106 atomicrmw sub ptr %a, i16 0 acquire, !pcsections !0
1110 define void @atomic16_and_acquire(ptr %a) nounwind uwtable {
1111 ; CHECK-LABEL: @atomic16_and_acquire(
1112 ; CHECK-NEXT: entry:
1113 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1114 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1115 ; CHECK: atomicrmw.start:
1116 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1117 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 0 acquire acquire, align 2, !pcsections !0
1118 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1119 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1120 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1121 ; CHECK: atomicrmw.end:
1122 ; CHECK-NEXT: ret void
1125 atomicrmw and ptr %a, i16 0 acquire, !pcsections !0
1129 define void @atomic16_or_acquire(ptr %a) nounwind uwtable {
1130 ; CHECK-LABEL: @atomic16_or_acquire(
1131 ; CHECK-NEXT: entry:
1132 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1133 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1134 ; CHECK: atomicrmw.start:
1135 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1136 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 [[LOADED]] acquire acquire, align 2, !pcsections !0
1137 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1138 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1139 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1140 ; CHECK: atomicrmw.end:
1141 ; CHECK-NEXT: ret void
1144 atomicrmw or ptr %a, i16 0 acquire, !pcsections !0
1148 define void @atomic16_xor_acquire(ptr %a) nounwind uwtable {
1149 ; CHECK-LABEL: @atomic16_xor_acquire(
1150 ; CHECK-NEXT: entry:
1151 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1152 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1153 ; CHECK: atomicrmw.start:
1154 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1155 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 [[LOADED]] acquire acquire, align 2, !pcsections !0
1156 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1157 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1158 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1159 ; CHECK: atomicrmw.end:
1160 ; CHECK-NEXT: ret void
1163 atomicrmw xor ptr %a, i16 0 acquire, !pcsections !0
1167 define void @atomic16_nand_acquire(ptr %a) nounwind uwtable {
1168 ; CHECK-LABEL: @atomic16_nand_acquire(
1169 ; CHECK-NEXT: entry:
1170 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1171 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1172 ; CHECK: atomicrmw.start:
1173 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1174 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 -1 acquire acquire, align 2, !pcsections !0
1175 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1176 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1177 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1178 ; CHECK: atomicrmw.end:
1179 ; CHECK-NEXT: ret void
1182 atomicrmw nand ptr %a, i16 0 acquire, !pcsections !0
1186 define void @atomic16_xchg_release(ptr %a) nounwind uwtable {
1187 ; CHECK-LABEL: @atomic16_xchg_release(
1188 ; CHECK-NEXT: entry:
1189 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1190 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1191 ; CHECK: atomicrmw.start:
1192 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1193 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 0 release monotonic, align 2, !pcsections !0
1194 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1195 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1196 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1197 ; CHECK: atomicrmw.end:
1198 ; CHECK-NEXT: ret void
1201 atomicrmw xchg ptr %a, i16 0 release, !pcsections !0
1205 define void @atomic16_add_release(ptr %a) nounwind uwtable {
1206 ; CHECK-LABEL: @atomic16_add_release(
1207 ; CHECK-NEXT: entry:
1208 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1209 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1210 ; CHECK: atomicrmw.start:
1211 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1212 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 [[LOADED]] release monotonic, align 2, !pcsections !0
1213 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1214 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1215 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1216 ; CHECK: atomicrmw.end:
1217 ; CHECK-NEXT: ret void
1220 atomicrmw add ptr %a, i16 0 release, !pcsections !0
1224 define void @atomic16_sub_release(ptr %a) nounwind uwtable {
1225 ; CHECK-LABEL: @atomic16_sub_release(
1226 ; CHECK-NEXT: entry:
1227 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1228 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1229 ; CHECK: atomicrmw.start:
1230 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1231 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 [[LOADED]] release monotonic, align 2, !pcsections !0
1232 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1233 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1234 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1235 ; CHECK: atomicrmw.end:
1236 ; CHECK-NEXT: ret void
1239 atomicrmw sub ptr %a, i16 0 release, !pcsections !0
1243 define void @atomic16_and_release(ptr %a) nounwind uwtable {
1244 ; CHECK-LABEL: @atomic16_and_release(
1245 ; CHECK-NEXT: entry:
1246 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1247 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1248 ; CHECK: atomicrmw.start:
1249 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1250 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 0 release monotonic, align 2, !pcsections !0
1251 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1252 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1253 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1254 ; CHECK: atomicrmw.end:
1255 ; CHECK-NEXT: ret void
1258 atomicrmw and ptr %a, i16 0 release, !pcsections !0
1262 define void @atomic16_or_release(ptr %a) nounwind uwtable {
1263 ; CHECK-LABEL: @atomic16_or_release(
1264 ; CHECK-NEXT: entry:
1265 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1266 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1267 ; CHECK: atomicrmw.start:
1268 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1269 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 [[LOADED]] release monotonic, align 2, !pcsections !0
1270 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1271 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1272 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1273 ; CHECK: atomicrmw.end:
1274 ; CHECK-NEXT: ret void
1277 atomicrmw or ptr %a, i16 0 release, !pcsections !0
1281 define void @atomic16_xor_release(ptr %a) nounwind uwtable {
1282 ; CHECK-LABEL: @atomic16_xor_release(
1283 ; CHECK-NEXT: entry:
1284 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1285 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1286 ; CHECK: atomicrmw.start:
1287 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1288 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 [[LOADED]] release monotonic, align 2, !pcsections !0
1289 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1290 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1291 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1292 ; CHECK: atomicrmw.end:
1293 ; CHECK-NEXT: ret void
1296 atomicrmw xor ptr %a, i16 0 release, !pcsections !0
1300 define void @atomic16_nand_release(ptr %a) nounwind uwtable {
1301 ; CHECK-LABEL: @atomic16_nand_release(
1302 ; CHECK-NEXT: entry:
1303 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1304 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1305 ; CHECK: atomicrmw.start:
1306 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1307 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 -1 release monotonic, align 2, !pcsections !0
1308 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1309 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1310 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1311 ; CHECK: atomicrmw.end:
1312 ; CHECK-NEXT: ret void
1315 atomicrmw nand ptr %a, i16 0 release, !pcsections !0
1319 define void @atomic16_xchg_acq_rel(ptr %a) nounwind uwtable {
1320 ; CHECK-LABEL: @atomic16_xchg_acq_rel(
1321 ; CHECK-NEXT: entry:
1322 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1323 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1324 ; CHECK: atomicrmw.start:
1325 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1326 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 0 acq_rel acquire, align 2, !pcsections !0
1327 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1328 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1329 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1330 ; CHECK: atomicrmw.end:
1331 ; CHECK-NEXT: ret void
1334 atomicrmw xchg ptr %a, i16 0 acq_rel, !pcsections !0
1338 define void @atomic16_add_acq_rel(ptr %a) nounwind uwtable {
1339 ; CHECK-LABEL: @atomic16_add_acq_rel(
1340 ; CHECK-NEXT: entry:
1341 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1342 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1343 ; CHECK: atomicrmw.start:
1344 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1345 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 [[LOADED]] acq_rel acquire, align 2, !pcsections !0
1346 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1347 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1348 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1349 ; CHECK: atomicrmw.end:
1350 ; CHECK-NEXT: ret void
1353 atomicrmw add ptr %a, i16 0 acq_rel, !pcsections !0
1357 define void @atomic16_sub_acq_rel(ptr %a) nounwind uwtable {
1358 ; CHECK-LABEL: @atomic16_sub_acq_rel(
1359 ; CHECK-NEXT: entry:
1360 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1361 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1362 ; CHECK: atomicrmw.start:
1363 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1364 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 [[LOADED]] acq_rel acquire, align 2, !pcsections !0
1365 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1366 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1367 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1368 ; CHECK: atomicrmw.end:
1369 ; CHECK-NEXT: ret void
1372 atomicrmw sub ptr %a, i16 0 acq_rel, !pcsections !0
1376 define void @atomic16_and_acq_rel(ptr %a) nounwind uwtable {
1377 ; CHECK-LABEL: @atomic16_and_acq_rel(
1378 ; CHECK-NEXT: entry:
1379 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1380 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1381 ; CHECK: atomicrmw.start:
1382 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1383 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 0 acq_rel acquire, align 2, !pcsections !0
1384 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1385 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1386 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1387 ; CHECK: atomicrmw.end:
1388 ; CHECK-NEXT: ret void
1391 atomicrmw and ptr %a, i16 0 acq_rel, !pcsections !0
1395 define void @atomic16_or_acq_rel(ptr %a) nounwind uwtable {
1396 ; CHECK-LABEL: @atomic16_or_acq_rel(
1397 ; CHECK-NEXT: entry:
1398 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1399 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1400 ; CHECK: atomicrmw.start:
1401 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1402 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 [[LOADED]] acq_rel acquire, align 2, !pcsections !0
1403 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1404 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1405 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1406 ; CHECK: atomicrmw.end:
1407 ; CHECK-NEXT: ret void
1410 atomicrmw or ptr %a, i16 0 acq_rel, !pcsections !0
1414 define void @atomic16_xor_acq_rel(ptr %a) nounwind uwtable {
1415 ; CHECK-LABEL: @atomic16_xor_acq_rel(
1416 ; CHECK-NEXT: entry:
1417 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1418 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1419 ; CHECK: atomicrmw.start:
1420 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1421 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 [[LOADED]] acq_rel acquire, align 2, !pcsections !0
1422 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1423 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1424 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1425 ; CHECK: atomicrmw.end:
1426 ; CHECK-NEXT: ret void
1429 atomicrmw xor ptr %a, i16 0 acq_rel, !pcsections !0
1433 define void @atomic16_nand_acq_rel(ptr %a) nounwind uwtable {
1434 ; CHECK-LABEL: @atomic16_nand_acq_rel(
1435 ; CHECK-NEXT: entry:
1436 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1437 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1438 ; CHECK: atomicrmw.start:
1439 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1440 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 -1 acq_rel acquire, align 2, !pcsections !0
1441 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1442 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1443 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1444 ; CHECK: atomicrmw.end:
1445 ; CHECK-NEXT: ret void
1448 atomicrmw nand ptr %a, i16 0 acq_rel, !pcsections !0
1452 define void @atomic16_xchg_seq_cst(ptr %a) nounwind uwtable {
1453 ; CHECK-LABEL: @atomic16_xchg_seq_cst(
1454 ; CHECK-NEXT: entry:
1455 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1456 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1457 ; CHECK: atomicrmw.start:
1458 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1459 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 0 seq_cst seq_cst, align 2, !pcsections !0
1460 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1461 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1462 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1463 ; CHECK: atomicrmw.end:
1464 ; CHECK-NEXT: ret void
1467 atomicrmw xchg ptr %a, i16 0 seq_cst, !pcsections !0
1471 define void @atomic16_add_seq_cst(ptr %a) nounwind uwtable {
1472 ; CHECK-LABEL: @atomic16_add_seq_cst(
1473 ; CHECK-NEXT: entry:
1474 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1475 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1476 ; CHECK: atomicrmw.start:
1477 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1478 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 [[LOADED]] seq_cst seq_cst, align 2, !pcsections !0
1479 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1480 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1481 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1482 ; CHECK: atomicrmw.end:
1483 ; CHECK-NEXT: ret void
1486 atomicrmw add ptr %a, i16 0 seq_cst, !pcsections !0
1490 define void @atomic16_sub_seq_cst(ptr %a) nounwind uwtable {
1491 ; CHECK-LABEL: @atomic16_sub_seq_cst(
1492 ; CHECK-NEXT: entry:
1493 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1494 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1495 ; CHECK: atomicrmw.start:
1496 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1497 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 [[LOADED]] seq_cst seq_cst, align 2, !pcsections !0
1498 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1499 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1500 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1501 ; CHECK: atomicrmw.end:
1502 ; CHECK-NEXT: ret void
1505 atomicrmw sub ptr %a, i16 0 seq_cst, !pcsections !0
1509 define void @atomic16_and_seq_cst(ptr %a) nounwind uwtable {
1510 ; CHECK-LABEL: @atomic16_and_seq_cst(
1511 ; CHECK-NEXT: entry:
1512 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1513 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1514 ; CHECK: atomicrmw.start:
1515 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1516 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 0 seq_cst seq_cst, align 2, !pcsections !0
1517 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1518 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1519 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1520 ; CHECK: atomicrmw.end:
1521 ; CHECK-NEXT: ret void
1524 atomicrmw and ptr %a, i16 0 seq_cst, !pcsections !0
1528 define void @atomic16_or_seq_cst(ptr %a) nounwind uwtable {
1529 ; CHECK-LABEL: @atomic16_or_seq_cst(
1530 ; CHECK-NEXT: entry:
1531 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1532 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1533 ; CHECK: atomicrmw.start:
1534 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1535 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 [[LOADED]] seq_cst seq_cst, align 2, !pcsections !0
1536 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1537 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1538 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1539 ; CHECK: atomicrmw.end:
1540 ; CHECK-NEXT: ret void
1543 atomicrmw or ptr %a, i16 0 seq_cst, !pcsections !0
1547 define void @atomic16_xor_seq_cst(ptr %a) nounwind uwtable {
1548 ; CHECK-LABEL: @atomic16_xor_seq_cst(
1549 ; CHECK-NEXT: entry:
1550 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1551 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1552 ; CHECK: atomicrmw.start:
1553 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1554 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 [[LOADED]] seq_cst seq_cst, align 2, !pcsections !0
1555 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1556 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1557 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1558 ; CHECK: atomicrmw.end:
1559 ; CHECK-NEXT: ret void
1562 atomicrmw xor ptr %a, i16 0 seq_cst, !pcsections !0
1566 define void @atomic16_nand_seq_cst(ptr %a) nounwind uwtable {
1567 ; CHECK-LABEL: @atomic16_nand_seq_cst(
1568 ; CHECK-NEXT: entry:
1569 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A:%.*]], align 2, !pcsections !0
1570 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1571 ; CHECK: atomicrmw.start:
1572 ; CHECK-NEXT: [[LOADED:%.*]] = phi i16 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1573 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 [[LOADED]], i16 -1 seq_cst seq_cst, align 2, !pcsections !0
1574 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i16, i1 } [[TMP1]], 1, !pcsections !0
1575 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i16, i1 } [[TMP1]], 0, !pcsections !0
1576 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1577 ; CHECK: atomicrmw.end:
1578 ; CHECK-NEXT: ret void
1581 atomicrmw nand ptr %a, i16 0 seq_cst, !pcsections !0
1585 define void @atomic16_cas_monotonic(ptr %a) nounwind uwtable {
1586 ; CHECK-LABEL: @atomic16_cas_monotonic(
1587 ; CHECK-NEXT: entry:
1588 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i16 0, i16 1 monotonic monotonic, align 2, !pcsections !0
1589 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 0, i16 1 monotonic acquire, align 2, !pcsections !0
1590 ; CHECK-NEXT: [[TMP2:%.*]] = cmpxchg ptr [[A]], i16 0, i16 1 monotonic seq_cst, align 2, !pcsections !0
1591 ; CHECK-NEXT: ret void
1594 cmpxchg ptr %a, i16 0, i16 1 monotonic monotonic, !pcsections !0
1595 cmpxchg ptr %a, i16 0, i16 1 monotonic acquire, !pcsections !0
1596 cmpxchg ptr %a, i16 0, i16 1 monotonic seq_cst, !pcsections !0
1600 define void @atomic16_cas_acquire(ptr %a) nounwind uwtable {
1601 ; CHECK-LABEL: @atomic16_cas_acquire(
1602 ; CHECK-NEXT: entry:
1603 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i16 0, i16 1 acquire monotonic, align 2, !pcsections !0
1604 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 0, i16 1 acquire acquire, align 2, !pcsections !0
1605 ; CHECK-NEXT: [[TMP2:%.*]] = cmpxchg ptr [[A]], i16 0, i16 1 acquire seq_cst, align 2, !pcsections !0
1606 ; CHECK-NEXT: ret void
1609 cmpxchg ptr %a, i16 0, i16 1 acquire monotonic, !pcsections !0
1610 cmpxchg ptr %a, i16 0, i16 1 acquire acquire, !pcsections !0
1611 cmpxchg ptr %a, i16 0, i16 1 acquire seq_cst, !pcsections !0
1615 define void @atomic16_cas_release(ptr %a) nounwind uwtable {
1616 ; CHECK-LABEL: @atomic16_cas_release(
1617 ; CHECK-NEXT: entry:
1618 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i16 0, i16 1 release monotonic, align 2, !pcsections !0
1619 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 0, i16 1 release acquire, align 2, !pcsections !0
1620 ; CHECK-NEXT: [[TMP2:%.*]] = cmpxchg ptr [[A]], i16 0, i16 1 release seq_cst, align 2, !pcsections !0
1621 ; CHECK-NEXT: ret void
1624 cmpxchg ptr %a, i16 0, i16 1 release monotonic, !pcsections !0
1625 cmpxchg ptr %a, i16 0, i16 1 release acquire, !pcsections !0
1626 cmpxchg ptr %a, i16 0, i16 1 release seq_cst, !pcsections !0
1630 define void @atomic16_cas_acq_rel(ptr %a) nounwind uwtable {
1631 ; CHECK-LABEL: @atomic16_cas_acq_rel(
1632 ; CHECK-NEXT: entry:
1633 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i16 0, i16 1 acq_rel monotonic, align 2, !pcsections !0
1634 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 0, i16 1 acq_rel acquire, align 2, !pcsections !0
1635 ; CHECK-NEXT: [[TMP2:%.*]] = cmpxchg ptr [[A]], i16 0, i16 1 acq_rel seq_cst, align 2, !pcsections !0
1636 ; CHECK-NEXT: ret void
1639 cmpxchg ptr %a, i16 0, i16 1 acq_rel monotonic, !pcsections !0
1640 cmpxchg ptr %a, i16 0, i16 1 acq_rel acquire, !pcsections !0
1641 cmpxchg ptr %a, i16 0, i16 1 acq_rel seq_cst, !pcsections !0
1645 define void @atomic16_cas_seq_cst(ptr %a) nounwind uwtable {
1646 ; CHECK-LABEL: @atomic16_cas_seq_cst(
1647 ; CHECK-NEXT: entry:
1648 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i16 0, i16 1 seq_cst monotonic, align 2, !pcsections !0
1649 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i16 0, i16 1 seq_cst acquire, align 2, !pcsections !0
1650 ; CHECK-NEXT: [[TMP2:%.*]] = cmpxchg ptr [[A]], i16 0, i16 1 seq_cst seq_cst, align 2, !pcsections !0
1651 ; CHECK-NEXT: ret void
1654 cmpxchg ptr %a, i16 0, i16 1 seq_cst monotonic, !pcsections !0
1655 cmpxchg ptr %a, i16 0, i16 1 seq_cst acquire, !pcsections !0
1656 cmpxchg ptr %a, i16 0, i16 1 seq_cst seq_cst, !pcsections !0
1660 define i32 @atomic32_load_unordered(ptr %a) nounwind uwtable {
1661 ; CHECK-LABEL: @atomic32_load_unordered(
1662 ; CHECK-NEXT: entry:
1663 ; CHECK-NEXT: [[TMP0:%.*]] = load atomic i32, ptr [[A:%.*]] unordered, align 4, !pcsections !0
1664 ; CHECK-NEXT: ret i32 [[TMP0]]
1667 %0 = load atomic i32, ptr %a unordered, align 4, !pcsections !0
1671 define i32 @atomic32_load_monotonic(ptr %a) nounwind uwtable {
1672 ; CHECK-LABEL: @atomic32_load_monotonic(
1673 ; CHECK-NEXT: entry:
1674 ; CHECK-NEXT: [[TMP0:%.*]] = load atomic i32, ptr [[A:%.*]] monotonic, align 4, !pcsections !0
1675 ; CHECK-NEXT: ret i32 [[TMP0]]
1678 %0 = load atomic i32, ptr %a monotonic, align 4, !pcsections !0
1682 define i32 @atomic32_load_acquire(ptr %a) nounwind uwtable {
1683 ; CHECK-LABEL: @atomic32_load_acquire(
1684 ; CHECK-NEXT: entry:
1685 ; CHECK-NEXT: [[TMP0:%.*]] = load atomic i32, ptr [[A:%.*]] acquire, align 4, !pcsections !0
1686 ; CHECK-NEXT: ret i32 [[TMP0]]
1689 %0 = load atomic i32, ptr %a acquire, align 4, !pcsections !0
1693 define i32 @atomic32_load_seq_cst(ptr %a) nounwind uwtable {
1694 ; CHECK-LABEL: @atomic32_load_seq_cst(
1695 ; CHECK-NEXT: entry:
1696 ; CHECK-NEXT: [[TMP0:%.*]] = load atomic i32, ptr [[A:%.*]] seq_cst, align 4, !pcsections !0
1697 ; CHECK-NEXT: ret i32 [[TMP0]]
1700 %0 = load atomic i32, ptr %a seq_cst, align 4, !pcsections !0
1704 define void @atomic32_store_unordered(ptr %a) nounwind uwtable {
1705 ; CHECK-LABEL: @atomic32_store_unordered(
1706 ; CHECK-NEXT: entry:
1707 ; CHECK-NEXT: store atomic i32 0, ptr [[A:%.*]] unordered, align 4, !pcsections !0
1708 ; CHECK-NEXT: ret void
1711 store atomic i32 0, ptr %a unordered, align 4, !pcsections !0
1715 define void @atomic32_store_monotonic(ptr %a) nounwind uwtable {
1716 ; CHECK-LABEL: @atomic32_store_monotonic(
1717 ; CHECK-NEXT: entry:
1718 ; CHECK-NEXT: store atomic i32 0, ptr [[A:%.*]] monotonic, align 4, !pcsections !0
1719 ; CHECK-NEXT: ret void
1722 store atomic i32 0, ptr %a monotonic, align 4, !pcsections !0
1726 define void @atomic32_store_release(ptr %a) nounwind uwtable {
1727 ; CHECK-LABEL: @atomic32_store_release(
1728 ; CHECK-NEXT: entry:
1729 ; CHECK-NEXT: store atomic i32 0, ptr [[A:%.*]] release, align 4, !pcsections !0
1730 ; CHECK-NEXT: ret void
1733 store atomic i32 0, ptr %a release, align 4, !pcsections !0
1737 define void @atomic32_store_seq_cst(ptr %a) nounwind uwtable {
1738 ; CHECK-LABEL: @atomic32_store_seq_cst(
1739 ; CHECK-NEXT: entry:
1740 ; CHECK-NEXT: store atomic i32 0, ptr [[A:%.*]] seq_cst, align 4, !pcsections !0
1741 ; CHECK-NEXT: ret void
1744 store atomic i32 0, ptr %a seq_cst, align 4, !pcsections !0
1748 define void @atomic32_xchg_monotonic(ptr %a) nounwind uwtable {
1749 ; CHECK-LABEL: @atomic32_xchg_monotonic(
1750 ; CHECK-NEXT: entry:
1751 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
1752 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1753 ; CHECK: atomicrmw.start:
1754 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1755 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 0 monotonic monotonic, align 4, !pcsections !0
1756 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
1757 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
1758 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1759 ; CHECK: atomicrmw.end:
1760 ; CHECK-NEXT: ret void
1763 atomicrmw xchg ptr %a, i32 0 monotonic, !pcsections !0
1767 define void @atomic32_add_monotonic(ptr %a) nounwind uwtable {
1768 ; CHECK-LABEL: @atomic32_add_monotonic(
1769 ; CHECK-NEXT: entry:
1770 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
1771 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1772 ; CHECK: atomicrmw.start:
1773 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1774 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 [[LOADED]] monotonic monotonic, align 4, !pcsections !0
1775 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
1776 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
1777 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1778 ; CHECK: atomicrmw.end:
1779 ; CHECK-NEXT: ret void
1782 atomicrmw add ptr %a, i32 0 monotonic, !pcsections !0
1786 define void @atomic32_sub_monotonic(ptr %a) nounwind uwtable {
1787 ; CHECK-LABEL: @atomic32_sub_monotonic(
1788 ; CHECK-NEXT: entry:
1789 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
1790 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1791 ; CHECK: atomicrmw.start:
1792 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1793 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 [[LOADED]] monotonic monotonic, align 4, !pcsections !0
1794 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
1795 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
1796 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1797 ; CHECK: atomicrmw.end:
1798 ; CHECK-NEXT: ret void
1801 atomicrmw sub ptr %a, i32 0 monotonic, !pcsections !0
1805 define void @atomic32_and_monotonic(ptr %a) nounwind uwtable {
1806 ; CHECK-LABEL: @atomic32_and_monotonic(
1807 ; CHECK-NEXT: entry:
1808 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
1809 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1810 ; CHECK: atomicrmw.start:
1811 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1812 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 0 monotonic monotonic, align 4, !pcsections !0
1813 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
1814 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
1815 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1816 ; CHECK: atomicrmw.end:
1817 ; CHECK-NEXT: ret void
1820 atomicrmw and ptr %a, i32 0 monotonic, !pcsections !0
1824 define void @atomic32_or_monotonic(ptr %a) nounwind uwtable {
1825 ; CHECK-LABEL: @atomic32_or_monotonic(
1826 ; CHECK-NEXT: entry:
1827 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
1828 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1829 ; CHECK: atomicrmw.start:
1830 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1831 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 [[LOADED]] monotonic monotonic, align 4, !pcsections !0
1832 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
1833 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
1834 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1835 ; CHECK: atomicrmw.end:
1836 ; CHECK-NEXT: ret void
1839 atomicrmw or ptr %a, i32 0 monotonic, !pcsections !0
1843 define void @atomic32_xor_monotonic(ptr %a) nounwind uwtable {
1844 ; CHECK-LABEL: @atomic32_xor_monotonic(
1845 ; CHECK-NEXT: entry:
1846 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
1847 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1848 ; CHECK: atomicrmw.start:
1849 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1850 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 [[LOADED]] monotonic monotonic, align 4, !pcsections !0
1851 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
1852 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
1853 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1854 ; CHECK: atomicrmw.end:
1855 ; CHECK-NEXT: ret void
1858 atomicrmw xor ptr %a, i32 0 monotonic, !pcsections !0
1862 define void @atomic32_nand_monotonic(ptr %a) nounwind uwtable {
1863 ; CHECK-LABEL: @atomic32_nand_monotonic(
1864 ; CHECK-NEXT: entry:
1865 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
1866 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1867 ; CHECK: atomicrmw.start:
1868 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1869 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 -1 monotonic monotonic, align 4, !pcsections !0
1870 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
1871 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
1872 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1873 ; CHECK: atomicrmw.end:
1874 ; CHECK-NEXT: ret void
1877 atomicrmw nand ptr %a, i32 0 monotonic, !pcsections !0
1881 define void @atomic32_xchg_acquire(ptr %a) nounwind uwtable {
1882 ; CHECK-LABEL: @atomic32_xchg_acquire(
1883 ; CHECK-NEXT: entry:
1884 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
1885 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1886 ; CHECK: atomicrmw.start:
1887 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1888 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 0 acquire acquire, align 4, !pcsections !0
1889 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
1890 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
1891 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1892 ; CHECK: atomicrmw.end:
1893 ; CHECK-NEXT: ret void
1896 atomicrmw xchg ptr %a, i32 0 acquire, !pcsections !0
1900 define void @atomic32_add_acquire(ptr %a) nounwind uwtable {
1901 ; CHECK-LABEL: @atomic32_add_acquire(
1902 ; CHECK-NEXT: entry:
1903 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
1904 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1905 ; CHECK: atomicrmw.start:
1906 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1907 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 [[LOADED]] acquire acquire, align 4, !pcsections !0
1908 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
1909 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
1910 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1911 ; CHECK: atomicrmw.end:
1912 ; CHECK-NEXT: ret void
1915 atomicrmw add ptr %a, i32 0 acquire, !pcsections !0
1919 define void @atomic32_sub_acquire(ptr %a) nounwind uwtable {
1920 ; CHECK-LABEL: @atomic32_sub_acquire(
1921 ; CHECK-NEXT: entry:
1922 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
1923 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1924 ; CHECK: atomicrmw.start:
1925 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1926 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 [[LOADED]] acquire acquire, align 4, !pcsections !0
1927 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
1928 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
1929 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1930 ; CHECK: atomicrmw.end:
1931 ; CHECK-NEXT: ret void
1934 atomicrmw sub ptr %a, i32 0 acquire, !pcsections !0
1938 define void @atomic32_and_acquire(ptr %a) nounwind uwtable {
1939 ; CHECK-LABEL: @atomic32_and_acquire(
1940 ; CHECK-NEXT: entry:
1941 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
1942 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1943 ; CHECK: atomicrmw.start:
1944 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1945 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 0 acquire acquire, align 4, !pcsections !0
1946 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
1947 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
1948 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1949 ; CHECK: atomicrmw.end:
1950 ; CHECK-NEXT: ret void
1953 atomicrmw and ptr %a, i32 0 acquire, !pcsections !0
1957 define void @atomic32_or_acquire(ptr %a) nounwind uwtable {
1958 ; CHECK-LABEL: @atomic32_or_acquire(
1959 ; CHECK-NEXT: entry:
1960 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
1961 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1962 ; CHECK: atomicrmw.start:
1963 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1964 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 [[LOADED]] acquire acquire, align 4, !pcsections !0
1965 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
1966 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
1967 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1968 ; CHECK: atomicrmw.end:
1969 ; CHECK-NEXT: ret void
1972 atomicrmw or ptr %a, i32 0 acquire, !pcsections !0
1976 define void @atomic32_xor_acquire(ptr %a) nounwind uwtable {
1977 ; CHECK-LABEL: @atomic32_xor_acquire(
1978 ; CHECK-NEXT: entry:
1979 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
1980 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
1981 ; CHECK: atomicrmw.start:
1982 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
1983 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 [[LOADED]] acquire acquire, align 4, !pcsections !0
1984 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
1985 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
1986 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
1987 ; CHECK: atomicrmw.end:
1988 ; CHECK-NEXT: ret void
1991 atomicrmw xor ptr %a, i32 0 acquire, !pcsections !0
1995 define void @atomic32_nand_acquire(ptr %a) nounwind uwtable {
1996 ; CHECK-LABEL: @atomic32_nand_acquire(
1997 ; CHECK-NEXT: entry:
1998 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
1999 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2000 ; CHECK: atomicrmw.start:
2001 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2002 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 -1 acquire acquire, align 4, !pcsections !0
2003 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2004 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2005 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2006 ; CHECK: atomicrmw.end:
2007 ; CHECK-NEXT: ret void
2010 atomicrmw nand ptr %a, i32 0 acquire, !pcsections !0
2014 define void @atomic32_xchg_release(ptr %a) nounwind uwtable {
2015 ; CHECK-LABEL: @atomic32_xchg_release(
2016 ; CHECK-NEXT: entry:
2017 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
2018 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2019 ; CHECK: atomicrmw.start:
2020 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2021 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 0 release monotonic, align 4, !pcsections !0
2022 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2023 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2024 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2025 ; CHECK: atomicrmw.end:
2026 ; CHECK-NEXT: ret void
2029 atomicrmw xchg ptr %a, i32 0 release, !pcsections !0
2033 define void @atomic32_add_release(ptr %a) nounwind uwtable {
2034 ; CHECK-LABEL: @atomic32_add_release(
2035 ; CHECK-NEXT: entry:
2036 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
2037 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2038 ; CHECK: atomicrmw.start:
2039 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2040 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 [[LOADED]] release monotonic, align 4, !pcsections !0
2041 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2042 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2043 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2044 ; CHECK: atomicrmw.end:
2045 ; CHECK-NEXT: ret void
2048 atomicrmw add ptr %a, i32 0 release, !pcsections !0
2052 define void @atomic32_sub_release(ptr %a) nounwind uwtable {
2053 ; CHECK-LABEL: @atomic32_sub_release(
2054 ; CHECK-NEXT: entry:
2055 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
2056 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2057 ; CHECK: atomicrmw.start:
2058 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2059 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 [[LOADED]] release monotonic, align 4, !pcsections !0
2060 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2061 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2062 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2063 ; CHECK: atomicrmw.end:
2064 ; CHECK-NEXT: ret void
2067 atomicrmw sub ptr %a, i32 0 release, !pcsections !0
2071 define void @atomic32_and_release(ptr %a) nounwind uwtable {
2072 ; CHECK-LABEL: @atomic32_and_release(
2073 ; CHECK-NEXT: entry:
2074 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
2075 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2076 ; CHECK: atomicrmw.start:
2077 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2078 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 0 release monotonic, align 4, !pcsections !0
2079 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2080 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2081 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2082 ; CHECK: atomicrmw.end:
2083 ; CHECK-NEXT: ret void
2086 atomicrmw and ptr %a, i32 0 release, !pcsections !0
2090 define void @atomic32_or_release(ptr %a) nounwind uwtable {
2091 ; CHECK-LABEL: @atomic32_or_release(
2092 ; CHECK-NEXT: entry:
2093 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
2094 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2095 ; CHECK: atomicrmw.start:
2096 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2097 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 [[LOADED]] release monotonic, align 4, !pcsections !0
2098 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2099 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2100 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2101 ; CHECK: atomicrmw.end:
2102 ; CHECK-NEXT: ret void
2105 atomicrmw or ptr %a, i32 0 release, !pcsections !0
2109 define void @atomic32_xor_release(ptr %a) nounwind uwtable {
2110 ; CHECK-LABEL: @atomic32_xor_release(
2111 ; CHECK-NEXT: entry:
2112 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
2113 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2114 ; CHECK: atomicrmw.start:
2115 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2116 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 [[LOADED]] release monotonic, align 4, !pcsections !0
2117 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2118 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2119 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2120 ; CHECK: atomicrmw.end:
2121 ; CHECK-NEXT: ret void
2124 atomicrmw xor ptr %a, i32 0 release, !pcsections !0
2128 define void @atomic32_nand_release(ptr %a) nounwind uwtable {
2129 ; CHECK-LABEL: @atomic32_nand_release(
2130 ; CHECK-NEXT: entry:
2131 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
2132 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2133 ; CHECK: atomicrmw.start:
2134 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2135 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 -1 release monotonic, align 4, !pcsections !0
2136 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2137 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2138 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2139 ; CHECK: atomicrmw.end:
2140 ; CHECK-NEXT: ret void
2143 atomicrmw nand ptr %a, i32 0 release, !pcsections !0
2147 define void @atomic32_xchg_acq_rel(ptr %a) nounwind uwtable {
2148 ; CHECK-LABEL: @atomic32_xchg_acq_rel(
2149 ; CHECK-NEXT: entry:
2150 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
2151 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2152 ; CHECK: atomicrmw.start:
2153 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2154 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 0 acq_rel acquire, align 4, !pcsections !0
2155 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2156 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2157 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2158 ; CHECK: atomicrmw.end:
2159 ; CHECK-NEXT: ret void
2162 atomicrmw xchg ptr %a, i32 0 acq_rel, !pcsections !0
2166 define void @atomic32_add_acq_rel(ptr %a) nounwind uwtable {
2167 ; CHECK-LABEL: @atomic32_add_acq_rel(
2168 ; CHECK-NEXT: entry:
2169 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
2170 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2171 ; CHECK: atomicrmw.start:
2172 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2173 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 [[LOADED]] acq_rel acquire, align 4, !pcsections !0
2174 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2175 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2176 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2177 ; CHECK: atomicrmw.end:
2178 ; CHECK-NEXT: ret void
2181 atomicrmw add ptr %a, i32 0 acq_rel, !pcsections !0
2185 define void @atomic32_sub_acq_rel(ptr %a) nounwind uwtable {
2186 ; CHECK-LABEL: @atomic32_sub_acq_rel(
2187 ; CHECK-NEXT: entry:
2188 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
2189 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2190 ; CHECK: atomicrmw.start:
2191 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2192 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 [[LOADED]] acq_rel acquire, align 4, !pcsections !0
2193 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2194 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2195 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2196 ; CHECK: atomicrmw.end:
2197 ; CHECK-NEXT: ret void
2200 atomicrmw sub ptr %a, i32 0 acq_rel, !pcsections !0
2204 define void @atomic32_and_acq_rel(ptr %a) nounwind uwtable {
2205 ; CHECK-LABEL: @atomic32_and_acq_rel(
2206 ; CHECK-NEXT: entry:
2207 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
2208 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2209 ; CHECK: atomicrmw.start:
2210 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2211 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 0 acq_rel acquire, align 4, !pcsections !0
2212 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2213 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2214 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2215 ; CHECK: atomicrmw.end:
2216 ; CHECK-NEXT: ret void
2219 atomicrmw and ptr %a, i32 0 acq_rel, !pcsections !0
2223 define void @atomic32_or_acq_rel(ptr %a) nounwind uwtable {
2224 ; CHECK-LABEL: @atomic32_or_acq_rel(
2225 ; CHECK-NEXT: entry:
2226 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
2227 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2228 ; CHECK: atomicrmw.start:
2229 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2230 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 [[LOADED]] acq_rel acquire, align 4, !pcsections !0
2231 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2232 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2233 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2234 ; CHECK: atomicrmw.end:
2235 ; CHECK-NEXT: ret void
2238 atomicrmw or ptr %a, i32 0 acq_rel, !pcsections !0
2242 define void @atomic32_xor_acq_rel(ptr %a) nounwind uwtable {
2243 ; CHECK-LABEL: @atomic32_xor_acq_rel(
2244 ; CHECK-NEXT: entry:
2245 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
2246 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2247 ; CHECK: atomicrmw.start:
2248 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2249 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 [[LOADED]] acq_rel acquire, align 4, !pcsections !0
2250 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2251 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2252 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2253 ; CHECK: atomicrmw.end:
2254 ; CHECK-NEXT: ret void
2257 atomicrmw xor ptr %a, i32 0 acq_rel, !pcsections !0
2261 define void @atomic32_nand_acq_rel(ptr %a) nounwind uwtable {
2262 ; CHECK-LABEL: @atomic32_nand_acq_rel(
2263 ; CHECK-NEXT: entry:
2264 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
2265 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2266 ; CHECK: atomicrmw.start:
2267 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2268 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 -1 acq_rel acquire, align 4, !pcsections !0
2269 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2270 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2271 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2272 ; CHECK: atomicrmw.end:
2273 ; CHECK-NEXT: ret void
2276 atomicrmw nand ptr %a, i32 0 acq_rel, !pcsections !0
2280 define void @atomic32_xchg_seq_cst(ptr %a) nounwind uwtable {
2281 ; CHECK-LABEL: @atomic32_xchg_seq_cst(
2282 ; CHECK-NEXT: entry:
2283 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
2284 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2285 ; CHECK: atomicrmw.start:
2286 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2287 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 0 seq_cst seq_cst, align 4, !pcsections !0
2288 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2289 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2290 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2291 ; CHECK: atomicrmw.end:
2292 ; CHECK-NEXT: ret void
2295 atomicrmw xchg ptr %a, i32 0 seq_cst, !pcsections !0
2299 define void @atomic32_add_seq_cst(ptr %a) nounwind uwtable {
2300 ; CHECK-LABEL: @atomic32_add_seq_cst(
2301 ; CHECK-NEXT: entry:
2302 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
2303 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2304 ; CHECK: atomicrmw.start:
2305 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2306 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 [[LOADED]] seq_cst seq_cst, align 4, !pcsections !0
2307 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2308 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2309 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2310 ; CHECK: atomicrmw.end:
2311 ; CHECK-NEXT: ret void
2314 atomicrmw add ptr %a, i32 0 seq_cst, !pcsections !0
2318 define void @atomic32_sub_seq_cst(ptr %a) nounwind uwtable {
2319 ; CHECK-LABEL: @atomic32_sub_seq_cst(
2320 ; CHECK-NEXT: entry:
2321 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
2322 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2323 ; CHECK: atomicrmw.start:
2324 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2325 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 [[LOADED]] seq_cst seq_cst, align 4, !pcsections !0
2326 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2327 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2328 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2329 ; CHECK: atomicrmw.end:
2330 ; CHECK-NEXT: ret void
2333 atomicrmw sub ptr %a, i32 0 seq_cst, !pcsections !0
2337 define void @atomic32_and_seq_cst(ptr %a) nounwind uwtable {
2338 ; CHECK-LABEL: @atomic32_and_seq_cst(
2339 ; CHECK-NEXT: entry:
2340 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
2341 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2342 ; CHECK: atomicrmw.start:
2343 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2344 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 0 seq_cst seq_cst, align 4, !pcsections !0
2345 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2346 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2347 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2348 ; CHECK: atomicrmw.end:
2349 ; CHECK-NEXT: ret void
2352 atomicrmw and ptr %a, i32 0 seq_cst, !pcsections !0
2356 define void @atomic32_or_seq_cst(ptr %a) nounwind uwtable {
2357 ; CHECK-LABEL: @atomic32_or_seq_cst(
2358 ; CHECK-NEXT: entry:
2359 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
2360 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2361 ; CHECK: atomicrmw.start:
2362 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2363 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 [[LOADED]] seq_cst seq_cst, align 4, !pcsections !0
2364 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2365 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2366 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2367 ; CHECK: atomicrmw.end:
2368 ; CHECK-NEXT: ret void
2371 atomicrmw or ptr %a, i32 0 seq_cst, !pcsections !0
2375 define void @atomic32_xor_seq_cst(ptr %a) nounwind uwtable {
2376 ; CHECK-LABEL: @atomic32_xor_seq_cst(
2377 ; CHECK-NEXT: entry:
2378 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
2379 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2380 ; CHECK: atomicrmw.start:
2381 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2382 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 [[LOADED]] seq_cst seq_cst, align 4, !pcsections !0
2383 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2384 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2385 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2386 ; CHECK: atomicrmw.end:
2387 ; CHECK-NEXT: ret void
2390 atomicrmw xor ptr %a, i32 0 seq_cst, !pcsections !0
2394 define void @atomic32_nand_seq_cst(ptr %a) nounwind uwtable {
2395 ; CHECK-LABEL: @atomic32_nand_seq_cst(
2396 ; CHECK-NEXT: entry:
2397 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4, !pcsections !0
2398 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2399 ; CHECK: atomicrmw.start:
2400 ; CHECK-NEXT: [[LOADED:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2401 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 [[LOADED]], i32 -1 seq_cst seq_cst, align 4, !pcsections !0
2402 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP1]], 1, !pcsections !0
2403 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i32, i1 } [[TMP1]], 0, !pcsections !0
2404 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2405 ; CHECK: atomicrmw.end:
2406 ; CHECK-NEXT: ret void
2409 atomicrmw nand ptr %a, i32 0 seq_cst, !pcsections !0
2413 define void @atomic32_cas_monotonic(ptr %a) nounwind uwtable {
2414 ; CHECK-LABEL: @atomic32_cas_monotonic(
2415 ; CHECK-NEXT: entry:
2416 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i32 0, i32 1 monotonic monotonic, align 4, !pcsections !0
2417 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 0, i32 1 monotonic acquire, align 4, !pcsections !0
2418 ; CHECK-NEXT: [[TMP2:%.*]] = cmpxchg ptr [[A]], i32 0, i32 1 monotonic seq_cst, align 4, !pcsections !0
2419 ; CHECK-NEXT: ret void
2422 cmpxchg ptr %a, i32 0, i32 1 monotonic monotonic, !pcsections !0
2423 cmpxchg ptr %a, i32 0, i32 1 monotonic acquire, !pcsections !0
2424 cmpxchg ptr %a, i32 0, i32 1 monotonic seq_cst, !pcsections !0
2428 define void @atomic32_cas_acquire(ptr %a) nounwind uwtable {
2429 ; CHECK-LABEL: @atomic32_cas_acquire(
2430 ; CHECK-NEXT: entry:
2431 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i32 0, i32 1 acquire monotonic, align 4, !pcsections !0
2432 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 0, i32 1 acquire acquire, align 4, !pcsections !0
2433 ; CHECK-NEXT: [[TMP2:%.*]] = cmpxchg ptr [[A]], i32 0, i32 1 acquire seq_cst, align 4, !pcsections !0
2434 ; CHECK-NEXT: ret void
2437 cmpxchg ptr %a, i32 0, i32 1 acquire monotonic, !pcsections !0
2438 cmpxchg ptr %a, i32 0, i32 1 acquire acquire, !pcsections !0
2439 cmpxchg ptr %a, i32 0, i32 1 acquire seq_cst, !pcsections !0
2443 define void @atomic32_cas_release(ptr %a) nounwind uwtable {
2444 ; CHECK-LABEL: @atomic32_cas_release(
2445 ; CHECK-NEXT: entry:
2446 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i32 0, i32 1 release monotonic, align 4, !pcsections !0
2447 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 0, i32 1 release acquire, align 4, !pcsections !0
2448 ; CHECK-NEXT: [[TMP2:%.*]] = cmpxchg ptr [[A]], i32 0, i32 1 release seq_cst, align 4, !pcsections !0
2449 ; CHECK-NEXT: ret void
2452 cmpxchg ptr %a, i32 0, i32 1 release monotonic, !pcsections !0
2453 cmpxchg ptr %a, i32 0, i32 1 release acquire, !pcsections !0
2454 cmpxchg ptr %a, i32 0, i32 1 release seq_cst, !pcsections !0
2458 define void @atomic32_cas_acq_rel(ptr %a) nounwind uwtable {
2459 ; CHECK-LABEL: @atomic32_cas_acq_rel(
2460 ; CHECK-NEXT: entry:
2461 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i32 0, i32 1 acq_rel monotonic, align 4, !pcsections !0
2462 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 0, i32 1 acq_rel acquire, align 4, !pcsections !0
2463 ; CHECK-NEXT: [[TMP2:%.*]] = cmpxchg ptr [[A]], i32 0, i32 1 acq_rel seq_cst, align 4, !pcsections !0
2464 ; CHECK-NEXT: ret void
2467 cmpxchg ptr %a, i32 0, i32 1 acq_rel monotonic, !pcsections !0
2468 cmpxchg ptr %a, i32 0, i32 1 acq_rel acquire, !pcsections !0
2469 cmpxchg ptr %a, i32 0, i32 1 acq_rel seq_cst, !pcsections !0
2473 define void @atomic32_cas_seq_cst(ptr %a) nounwind uwtable {
2474 ; CHECK-LABEL: @atomic32_cas_seq_cst(
2475 ; CHECK-NEXT: entry:
2476 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i32 0, i32 1 seq_cst monotonic, align 4, !pcsections !0
2477 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i32 0, i32 1 seq_cst acquire, align 4, !pcsections !0
2478 ; CHECK-NEXT: [[TMP2:%.*]] = cmpxchg ptr [[A]], i32 0, i32 1 seq_cst seq_cst, align 4, !pcsections !0
2479 ; CHECK-NEXT: ret void
2482 cmpxchg ptr %a, i32 0, i32 1 seq_cst monotonic, !pcsections !0
2483 cmpxchg ptr %a, i32 0, i32 1 seq_cst acquire, !pcsections !0
2484 cmpxchg ptr %a, i32 0, i32 1 seq_cst seq_cst, !pcsections !0
2488 define i64 @atomic64_load_unordered(ptr %a) nounwind uwtable {
2489 ; CHECK-LABEL: @atomic64_load_unordered(
2490 ; CHECK-NEXT: entry:
2491 ; CHECK-NEXT: [[TMP0:%.*]] = load atomic i64, ptr [[A:%.*]] unordered, align 8, !pcsections !0
2492 ; CHECK-NEXT: ret i64 [[TMP0]]
2495 %0 = load atomic i64, ptr %a unordered, align 8, !pcsections !0
2499 define i64 @atomic64_load_monotonic(ptr %a) nounwind uwtable {
2500 ; CHECK-LABEL: @atomic64_load_monotonic(
2501 ; CHECK-NEXT: entry:
2502 ; CHECK-NEXT: [[TMP0:%.*]] = load atomic i64, ptr [[A:%.*]] monotonic, align 8, !pcsections !0
2503 ; CHECK-NEXT: ret i64 [[TMP0]]
2506 %0 = load atomic i64, ptr %a monotonic, align 8, !pcsections !0
2510 define i64 @atomic64_load_acquire(ptr %a) nounwind uwtable {
2511 ; CHECK-LABEL: @atomic64_load_acquire(
2512 ; CHECK-NEXT: entry:
2513 ; CHECK-NEXT: [[TMP0:%.*]] = load atomic i64, ptr [[A:%.*]] acquire, align 8, !pcsections !0
2514 ; CHECK-NEXT: ret i64 [[TMP0]]
2517 %0 = load atomic i64, ptr %a acquire, align 8, !pcsections !0
2521 define i64 @atomic64_load_seq_cst(ptr %a) nounwind uwtable {
2522 ; CHECK-LABEL: @atomic64_load_seq_cst(
2523 ; CHECK-NEXT: entry:
2524 ; CHECK-NEXT: [[TMP0:%.*]] = load atomic i64, ptr [[A:%.*]] seq_cst, align 8, !pcsections !0
2525 ; CHECK-NEXT: ret i64 [[TMP0]]
2528 %0 = load atomic i64, ptr %a seq_cst, align 8, !pcsections !0
2532 define ptr @atomic64_load_seq_cst_ptr_ty(ptr %a) nounwind uwtable {
2533 ; CHECK-LABEL: @atomic64_load_seq_cst_ptr_ty(
2534 ; CHECK-NEXT: entry:
2535 ; CHECK-NEXT: [[TMP0:%.*]] = load atomic ptr, ptr [[A:%.*]] seq_cst, align 8, !pcsections !0
2536 ; CHECK-NEXT: ret ptr [[TMP0]]
2539 %0 = load atomic ptr, ptr %a seq_cst, align 8, !pcsections !0
2543 define void @atomic64_store_unordered(ptr %a) nounwind uwtable {
2544 ; CHECK-LABEL: @atomic64_store_unordered(
2545 ; CHECK-NEXT: entry:
2546 ; CHECK-NEXT: store atomic i64 0, ptr [[A:%.*]] unordered, align 8, !pcsections !0
2547 ; CHECK-NEXT: ret void
2550 store atomic i64 0, ptr %a unordered, align 8, !pcsections !0
2554 define void @atomic64_store_monotonic(ptr %a) nounwind uwtable {
2555 ; CHECK-LABEL: @atomic64_store_monotonic(
2556 ; CHECK-NEXT: entry:
2557 ; CHECK-NEXT: store atomic i64 0, ptr [[A:%.*]] monotonic, align 8, !pcsections !0
2558 ; CHECK-NEXT: ret void
2561 store atomic i64 0, ptr %a monotonic, align 8, !pcsections !0
2565 define void @atomic64_store_release(ptr %a) nounwind uwtable {
2566 ; CHECK-LABEL: @atomic64_store_release(
2567 ; CHECK-NEXT: entry:
2568 ; CHECK-NEXT: store atomic i64 0, ptr [[A:%.*]] release, align 8, !pcsections !0
2569 ; CHECK-NEXT: ret void
2572 store atomic i64 0, ptr %a release, align 8, !pcsections !0
2576 define void @atomic64_store_seq_cst(ptr %a) nounwind uwtable {
2577 ; CHECK-LABEL: @atomic64_store_seq_cst(
2578 ; CHECK-NEXT: entry:
2579 ; CHECK-NEXT: store atomic i64 0, ptr [[A:%.*]] seq_cst, align 8, !pcsections !0
2580 ; CHECK-NEXT: ret void
2583 store atomic i64 0, ptr %a seq_cst, align 8, !pcsections !0
2587 define void @atomic64_store_seq_cst_ptr_ty(ptr %a, ptr %v) nounwind uwtable {
2588 ; CHECK-LABEL: @atomic64_store_seq_cst_ptr_ty(
2589 ; CHECK-NEXT: entry:
2590 ; CHECK-NEXT: store atomic ptr [[V:%.*]], ptr [[A:%.*]] seq_cst, align 8, !pcsections !0
2591 ; CHECK-NEXT: ret void
2594 store atomic ptr %v, ptr %a seq_cst, align 8, !pcsections !0
2598 define void @atomic64_xchg_monotonic(ptr %a) nounwind uwtable {
2599 ; CHECK-LABEL: @atomic64_xchg_monotonic(
2600 ; CHECK-NEXT: entry:
2601 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
2602 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2603 ; CHECK: atomicrmw.start:
2604 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2605 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 0 monotonic monotonic, align 8, !pcsections !0
2606 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
2607 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
2608 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2609 ; CHECK: atomicrmw.end:
2610 ; CHECK-NEXT: ret void
2613 atomicrmw xchg ptr %a, i64 0 monotonic, !pcsections !0
2617 define void @atomic64_add_monotonic(ptr %a) nounwind uwtable {
2618 ; CHECK-LABEL: @atomic64_add_monotonic(
2619 ; CHECK-NEXT: entry:
2620 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
2621 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2622 ; CHECK: atomicrmw.start:
2623 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2624 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 [[LOADED]] monotonic monotonic, align 8, !pcsections !0
2625 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
2626 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
2627 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2628 ; CHECK: atomicrmw.end:
2629 ; CHECK-NEXT: ret void
2632 atomicrmw add ptr %a, i64 0 monotonic, !pcsections !0
2636 define void @atomic64_sub_monotonic(ptr %a) nounwind uwtable {
2637 ; CHECK-LABEL: @atomic64_sub_monotonic(
2638 ; CHECK-NEXT: entry:
2639 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
2640 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2641 ; CHECK: atomicrmw.start:
2642 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2643 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 [[LOADED]] monotonic monotonic, align 8, !pcsections !0
2644 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
2645 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
2646 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2647 ; CHECK: atomicrmw.end:
2648 ; CHECK-NEXT: ret void
2651 atomicrmw sub ptr %a, i64 0 monotonic, !pcsections !0
2655 define void @atomic64_and_monotonic(ptr %a) nounwind uwtable {
2656 ; CHECK-LABEL: @atomic64_and_monotonic(
2657 ; CHECK-NEXT: entry:
2658 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
2659 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2660 ; CHECK: atomicrmw.start:
2661 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2662 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 0 monotonic monotonic, align 8, !pcsections !0
2663 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
2664 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
2665 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2666 ; CHECK: atomicrmw.end:
2667 ; CHECK-NEXT: ret void
2670 atomicrmw and ptr %a, i64 0 monotonic, !pcsections !0
2674 define void @atomic64_or_monotonic(ptr %a) nounwind uwtable {
2675 ; CHECK-LABEL: @atomic64_or_monotonic(
2676 ; CHECK-NEXT: entry:
2677 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
2678 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2679 ; CHECK: atomicrmw.start:
2680 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2681 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 [[LOADED]] monotonic monotonic, align 8, !pcsections !0
2682 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
2683 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
2684 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2685 ; CHECK: atomicrmw.end:
2686 ; CHECK-NEXT: ret void
2689 atomicrmw or ptr %a, i64 0 monotonic, !pcsections !0
2693 define void @atomic64_xor_monotonic(ptr %a) nounwind uwtable {
2694 ; CHECK-LABEL: @atomic64_xor_monotonic(
2695 ; CHECK-NEXT: entry:
2696 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
2697 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2698 ; CHECK: atomicrmw.start:
2699 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2700 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 [[LOADED]] monotonic monotonic, align 8, !pcsections !0
2701 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
2702 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
2703 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2704 ; CHECK: atomicrmw.end:
2705 ; CHECK-NEXT: ret void
2708 atomicrmw xor ptr %a, i64 0 monotonic, !pcsections !0
2712 define void @atomic64_nand_monotonic(ptr %a) nounwind uwtable {
2713 ; CHECK-LABEL: @atomic64_nand_monotonic(
2714 ; CHECK-NEXT: entry:
2715 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
2716 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2717 ; CHECK: atomicrmw.start:
2718 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2719 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 -1 monotonic monotonic, align 8, !pcsections !0
2720 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
2721 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
2722 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2723 ; CHECK: atomicrmw.end:
2724 ; CHECK-NEXT: ret void
2727 atomicrmw nand ptr %a, i64 0 monotonic, !pcsections !0
2731 define void @atomic64_xchg_acquire(ptr %a) nounwind uwtable {
2732 ; CHECK-LABEL: @atomic64_xchg_acquire(
2733 ; CHECK-NEXT: entry:
2734 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
2735 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2736 ; CHECK: atomicrmw.start:
2737 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2738 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 0 acquire acquire, align 8, !pcsections !0
2739 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
2740 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
2741 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2742 ; CHECK: atomicrmw.end:
2743 ; CHECK-NEXT: ret void
2746 atomicrmw xchg ptr %a, i64 0 acquire, !pcsections !0
2750 define void @atomic64_add_acquire(ptr %a) nounwind uwtable {
2751 ; CHECK-LABEL: @atomic64_add_acquire(
2752 ; CHECK-NEXT: entry:
2753 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
2754 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2755 ; CHECK: atomicrmw.start:
2756 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2757 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 [[LOADED]] acquire acquire, align 8, !pcsections !0
2758 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
2759 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
2760 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2761 ; CHECK: atomicrmw.end:
2762 ; CHECK-NEXT: ret void
2765 atomicrmw add ptr %a, i64 0 acquire, !pcsections !0
2769 define void @atomic64_sub_acquire(ptr %a) nounwind uwtable {
2770 ; CHECK-LABEL: @atomic64_sub_acquire(
2771 ; CHECK-NEXT: entry:
2772 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
2773 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2774 ; CHECK: atomicrmw.start:
2775 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2776 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 [[LOADED]] acquire acquire, align 8, !pcsections !0
2777 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
2778 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
2779 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2780 ; CHECK: atomicrmw.end:
2781 ; CHECK-NEXT: ret void
2784 atomicrmw sub ptr %a, i64 0 acquire, !pcsections !0
2788 define void @atomic64_and_acquire(ptr %a) nounwind uwtable {
2789 ; CHECK-LABEL: @atomic64_and_acquire(
2790 ; CHECK-NEXT: entry:
2791 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
2792 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2793 ; CHECK: atomicrmw.start:
2794 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2795 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 0 acquire acquire, align 8, !pcsections !0
2796 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
2797 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
2798 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2799 ; CHECK: atomicrmw.end:
2800 ; CHECK-NEXT: ret void
2803 atomicrmw and ptr %a, i64 0 acquire, !pcsections !0
2807 define void @atomic64_or_acquire(ptr %a) nounwind uwtable {
2808 ; CHECK-LABEL: @atomic64_or_acquire(
2809 ; CHECK-NEXT: entry:
2810 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
2811 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2812 ; CHECK: atomicrmw.start:
2813 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2814 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 [[LOADED]] acquire acquire, align 8, !pcsections !0
2815 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
2816 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
2817 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2818 ; CHECK: atomicrmw.end:
2819 ; CHECK-NEXT: ret void
2822 atomicrmw or ptr %a, i64 0 acquire, !pcsections !0
2826 define void @atomic64_xor_acquire(ptr %a) nounwind uwtable {
2827 ; CHECK-LABEL: @atomic64_xor_acquire(
2828 ; CHECK-NEXT: entry:
2829 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
2830 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2831 ; CHECK: atomicrmw.start:
2832 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2833 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 [[LOADED]] acquire acquire, align 8, !pcsections !0
2834 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
2835 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
2836 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2837 ; CHECK: atomicrmw.end:
2838 ; CHECK-NEXT: ret void
2841 atomicrmw xor ptr %a, i64 0 acquire, !pcsections !0
2845 define void @atomic64_nand_acquire(ptr %a) nounwind uwtable {
2846 ; CHECK-LABEL: @atomic64_nand_acquire(
2847 ; CHECK-NEXT: entry:
2848 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
2849 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2850 ; CHECK: atomicrmw.start:
2851 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2852 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 -1 acquire acquire, align 8, !pcsections !0
2853 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
2854 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
2855 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2856 ; CHECK: atomicrmw.end:
2857 ; CHECK-NEXT: ret void
2860 atomicrmw nand ptr %a, i64 0 acquire, !pcsections !0
2864 define void @atomic64_xchg_release(ptr %a) nounwind uwtable {
2865 ; CHECK-LABEL: @atomic64_xchg_release(
2866 ; CHECK-NEXT: entry:
2867 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
2868 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2869 ; CHECK: atomicrmw.start:
2870 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2871 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 0 release monotonic, align 8, !pcsections !0
2872 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
2873 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
2874 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2875 ; CHECK: atomicrmw.end:
2876 ; CHECK-NEXT: ret void
2879 atomicrmw xchg ptr %a, i64 0 release, !pcsections !0
2883 define void @atomic64_add_release(ptr %a) nounwind uwtable {
2884 ; CHECK-LABEL: @atomic64_add_release(
2885 ; CHECK-NEXT: entry:
2886 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
2887 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2888 ; CHECK: atomicrmw.start:
2889 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2890 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 [[LOADED]] release monotonic, align 8, !pcsections !0
2891 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
2892 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
2893 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2894 ; CHECK: atomicrmw.end:
2895 ; CHECK-NEXT: ret void
2898 atomicrmw add ptr %a, i64 0 release, !pcsections !0
2902 define void @atomic64_sub_release(ptr %a) nounwind uwtable {
2903 ; CHECK-LABEL: @atomic64_sub_release(
2904 ; CHECK-NEXT: entry:
2905 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
2906 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2907 ; CHECK: atomicrmw.start:
2908 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2909 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 [[LOADED]] release monotonic, align 8, !pcsections !0
2910 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
2911 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
2912 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2913 ; CHECK: atomicrmw.end:
2914 ; CHECK-NEXT: ret void
2917 atomicrmw sub ptr %a, i64 0 release, !pcsections !0
2921 define void @atomic64_and_release(ptr %a) nounwind uwtable {
2922 ; CHECK-LABEL: @atomic64_and_release(
2923 ; CHECK-NEXT: entry:
2924 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
2925 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2926 ; CHECK: atomicrmw.start:
2927 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2928 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 0 release monotonic, align 8, !pcsections !0
2929 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
2930 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
2931 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2932 ; CHECK: atomicrmw.end:
2933 ; CHECK-NEXT: ret void
2936 atomicrmw and ptr %a, i64 0 release, !pcsections !0
2940 define void @atomic64_or_release(ptr %a) nounwind uwtable {
2941 ; CHECK-LABEL: @atomic64_or_release(
2942 ; CHECK-NEXT: entry:
2943 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
2944 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2945 ; CHECK: atomicrmw.start:
2946 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2947 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 [[LOADED]] release monotonic, align 8, !pcsections !0
2948 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
2949 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
2950 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2951 ; CHECK: atomicrmw.end:
2952 ; CHECK-NEXT: ret void
2955 atomicrmw or ptr %a, i64 0 release, !pcsections !0
2959 define void @atomic64_xor_release(ptr %a) nounwind uwtable {
2960 ; CHECK-LABEL: @atomic64_xor_release(
2961 ; CHECK-NEXT: entry:
2962 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
2963 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2964 ; CHECK: atomicrmw.start:
2965 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2966 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 [[LOADED]] release monotonic, align 8, !pcsections !0
2967 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
2968 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
2969 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2970 ; CHECK: atomicrmw.end:
2971 ; CHECK-NEXT: ret void
2974 atomicrmw xor ptr %a, i64 0 release, !pcsections !0
2978 define void @atomic64_nand_release(ptr %a) nounwind uwtable {
2979 ; CHECK-LABEL: @atomic64_nand_release(
2980 ; CHECK-NEXT: entry:
2981 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
2982 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
2983 ; CHECK: atomicrmw.start:
2984 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
2985 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 -1 release monotonic, align 8, !pcsections !0
2986 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
2987 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
2988 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
2989 ; CHECK: atomicrmw.end:
2990 ; CHECK-NEXT: ret void
2993 atomicrmw nand ptr %a, i64 0 release, !pcsections !0
2997 define void @atomic64_xchg_acq_rel(ptr %a) nounwind uwtable {
2998 ; CHECK-LABEL: @atomic64_xchg_acq_rel(
2999 ; CHECK-NEXT: entry:
3000 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
3001 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3002 ; CHECK: atomicrmw.start:
3003 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3004 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 0 acq_rel acquire, align 8, !pcsections !0
3005 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
3006 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
3007 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3008 ; CHECK: atomicrmw.end:
3009 ; CHECK-NEXT: ret void
3012 atomicrmw xchg ptr %a, i64 0 acq_rel, !pcsections !0
3016 define void @atomic64_add_acq_rel(ptr %a) nounwind uwtable {
3017 ; CHECK-LABEL: @atomic64_add_acq_rel(
3018 ; CHECK-NEXT: entry:
3019 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
3020 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3021 ; CHECK: atomicrmw.start:
3022 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3023 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 [[LOADED]] acq_rel acquire, align 8, !pcsections !0
3024 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
3025 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
3026 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3027 ; CHECK: atomicrmw.end:
3028 ; CHECK-NEXT: ret void
3031 atomicrmw add ptr %a, i64 0 acq_rel, !pcsections !0
3035 define void @atomic64_sub_acq_rel(ptr %a) nounwind uwtable {
3036 ; CHECK-LABEL: @atomic64_sub_acq_rel(
3037 ; CHECK-NEXT: entry:
3038 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
3039 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3040 ; CHECK: atomicrmw.start:
3041 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3042 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 [[LOADED]] acq_rel acquire, align 8, !pcsections !0
3043 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
3044 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
3045 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3046 ; CHECK: atomicrmw.end:
3047 ; CHECK-NEXT: ret void
3050 atomicrmw sub ptr %a, i64 0 acq_rel, !pcsections !0
3054 define void @atomic64_and_acq_rel(ptr %a) nounwind uwtable {
3055 ; CHECK-LABEL: @atomic64_and_acq_rel(
3056 ; CHECK-NEXT: entry:
3057 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
3058 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3059 ; CHECK: atomicrmw.start:
3060 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3061 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 0 acq_rel acquire, align 8, !pcsections !0
3062 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
3063 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
3064 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3065 ; CHECK: atomicrmw.end:
3066 ; CHECK-NEXT: ret void
3069 atomicrmw and ptr %a, i64 0 acq_rel, !pcsections !0
3073 define void @atomic64_or_acq_rel(ptr %a) nounwind uwtable {
3074 ; CHECK-LABEL: @atomic64_or_acq_rel(
3075 ; CHECK-NEXT: entry:
3076 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
3077 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3078 ; CHECK: atomicrmw.start:
3079 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3080 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 [[LOADED]] acq_rel acquire, align 8, !pcsections !0
3081 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
3082 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
3083 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3084 ; CHECK: atomicrmw.end:
3085 ; CHECK-NEXT: ret void
3088 atomicrmw or ptr %a, i64 0 acq_rel, !pcsections !0
3092 define void @atomic64_xor_acq_rel(ptr %a) nounwind uwtable {
3093 ; CHECK-LABEL: @atomic64_xor_acq_rel(
3094 ; CHECK-NEXT: entry:
3095 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
3096 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3097 ; CHECK: atomicrmw.start:
3098 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3099 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 [[LOADED]] acq_rel acquire, align 8, !pcsections !0
3100 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
3101 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
3102 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3103 ; CHECK: atomicrmw.end:
3104 ; CHECK-NEXT: ret void
3107 atomicrmw xor ptr %a, i64 0 acq_rel, !pcsections !0
3111 define void @atomic64_nand_acq_rel(ptr %a) nounwind uwtable {
3112 ; CHECK-LABEL: @atomic64_nand_acq_rel(
3113 ; CHECK-NEXT: entry:
3114 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
3115 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3116 ; CHECK: atomicrmw.start:
3117 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3118 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 -1 acq_rel acquire, align 8, !pcsections !0
3119 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
3120 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
3121 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3122 ; CHECK: atomicrmw.end:
3123 ; CHECK-NEXT: ret void
3126 atomicrmw nand ptr %a, i64 0 acq_rel, !pcsections !0
3130 define void @atomic64_xchg_seq_cst(ptr %a) nounwind uwtable {
3131 ; CHECK-LABEL: @atomic64_xchg_seq_cst(
3132 ; CHECK-NEXT: entry:
3133 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
3134 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3135 ; CHECK: atomicrmw.start:
3136 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3137 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 0 seq_cst seq_cst, align 8, !pcsections !0
3138 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
3139 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
3140 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3141 ; CHECK: atomicrmw.end:
3142 ; CHECK-NEXT: ret void
3145 atomicrmw xchg ptr %a, i64 0 seq_cst, !pcsections !0
3149 define void @atomic64_add_seq_cst(ptr %a) nounwind uwtable {
3150 ; CHECK-LABEL: @atomic64_add_seq_cst(
3151 ; CHECK-NEXT: entry:
3152 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
3153 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3154 ; CHECK: atomicrmw.start:
3155 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3156 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 [[LOADED]] seq_cst seq_cst, align 8, !pcsections !0
3157 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
3158 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
3159 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3160 ; CHECK: atomicrmw.end:
3161 ; CHECK-NEXT: ret void
3164 atomicrmw add ptr %a, i64 0 seq_cst, !pcsections !0
3168 define void @atomic64_sub_seq_cst(ptr %a) nounwind uwtable {
3169 ; CHECK-LABEL: @atomic64_sub_seq_cst(
3170 ; CHECK-NEXT: entry:
3171 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
3172 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3173 ; CHECK: atomicrmw.start:
3174 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3175 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 [[LOADED]] seq_cst seq_cst, align 8, !pcsections !0
3176 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
3177 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
3178 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3179 ; CHECK: atomicrmw.end:
3180 ; CHECK-NEXT: ret void
3183 atomicrmw sub ptr %a, i64 0 seq_cst, !pcsections !0
3187 define void @atomic64_and_seq_cst(ptr %a) nounwind uwtable {
3188 ; CHECK-LABEL: @atomic64_and_seq_cst(
3189 ; CHECK-NEXT: entry:
3190 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
3191 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3192 ; CHECK: atomicrmw.start:
3193 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3194 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 0 seq_cst seq_cst, align 8, !pcsections !0
3195 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
3196 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
3197 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3198 ; CHECK: atomicrmw.end:
3199 ; CHECK-NEXT: ret void
3202 atomicrmw and ptr %a, i64 0 seq_cst, !pcsections !0
3206 define void @atomic64_or_seq_cst(ptr %a) nounwind uwtable {
3207 ; CHECK-LABEL: @atomic64_or_seq_cst(
3208 ; CHECK-NEXT: entry:
3209 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
3210 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3211 ; CHECK: atomicrmw.start:
3212 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3213 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 [[LOADED]] seq_cst seq_cst, align 8, !pcsections !0
3214 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
3215 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
3216 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3217 ; CHECK: atomicrmw.end:
3218 ; CHECK-NEXT: ret void
3221 atomicrmw or ptr %a, i64 0 seq_cst, !pcsections !0
3225 define void @atomic64_xor_seq_cst(ptr %a) nounwind uwtable {
3226 ; CHECK-LABEL: @atomic64_xor_seq_cst(
3227 ; CHECK-NEXT: entry:
3228 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
3229 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3230 ; CHECK: atomicrmw.start:
3231 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3232 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 [[LOADED]] seq_cst seq_cst, align 8, !pcsections !0
3233 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
3234 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
3235 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3236 ; CHECK: atomicrmw.end:
3237 ; CHECK-NEXT: ret void
3240 atomicrmw xor ptr %a, i64 0 seq_cst, !pcsections !0
3244 define void @atomic64_nand_seq_cst(ptr %a) nounwind uwtable {
3245 ; CHECK-LABEL: @atomic64_nand_seq_cst(
3246 ; CHECK-NEXT: entry:
3247 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A:%.*]], align 8, !pcsections !0
3248 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3249 ; CHECK: atomicrmw.start:
3250 ; CHECK-NEXT: [[LOADED:%.*]] = phi i64 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3251 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 [[LOADED]], i64 -1 seq_cst seq_cst, align 8, !pcsections !0
3252 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP1]], 1, !pcsections !0
3253 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i64, i1 } [[TMP1]], 0, !pcsections !0
3254 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3255 ; CHECK: atomicrmw.end:
3256 ; CHECK-NEXT: ret void
3259 atomicrmw nand ptr %a, i64 0 seq_cst, !pcsections !0
3263 define void @atomic64_cas_monotonic(ptr %a) nounwind uwtable {
3264 ; CHECK-LABEL: @atomic64_cas_monotonic(
3265 ; CHECK-NEXT: entry:
3266 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i64 0, i64 1 monotonic monotonic, align 8, !pcsections !0
3267 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 0, i64 1 monotonic acquire, align 8, !pcsections !0
3268 ; CHECK-NEXT: [[TMP2:%.*]] = cmpxchg ptr [[A]], i64 0, i64 1 monotonic seq_cst, align 8, !pcsections !0
3269 ; CHECK-NEXT: ret void
3272 cmpxchg ptr %a, i64 0, i64 1 monotonic monotonic, !pcsections !0
3273 cmpxchg ptr %a, i64 0, i64 1 monotonic acquire, !pcsections !0
3274 cmpxchg ptr %a, i64 0, i64 1 monotonic seq_cst, !pcsections !0
3278 define void @atomic64_cas_acquire(ptr %a) nounwind uwtable {
3279 ; CHECK-LABEL: @atomic64_cas_acquire(
3280 ; CHECK-NEXT: entry:
3281 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i64 0, i64 1 acquire monotonic, align 8, !pcsections !0
3282 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 0, i64 1 acquire acquire, align 8, !pcsections !0
3283 ; CHECK-NEXT: [[TMP2:%.*]] = cmpxchg ptr [[A]], i64 0, i64 1 acquire seq_cst, align 8, !pcsections !0
3284 ; CHECK-NEXT: ret void
3287 cmpxchg ptr %a, i64 0, i64 1 acquire monotonic, !pcsections !0
3288 cmpxchg ptr %a, i64 0, i64 1 acquire acquire, !pcsections !0
3289 cmpxchg ptr %a, i64 0, i64 1 acquire seq_cst, !pcsections !0
3293 define void @atomic64_cas_release(ptr %a) nounwind uwtable {
3294 ; CHECK-LABEL: @atomic64_cas_release(
3295 ; CHECK-NEXT: entry:
3296 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i64 0, i64 1 release monotonic, align 8, !pcsections !0
3297 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 0, i64 1 release acquire, align 8, !pcsections !0
3298 ; CHECK-NEXT: [[TMP2:%.*]] = cmpxchg ptr [[A]], i64 0, i64 1 release seq_cst, align 8, !pcsections !0
3299 ; CHECK-NEXT: ret void
3302 cmpxchg ptr %a, i64 0, i64 1 release monotonic, !pcsections !0
3303 cmpxchg ptr %a, i64 0, i64 1 release acquire, !pcsections !0
3304 cmpxchg ptr %a, i64 0, i64 1 release seq_cst, !pcsections !0
3308 define void @atomic64_cas_acq_rel(ptr %a) nounwind uwtable {
3309 ; CHECK-LABEL: @atomic64_cas_acq_rel(
3310 ; CHECK-NEXT: entry:
3311 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i64 0, i64 1 acq_rel monotonic, align 8, !pcsections !0
3312 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 0, i64 1 acq_rel acquire, align 8, !pcsections !0
3313 ; CHECK-NEXT: [[TMP2:%.*]] = cmpxchg ptr [[A]], i64 0, i64 1 acq_rel seq_cst, align 8, !pcsections !0
3314 ; CHECK-NEXT: ret void
3317 cmpxchg ptr %a, i64 0, i64 1 acq_rel monotonic, !pcsections !0
3318 cmpxchg ptr %a, i64 0, i64 1 acq_rel acquire, !pcsections !0
3319 cmpxchg ptr %a, i64 0, i64 1 acq_rel seq_cst, !pcsections !0
3323 define void @atomic64_cas_seq_cst(ptr %a) nounwind uwtable {
3324 ; CHECK-LABEL: @atomic64_cas_seq_cst(
3325 ; CHECK-NEXT: entry:
3326 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i64 0, i64 1 seq_cst monotonic, align 8, !pcsections !0
3327 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i64 0, i64 1 seq_cst acquire, align 8, !pcsections !0
3328 ; CHECK-NEXT: [[TMP2:%.*]] = cmpxchg ptr [[A]], i64 0, i64 1 seq_cst seq_cst, align 8, !pcsections !0
3329 ; CHECK-NEXT: ret void
3332 cmpxchg ptr %a, i64 0, i64 1 seq_cst monotonic, !pcsections !0
3333 cmpxchg ptr %a, i64 0, i64 1 seq_cst acquire, !pcsections !0
3334 cmpxchg ptr %a, i64 0, i64 1 seq_cst seq_cst, !pcsections !0
3338 define void @atomic64_cas_seq_cst_ptr_ty(ptr %a, ptr %v1, ptr %v2) nounwind uwtable {
3339 ; CHECK-LABEL: @atomic64_cas_seq_cst_ptr_ty(
3340 ; CHECK-NEXT: entry:
3341 ; CHECK-NEXT: [[TMP1:%.*]] = ptrtoint ptr [[V1:%.*]] to i64, !pcsections !0
3342 ; CHECK-NEXT: [[TMP2:%.*]] = ptrtoint ptr [[V2:%.*]] to i64, !pcsections !0
3343 ; CHECK-NEXT: [[TMP3:%.*]] = cmpxchg ptr [[A:%.*]], i64 [[TMP1]], i64 [[TMP2]] seq_cst seq_cst, align 8, !pcsections !0
3344 ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i64, i1 } [[TMP3]], 0, !pcsections !0
3345 ; CHECK-NEXT: [[TMP5:%.*]] = extractvalue { i64, i1 } [[TMP3]], 1, !pcsections !0
3346 ; CHECK-NEXT: [[TMP6:%.*]] = inttoptr i64 [[TMP4]] to ptr, !pcsections !0
3347 ; CHECK-NEXT: [[TMP7:%.*]] = insertvalue { ptr, i1 } poison, ptr [[TMP6]], 0, !pcsections !0
3348 ; CHECK-NEXT: [[TMP8:%.*]] = insertvalue { ptr, i1 } [[TMP7]], i1 [[TMP5]], 1, !pcsections !0
3349 ; CHECK-NEXT: ret void
3352 cmpxchg ptr %a, ptr %v1, ptr %v2 seq_cst seq_cst, !pcsections !0
3356 define i128 @atomic128_load_unordered(ptr %a) nounwind uwtable {
3357 ; CHECK-LABEL: @atomic128_load_unordered(
3358 ; CHECK-NEXT: entry:
3359 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i128 0, i128 0 monotonic monotonic, align 16, !pcsections !0
3360 ; CHECK-NEXT: [[LOADED:%.*]] = extractvalue { i128, i1 } [[TMP0]], 0, !pcsections !0
3361 ; CHECK-NEXT: ret i128 [[LOADED]]
3364 %0 = load atomic i128, ptr %a unordered, align 16, !pcsections !0
3368 define i128 @atomic128_load_monotonic(ptr %a) nounwind uwtable {
3369 ; CHECK-LABEL: @atomic128_load_monotonic(
3370 ; CHECK-NEXT: entry:
3371 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i128 0, i128 0 monotonic monotonic, align 16, !pcsections !0
3372 ; CHECK-NEXT: [[LOADED:%.*]] = extractvalue { i128, i1 } [[TMP0]], 0, !pcsections !0
3373 ; CHECK-NEXT: ret i128 [[LOADED]]
3376 %0 = load atomic i128, ptr %a monotonic, align 16, !pcsections !0
3380 define i128 @atomic128_load_acquire(ptr %a) nounwind uwtable {
3381 ; CHECK-LABEL: @atomic128_load_acquire(
3382 ; CHECK-NEXT: entry:
3383 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i128 0, i128 0 acquire acquire, align 16, !pcsections !0
3384 ; CHECK-NEXT: [[LOADED:%.*]] = extractvalue { i128, i1 } [[TMP0]], 0, !pcsections !0
3385 ; CHECK-NEXT: ret i128 [[LOADED]]
3388 %0 = load atomic i128, ptr %a acquire, align 16, !pcsections !0
3392 define i128 @atomic128_load_seq_cst(ptr %a) nounwind uwtable {
3393 ; CHECK-LABEL: @atomic128_load_seq_cst(
3394 ; CHECK-NEXT: entry:
3395 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i128 0, i128 0 seq_cst seq_cst, align 16, !pcsections !0
3396 ; CHECK-NEXT: [[LOADED:%.*]] = extractvalue { i128, i1 } [[TMP0]], 0, !pcsections !0
3397 ; CHECK-NEXT: ret i128 [[LOADED]]
3400 %0 = load atomic i128, ptr %a seq_cst, align 16, !pcsections !0
3404 define void @atomic128_store_unordered(ptr %a) nounwind uwtable {
3405 ; CHECK-LABEL: @atomic128_store_unordered(
3406 ; CHECK-NEXT: entry:
3407 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3408 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3409 ; CHECK: atomicrmw.start:
3410 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3411 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 0 monotonic monotonic, align 16, !pcsections !0
3412 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3413 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3414 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3415 ; CHECK: atomicrmw.end:
3416 ; CHECK-NEXT: ret void
3419 store atomic i128 0, ptr %a unordered, align 16, !pcsections !0
3423 define void @atomic128_store_monotonic(ptr %a) nounwind uwtable {
3424 ; CHECK-LABEL: @atomic128_store_monotonic(
3425 ; CHECK-NEXT: entry:
3426 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3427 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3428 ; CHECK: atomicrmw.start:
3429 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3430 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 0 monotonic monotonic, align 16, !pcsections !0
3431 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3432 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3433 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3434 ; CHECK: atomicrmw.end:
3435 ; CHECK-NEXT: ret void
3438 store atomic i128 0, ptr %a monotonic, align 16, !pcsections !0
3442 define void @atomic128_store_release(ptr %a) nounwind uwtable {
3443 ; CHECK-LABEL: @atomic128_store_release(
3444 ; CHECK-NEXT: entry:
3445 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3446 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3447 ; CHECK: atomicrmw.start:
3448 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3449 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 0 release monotonic, align 16, !pcsections !0
3450 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3451 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3452 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3453 ; CHECK: atomicrmw.end:
3454 ; CHECK-NEXT: ret void
3457 store atomic i128 0, ptr %a release, align 16, !pcsections !0
3461 define void @atomic128_store_seq_cst(ptr %a) nounwind uwtable {
3462 ; CHECK-LABEL: @atomic128_store_seq_cst(
3463 ; CHECK-NEXT: entry:
3464 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3465 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3466 ; CHECK: atomicrmw.start:
3467 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3468 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 0 seq_cst seq_cst, align 16, !pcsections !0
3469 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3470 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3471 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3472 ; CHECK: atomicrmw.end:
3473 ; CHECK-NEXT: ret void
3476 store atomic i128 0, ptr %a seq_cst, align 16, !pcsections !0
3480 define void @atomic128_xchg_monotonic(ptr %a) nounwind uwtable {
3481 ; CHECK-LABEL: @atomic128_xchg_monotonic(
3482 ; CHECK-NEXT: entry:
3483 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3484 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3485 ; CHECK: atomicrmw.start:
3486 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3487 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 0 monotonic monotonic, align 16, !pcsections !0
3488 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3489 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3490 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3491 ; CHECK: atomicrmw.end:
3492 ; CHECK-NEXT: ret void
3495 atomicrmw xchg ptr %a, i128 0 monotonic, !pcsections !0
3499 define void @atomic128_add_monotonic(ptr %a) nounwind uwtable {
3500 ; CHECK-LABEL: @atomic128_add_monotonic(
3501 ; CHECK-NEXT: entry:
3502 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3503 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3504 ; CHECK: atomicrmw.start:
3505 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3506 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 [[LOADED]] monotonic monotonic, align 16, !pcsections !0
3507 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3508 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3509 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3510 ; CHECK: atomicrmw.end:
3511 ; CHECK-NEXT: ret void
3514 atomicrmw add ptr %a, i128 0 monotonic, !pcsections !0
3518 define void @atomic128_sub_monotonic(ptr %a) nounwind uwtable {
3519 ; CHECK-LABEL: @atomic128_sub_monotonic(
3520 ; CHECK-NEXT: entry:
3521 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3522 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3523 ; CHECK: atomicrmw.start:
3524 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3525 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 [[LOADED]] monotonic monotonic, align 16, !pcsections !0
3526 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3527 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3528 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3529 ; CHECK: atomicrmw.end:
3530 ; CHECK-NEXT: ret void
3533 atomicrmw sub ptr %a, i128 0 monotonic, !pcsections !0
3537 define void @atomic128_and_monotonic(ptr %a) nounwind uwtable {
3538 ; CHECK-LABEL: @atomic128_and_monotonic(
3539 ; CHECK-NEXT: entry:
3540 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3541 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3542 ; CHECK: atomicrmw.start:
3543 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3544 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 0 monotonic monotonic, align 16, !pcsections !0
3545 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3546 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3547 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3548 ; CHECK: atomicrmw.end:
3549 ; CHECK-NEXT: ret void
3552 atomicrmw and ptr %a, i128 0 monotonic, !pcsections !0
3556 define void @atomic128_or_monotonic(ptr %a) nounwind uwtable {
3557 ; CHECK-LABEL: @atomic128_or_monotonic(
3558 ; CHECK-NEXT: entry:
3559 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3560 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3561 ; CHECK: atomicrmw.start:
3562 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3563 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 [[LOADED]] monotonic monotonic, align 16, !pcsections !0
3564 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3565 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3566 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3567 ; CHECK: atomicrmw.end:
3568 ; CHECK-NEXT: ret void
3571 atomicrmw or ptr %a, i128 0 monotonic, !pcsections !0
3575 define void @atomic128_xor_monotonic(ptr %a) nounwind uwtable {
3576 ; CHECK-LABEL: @atomic128_xor_monotonic(
3577 ; CHECK-NEXT: entry:
3578 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3579 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3580 ; CHECK: atomicrmw.start:
3581 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3582 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 [[LOADED]] monotonic monotonic, align 16, !pcsections !0
3583 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3584 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3585 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3586 ; CHECK: atomicrmw.end:
3587 ; CHECK-NEXT: ret void
3590 atomicrmw xor ptr %a, i128 0 monotonic, !pcsections !0
3594 define void @atomic128_nand_monotonic(ptr %a) nounwind uwtable {
3595 ; CHECK-LABEL: @atomic128_nand_monotonic(
3596 ; CHECK-NEXT: entry:
3597 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3598 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3599 ; CHECK: atomicrmw.start:
3600 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3601 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 -1 monotonic monotonic, align 16, !pcsections !0
3602 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3603 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3604 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3605 ; CHECK: atomicrmw.end:
3606 ; CHECK-NEXT: ret void
3609 atomicrmw nand ptr %a, i128 0 monotonic, !pcsections !0
3613 define void @atomic128_xchg_acquire(ptr %a) nounwind uwtable {
3614 ; CHECK-LABEL: @atomic128_xchg_acquire(
3615 ; CHECK-NEXT: entry:
3616 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3617 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3618 ; CHECK: atomicrmw.start:
3619 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3620 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 0 acquire acquire, align 16, !pcsections !0
3621 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3622 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3623 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3624 ; CHECK: atomicrmw.end:
3625 ; CHECK-NEXT: ret void
3628 atomicrmw xchg ptr %a, i128 0 acquire, !pcsections !0
3632 define void @atomic128_add_acquire(ptr %a) nounwind uwtable {
3633 ; CHECK-LABEL: @atomic128_add_acquire(
3634 ; CHECK-NEXT: entry:
3635 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3636 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3637 ; CHECK: atomicrmw.start:
3638 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3639 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 [[LOADED]] acquire acquire, align 16, !pcsections !0
3640 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3641 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3642 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3643 ; CHECK: atomicrmw.end:
3644 ; CHECK-NEXT: ret void
3647 atomicrmw add ptr %a, i128 0 acquire, !pcsections !0
3651 define void @atomic128_sub_acquire(ptr %a) nounwind uwtable {
3652 ; CHECK-LABEL: @atomic128_sub_acquire(
3653 ; CHECK-NEXT: entry:
3654 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3655 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3656 ; CHECK: atomicrmw.start:
3657 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3658 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 [[LOADED]] acquire acquire, align 16, !pcsections !0
3659 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3660 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3661 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3662 ; CHECK: atomicrmw.end:
3663 ; CHECK-NEXT: ret void
3666 atomicrmw sub ptr %a, i128 0 acquire, !pcsections !0
3670 define void @atomic128_and_acquire(ptr %a) nounwind uwtable {
3671 ; CHECK-LABEL: @atomic128_and_acquire(
3672 ; CHECK-NEXT: entry:
3673 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3674 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3675 ; CHECK: atomicrmw.start:
3676 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3677 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 0 acquire acquire, align 16, !pcsections !0
3678 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3679 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3680 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3681 ; CHECK: atomicrmw.end:
3682 ; CHECK-NEXT: ret void
3685 atomicrmw and ptr %a, i128 0 acquire, !pcsections !0
3689 define void @atomic128_or_acquire(ptr %a) nounwind uwtable {
3690 ; CHECK-LABEL: @atomic128_or_acquire(
3691 ; CHECK-NEXT: entry:
3692 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3693 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3694 ; CHECK: atomicrmw.start:
3695 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3696 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 [[LOADED]] acquire acquire, align 16, !pcsections !0
3697 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3698 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3699 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3700 ; CHECK: atomicrmw.end:
3701 ; CHECK-NEXT: ret void
3704 atomicrmw or ptr %a, i128 0 acquire, !pcsections !0
3708 define void @atomic128_xor_acquire(ptr %a) nounwind uwtable {
3709 ; CHECK-LABEL: @atomic128_xor_acquire(
3710 ; CHECK-NEXT: entry:
3711 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3712 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3713 ; CHECK: atomicrmw.start:
3714 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3715 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 [[LOADED]] acquire acquire, align 16, !pcsections !0
3716 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3717 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3718 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3719 ; CHECK: atomicrmw.end:
3720 ; CHECK-NEXT: ret void
3723 atomicrmw xor ptr %a, i128 0 acquire, !pcsections !0
3727 define void @atomic128_nand_acquire(ptr %a) nounwind uwtable {
3728 ; CHECK-LABEL: @atomic128_nand_acquire(
3729 ; CHECK-NEXT: entry:
3730 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3731 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3732 ; CHECK: atomicrmw.start:
3733 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3734 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 -1 acquire acquire, align 16, !pcsections !0
3735 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3736 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3737 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3738 ; CHECK: atomicrmw.end:
3739 ; CHECK-NEXT: ret void
3742 atomicrmw nand ptr %a, i128 0 acquire, !pcsections !0
3746 define void @atomic128_xchg_release(ptr %a) nounwind uwtable {
3747 ; CHECK-LABEL: @atomic128_xchg_release(
3748 ; CHECK-NEXT: entry:
3749 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3750 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3751 ; CHECK: atomicrmw.start:
3752 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3753 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 0 release monotonic, align 16, !pcsections !0
3754 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3755 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3756 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3757 ; CHECK: atomicrmw.end:
3758 ; CHECK-NEXT: ret void
3761 atomicrmw xchg ptr %a, i128 0 release, !pcsections !0
3765 define void @atomic128_add_release(ptr %a) nounwind uwtable {
3766 ; CHECK-LABEL: @atomic128_add_release(
3767 ; CHECK-NEXT: entry:
3768 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3769 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3770 ; CHECK: atomicrmw.start:
3771 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3772 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 [[LOADED]] release monotonic, align 16, !pcsections !0
3773 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3774 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3775 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3776 ; CHECK: atomicrmw.end:
3777 ; CHECK-NEXT: ret void
3780 atomicrmw add ptr %a, i128 0 release, !pcsections !0
3784 define void @atomic128_sub_release(ptr %a) nounwind uwtable {
3785 ; CHECK-LABEL: @atomic128_sub_release(
3786 ; CHECK-NEXT: entry:
3787 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3788 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3789 ; CHECK: atomicrmw.start:
3790 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3791 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 [[LOADED]] release monotonic, align 16, !pcsections !0
3792 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3793 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3794 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3795 ; CHECK: atomicrmw.end:
3796 ; CHECK-NEXT: ret void
3799 atomicrmw sub ptr %a, i128 0 release, !pcsections !0
3803 define void @atomic128_and_release(ptr %a) nounwind uwtable {
3804 ; CHECK-LABEL: @atomic128_and_release(
3805 ; CHECK-NEXT: entry:
3806 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3807 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3808 ; CHECK: atomicrmw.start:
3809 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3810 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 0 release monotonic, align 16, !pcsections !0
3811 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3812 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3813 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3814 ; CHECK: atomicrmw.end:
3815 ; CHECK-NEXT: ret void
3818 atomicrmw and ptr %a, i128 0 release, !pcsections !0
3822 define void @atomic128_or_release(ptr %a) nounwind uwtable {
3823 ; CHECK-LABEL: @atomic128_or_release(
3824 ; CHECK-NEXT: entry:
3825 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3826 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3827 ; CHECK: atomicrmw.start:
3828 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3829 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 [[LOADED]] release monotonic, align 16, !pcsections !0
3830 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3831 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3832 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3833 ; CHECK: atomicrmw.end:
3834 ; CHECK-NEXT: ret void
3837 atomicrmw or ptr %a, i128 0 release, !pcsections !0
3841 define void @atomic128_xor_release(ptr %a) nounwind uwtable {
3842 ; CHECK-LABEL: @atomic128_xor_release(
3843 ; CHECK-NEXT: entry:
3844 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3845 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3846 ; CHECK: atomicrmw.start:
3847 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3848 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 [[LOADED]] release monotonic, align 16, !pcsections !0
3849 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3850 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3851 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3852 ; CHECK: atomicrmw.end:
3853 ; CHECK-NEXT: ret void
3856 atomicrmw xor ptr %a, i128 0 release, !pcsections !0
3860 define void @atomic128_nand_release(ptr %a) nounwind uwtable {
3861 ; CHECK-LABEL: @atomic128_nand_release(
3862 ; CHECK-NEXT: entry:
3863 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3864 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3865 ; CHECK: atomicrmw.start:
3866 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3867 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 -1 release monotonic, align 16, !pcsections !0
3868 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3869 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3870 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3871 ; CHECK: atomicrmw.end:
3872 ; CHECK-NEXT: ret void
3875 atomicrmw nand ptr %a, i128 0 release, !pcsections !0
3879 define void @atomic128_xchg_acq_rel(ptr %a) nounwind uwtable {
3880 ; CHECK-LABEL: @atomic128_xchg_acq_rel(
3881 ; CHECK-NEXT: entry:
3882 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3883 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3884 ; CHECK: atomicrmw.start:
3885 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3886 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 0 acq_rel acquire, align 16, !pcsections !0
3887 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3888 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3889 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3890 ; CHECK: atomicrmw.end:
3891 ; CHECK-NEXT: ret void
3894 atomicrmw xchg ptr %a, i128 0 acq_rel, !pcsections !0
3898 define void @atomic128_add_acq_rel(ptr %a) nounwind uwtable {
3899 ; CHECK-LABEL: @atomic128_add_acq_rel(
3900 ; CHECK-NEXT: entry:
3901 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3902 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3903 ; CHECK: atomicrmw.start:
3904 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3905 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 [[LOADED]] acq_rel acquire, align 16, !pcsections !0
3906 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3907 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3908 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3909 ; CHECK: atomicrmw.end:
3910 ; CHECK-NEXT: ret void
3913 atomicrmw add ptr %a, i128 0 acq_rel, !pcsections !0
3917 define void @atomic128_sub_acq_rel(ptr %a) nounwind uwtable {
3918 ; CHECK-LABEL: @atomic128_sub_acq_rel(
3919 ; CHECK-NEXT: entry:
3920 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3921 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3922 ; CHECK: atomicrmw.start:
3923 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3924 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 [[LOADED]] acq_rel acquire, align 16, !pcsections !0
3925 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3926 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3927 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3928 ; CHECK: atomicrmw.end:
3929 ; CHECK-NEXT: ret void
3932 atomicrmw sub ptr %a, i128 0 acq_rel, !pcsections !0
3936 define void @atomic128_and_acq_rel(ptr %a) nounwind uwtable {
3937 ; CHECK-LABEL: @atomic128_and_acq_rel(
3938 ; CHECK-NEXT: entry:
3939 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3940 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3941 ; CHECK: atomicrmw.start:
3942 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3943 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 0 acq_rel acquire, align 16, !pcsections !0
3944 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3945 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3946 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3947 ; CHECK: atomicrmw.end:
3948 ; CHECK-NEXT: ret void
3951 atomicrmw and ptr %a, i128 0 acq_rel, !pcsections !0
3955 define void @atomic128_or_acq_rel(ptr %a) nounwind uwtable {
3956 ; CHECK-LABEL: @atomic128_or_acq_rel(
3957 ; CHECK-NEXT: entry:
3958 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3959 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3960 ; CHECK: atomicrmw.start:
3961 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3962 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 [[LOADED]] acq_rel acquire, align 16, !pcsections !0
3963 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3964 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3965 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3966 ; CHECK: atomicrmw.end:
3967 ; CHECK-NEXT: ret void
3970 atomicrmw or ptr %a, i128 0 acq_rel, !pcsections !0
3974 define void @atomic128_xor_acq_rel(ptr %a) nounwind uwtable {
3975 ; CHECK-LABEL: @atomic128_xor_acq_rel(
3976 ; CHECK-NEXT: entry:
3977 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3978 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3979 ; CHECK: atomicrmw.start:
3980 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
3981 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 [[LOADED]] acq_rel acquire, align 16, !pcsections !0
3982 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
3983 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
3984 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
3985 ; CHECK: atomicrmw.end:
3986 ; CHECK-NEXT: ret void
3989 atomicrmw xor ptr %a, i128 0 acq_rel, !pcsections !0
3993 define void @atomic128_nand_acq_rel(ptr %a) nounwind uwtable {
3994 ; CHECK-LABEL: @atomic128_nand_acq_rel(
3995 ; CHECK-NEXT: entry:
3996 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
3997 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
3998 ; CHECK: atomicrmw.start:
3999 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
4000 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 -1 acq_rel acquire, align 16, !pcsections !0
4001 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
4002 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
4003 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
4004 ; CHECK: atomicrmw.end:
4005 ; CHECK-NEXT: ret void
4008 atomicrmw nand ptr %a, i128 0 acq_rel, !pcsections !0
4012 define void @atomic128_xchg_seq_cst(ptr %a) nounwind uwtable {
4013 ; CHECK-LABEL: @atomic128_xchg_seq_cst(
4014 ; CHECK-NEXT: entry:
4015 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
4016 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
4017 ; CHECK: atomicrmw.start:
4018 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
4019 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 0 seq_cst seq_cst, align 16, !pcsections !0
4020 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
4021 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
4022 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
4023 ; CHECK: atomicrmw.end:
4024 ; CHECK-NEXT: ret void
4027 atomicrmw xchg ptr %a, i128 0 seq_cst, !pcsections !0
4031 define void @atomic128_add_seq_cst(ptr %a) nounwind uwtable {
4032 ; CHECK-LABEL: @atomic128_add_seq_cst(
4033 ; CHECK-NEXT: entry:
4034 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
4035 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
4036 ; CHECK: atomicrmw.start:
4037 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
4038 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 [[LOADED]] seq_cst seq_cst, align 16, !pcsections !0
4039 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
4040 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
4041 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
4042 ; CHECK: atomicrmw.end:
4043 ; CHECK-NEXT: ret void
4046 atomicrmw add ptr %a, i128 0 seq_cst, !pcsections !0
4050 define void @atomic128_sub_seq_cst(ptr %a) nounwind uwtable {
4051 ; CHECK-LABEL: @atomic128_sub_seq_cst(
4052 ; CHECK-NEXT: entry:
4053 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
4054 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
4055 ; CHECK: atomicrmw.start:
4056 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
4057 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 [[LOADED]] seq_cst seq_cst, align 16, !pcsections !0
4058 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
4059 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
4060 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
4061 ; CHECK: atomicrmw.end:
4062 ; CHECK-NEXT: ret void
4065 atomicrmw sub ptr %a, i128 0 seq_cst, !pcsections !0
4069 define void @atomic128_and_seq_cst(ptr %a) nounwind uwtable {
4070 ; CHECK-LABEL: @atomic128_and_seq_cst(
4071 ; CHECK-NEXT: entry:
4072 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
4073 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
4074 ; CHECK: atomicrmw.start:
4075 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
4076 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 0 seq_cst seq_cst, align 16, !pcsections !0
4077 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
4078 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
4079 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
4080 ; CHECK: atomicrmw.end:
4081 ; CHECK-NEXT: ret void
4084 atomicrmw and ptr %a, i128 0 seq_cst, !pcsections !0
4088 define void @atomic128_or_seq_cst(ptr %a) nounwind uwtable {
4089 ; CHECK-LABEL: @atomic128_or_seq_cst(
4090 ; CHECK-NEXT: entry:
4091 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
4092 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
4093 ; CHECK: atomicrmw.start:
4094 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
4095 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 [[LOADED]] seq_cst seq_cst, align 16, !pcsections !0
4096 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
4097 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
4098 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
4099 ; CHECK: atomicrmw.end:
4100 ; CHECK-NEXT: ret void
4103 atomicrmw or ptr %a, i128 0 seq_cst, !pcsections !0
4107 define void @atomic128_xor_seq_cst(ptr %a) nounwind uwtable {
4108 ; CHECK-LABEL: @atomic128_xor_seq_cst(
4109 ; CHECK-NEXT: entry:
4110 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
4111 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
4112 ; CHECK: atomicrmw.start:
4113 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
4114 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 [[LOADED]] seq_cst seq_cst, align 16, !pcsections !0
4115 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
4116 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
4117 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
4118 ; CHECK: atomicrmw.end:
4119 ; CHECK-NEXT: ret void
4122 atomicrmw xor ptr %a, i128 0 seq_cst, !pcsections !0
4126 define void @atomic128_nand_seq_cst(ptr %a) nounwind uwtable {
4127 ; CHECK-LABEL: @atomic128_nand_seq_cst(
4128 ; CHECK-NEXT: entry:
4129 ; CHECK-NEXT: [[TMP0:%.*]] = load i128, ptr [[A:%.*]], align 16, !pcsections !0
4130 ; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]], !pcsections !0
4131 ; CHECK: atomicrmw.start:
4132 ; CHECK-NEXT: [[LOADED:%.*]] = phi i128 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[NEWLOADED:%.*]], [[ATOMICRMW_START]] ], !pcsections !0
4133 ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[A]], i128 [[LOADED]], i128 -1 seq_cst seq_cst, align 16, !pcsections !0
4134 ; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i128, i1 } [[TMP1]], 1, !pcsections !0
4135 ; CHECK-NEXT: [[NEWLOADED]] = extractvalue { i128, i1 } [[TMP1]], 0, !pcsections !0
4136 ; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]], !pcsections !0
4137 ; CHECK: atomicrmw.end:
4138 ; CHECK-NEXT: ret void
4141 atomicrmw nand ptr %a, i128 0 seq_cst, !pcsections !0
4145 define void @atomic128_cas_monotonic(ptr %a) nounwind uwtable {
4146 ; CHECK-LABEL: @atomic128_cas_monotonic(
4147 ; CHECK-NEXT: entry:
4148 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i128 0, i128 1 monotonic monotonic, align 16, !pcsections !0
4149 ; CHECK-NEXT: ret void
4152 cmpxchg ptr %a, i128 0, i128 1 monotonic monotonic, !pcsections !0
4156 define void @atomic128_cas_acquire(ptr %a) nounwind uwtable {
4157 ; CHECK-LABEL: @atomic128_cas_acquire(
4158 ; CHECK-NEXT: entry:
4159 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i128 0, i128 1 acquire acquire, align 16, !pcsections !0
4160 ; CHECK-NEXT: ret void
4163 cmpxchg ptr %a, i128 0, i128 1 acquire acquire, !pcsections !0
4167 define void @atomic128_cas_release(ptr %a) nounwind uwtable {
4168 ; CHECK-LABEL: @atomic128_cas_release(
4169 ; CHECK-NEXT: entry:
4170 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i128 0, i128 1 release monotonic, align 16, !pcsections !0
4171 ; CHECK-NEXT: ret void
4174 cmpxchg ptr %a, i128 0, i128 1 release monotonic, !pcsections !0
4178 define void @atomic128_cas_acq_rel(ptr %a) nounwind uwtable {
4179 ; CHECK-LABEL: @atomic128_cas_acq_rel(
4180 ; CHECK-NEXT: entry:
4181 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i128 0, i128 1 acq_rel acquire, align 16, !pcsections !0
4182 ; CHECK-NEXT: ret void
4185 cmpxchg ptr %a, i128 0, i128 1 acq_rel acquire, !pcsections !0
4189 define void @atomic128_cas_seq_cst(ptr %a) nounwind uwtable {
4190 ; CHECK-LABEL: @atomic128_cas_seq_cst(
4191 ; CHECK-NEXT: entry:
4192 ; CHECK-NEXT: [[TMP0:%.*]] = cmpxchg ptr [[A:%.*]], i128 0, i128 1 seq_cst seq_cst, align 16, !pcsections !0
4193 ; CHECK-NEXT: ret void
4196 cmpxchg ptr %a, i128 0, i128 1 seq_cst seq_cst, !pcsections !0