• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -mtriple=ve | FileCheck %s
2
3;;; Test atomic load for all types and all memory order
4;;;
5;;; Note:
6;;;   We test i1/i8/i16/i32/i64/i128/u8/u16/u32/u64/u128.
7;;;   We test relaxed, acquire, and seq_cst.
8
9%"struct.std::__1::atomic" = type { %"struct.std::__1::__atomic_base" }
10%"struct.std::__1::__atomic_base" = type { %"struct.std::__1::__cxx_atomic_impl" }
11%"struct.std::__1::__cxx_atomic_impl" = type { %"struct.std::__1::__cxx_atomic_base_impl" }
12%"struct.std::__1::__cxx_atomic_base_impl" = type { i8 }
13%"struct.std::__1::atomic.0" = type { %"struct.std::__1::__atomic_base.1" }
14%"struct.std::__1::__atomic_base.1" = type { %"struct.std::__1::__atomic_base.2" }
15%"struct.std::__1::__atomic_base.2" = type { %"struct.std::__1::__cxx_atomic_impl.3" }
16%"struct.std::__1::__cxx_atomic_impl.3" = type { %"struct.std::__1::__cxx_atomic_base_impl.4" }
17%"struct.std::__1::__cxx_atomic_base_impl.4" = type { i8 }
18%"struct.std::__1::atomic.5" = type { %"struct.std::__1::__atomic_base.6" }
19%"struct.std::__1::__atomic_base.6" = type { %"struct.std::__1::__atomic_base.7" }
20%"struct.std::__1::__atomic_base.7" = type { %"struct.std::__1::__cxx_atomic_impl.8" }
21%"struct.std::__1::__cxx_atomic_impl.8" = type { %"struct.std::__1::__cxx_atomic_base_impl.9" }
22%"struct.std::__1::__cxx_atomic_base_impl.9" = type { i8 }
23%"struct.std::__1::atomic.10" = type { %"struct.std::__1::__atomic_base.11" }
24%"struct.std::__1::__atomic_base.11" = type { %"struct.std::__1::__atomic_base.12" }
25%"struct.std::__1::__atomic_base.12" = type { %"struct.std::__1::__cxx_atomic_impl.13" }
26%"struct.std::__1::__cxx_atomic_impl.13" = type { %"struct.std::__1::__cxx_atomic_base_impl.14" }
27%"struct.std::__1::__cxx_atomic_base_impl.14" = type { i16 }
28%"struct.std::__1::atomic.15" = type { %"struct.std::__1::__atomic_base.16" }
29%"struct.std::__1::__atomic_base.16" = type { %"struct.std::__1::__atomic_base.17" }
30%"struct.std::__1::__atomic_base.17" = type { %"struct.std::__1::__cxx_atomic_impl.18" }
31%"struct.std::__1::__cxx_atomic_impl.18" = type { %"struct.std::__1::__cxx_atomic_base_impl.19" }
32%"struct.std::__1::__cxx_atomic_base_impl.19" = type { i16 }
33%"struct.std::__1::atomic.20" = type { %"struct.std::__1::__atomic_base.21" }
34%"struct.std::__1::__atomic_base.21" = type { %"struct.std::__1::__atomic_base.22" }
35%"struct.std::__1::__atomic_base.22" = type { %"struct.std::__1::__cxx_atomic_impl.23" }
36%"struct.std::__1::__cxx_atomic_impl.23" = type { %"struct.std::__1::__cxx_atomic_base_impl.24" }
37%"struct.std::__1::__cxx_atomic_base_impl.24" = type { i32 }
38%"struct.std::__1::atomic.25" = type { %"struct.std::__1::__atomic_base.26" }
39%"struct.std::__1::__atomic_base.26" = type { %"struct.std::__1::__atomic_base.27" }
40%"struct.std::__1::__atomic_base.27" = type { %"struct.std::__1::__cxx_atomic_impl.28" }
41%"struct.std::__1::__cxx_atomic_impl.28" = type { %"struct.std::__1::__cxx_atomic_base_impl.29" }
42%"struct.std::__1::__cxx_atomic_base_impl.29" = type { i32 }
43%"struct.std::__1::atomic.30" = type { %"struct.std::__1::__atomic_base.31" }
44%"struct.std::__1::__atomic_base.31" = type { %"struct.std::__1::__atomic_base.32" }
45%"struct.std::__1::__atomic_base.32" = type { %"struct.std::__1::__cxx_atomic_impl.33" }
46%"struct.std::__1::__cxx_atomic_impl.33" = type { %"struct.std::__1::__cxx_atomic_base_impl.34" }
47%"struct.std::__1::__cxx_atomic_base_impl.34" = type { i64 }
48%"struct.std::__1::atomic.35" = type { %"struct.std::__1::__atomic_base.36" }
49%"struct.std::__1::__atomic_base.36" = type { %"struct.std::__1::__atomic_base.37" }
50%"struct.std::__1::__atomic_base.37" = type { %"struct.std::__1::__cxx_atomic_impl.38" }
51%"struct.std::__1::__cxx_atomic_impl.38" = type { %"struct.std::__1::__cxx_atomic_base_impl.39" }
52%"struct.std::__1::__cxx_atomic_base_impl.39" = type { i64 }
53%"struct.std::__1::atomic.40" = type { %"struct.std::__1::__atomic_base.41" }
54%"struct.std::__1::__atomic_base.41" = type { %"struct.std::__1::__atomic_base.42" }
55%"struct.std::__1::__atomic_base.42" = type { %"struct.std::__1::__cxx_atomic_impl.43" }
56%"struct.std::__1::__cxx_atomic_impl.43" = type { %"struct.std::__1::__cxx_atomic_base_impl.44" }
57%"struct.std::__1::__cxx_atomic_base_impl.44" = type { i128 }
58%"struct.std::__1::atomic.45" = type { %"struct.std::__1::__atomic_base.46" }
59%"struct.std::__1::__atomic_base.46" = type { %"struct.std::__1::__atomic_base.47" }
60%"struct.std::__1::__atomic_base.47" = type { %"struct.std::__1::__cxx_atomic_impl.48" }
61%"struct.std::__1::__cxx_atomic_impl.48" = type { %"struct.std::__1::__cxx_atomic_base_impl.49" }
62%"struct.std::__1::__cxx_atomic_base_impl.49" = type { i128 }
63
64; Function Attrs: nofree norecurse nounwind
65define zeroext i1 @_Z22atomic_load_relaxed_i1RNSt3__16atomicIbEE(%"struct.std::__1::atomic"* nocapture nonnull readonly align 1 dereferenceable(1) %0) {
66; CHECK-LABEL: _Z22atomic_load_relaxed_i1RNSt3__16atomicIbEE:
67; CHECK:       # %bb.0:
68; CHECK-NEXT:    ld1b.zx %s0, (, %s0)
69; CHECK-NEXT:    and %s0, 1, %s0
70; CHECK-NEXT:    b.l.t (, %s10)
71  %2 = getelementptr inbounds %"struct.std::__1::atomic", %"struct.std::__1::atomic"* %0, i64 0, i32 0, i32 0, i32 0, i32 0
72  %3 = load atomic i8, i8* %2 monotonic, align 1
73  %4 = and i8 %3, 1
74  %5 = icmp ne i8 %4, 0
75  ret i1 %5
76}
77
78; Function Attrs: nofree norecurse nounwind
79define signext i8 @_Z22atomic_load_relaxed_i8RNSt3__16atomicIcEE(%"struct.std::__1::atomic.0"* nocapture nonnull readonly align 1 dereferenceable(1) %0) {
80; CHECK-LABEL: _Z22atomic_load_relaxed_i8RNSt3__16atomicIcEE:
81; CHECK:       # %bb.0:
82; CHECK-NEXT:    ld1b.sx %s0, (, %s0)
83; CHECK-NEXT:    b.l.t (, %s10)
84  %2 = getelementptr inbounds %"struct.std::__1::atomic.0", %"struct.std::__1::atomic.0"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
85  %3 = load atomic i8, i8* %2 monotonic, align 1
86  ret i8 %3
87}
88
89; Function Attrs: nofree norecurse nounwind
90define zeroext i8 @_Z22atomic_load_relaxed_u8RNSt3__16atomicIhEE(%"struct.std::__1::atomic.5"* nocapture nonnull readonly align 1 dereferenceable(1) %0) {
91; CHECK-LABEL: _Z22atomic_load_relaxed_u8RNSt3__16atomicIhEE:
92; CHECK:       # %bb.0:
93; CHECK-NEXT:    ld1b.zx %s0, (, %s0)
94; CHECK-NEXT:    b.l.t (, %s10)
95  %2 = getelementptr inbounds %"struct.std::__1::atomic.5", %"struct.std::__1::atomic.5"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
96  %3 = load atomic i8, i8* %2 monotonic, align 1
97  ret i8 %3
98}
99
100; Function Attrs: nofree norecurse nounwind
101define signext i16 @_Z23atomic_load_relaxed_i16RNSt3__16atomicIsEE(%"struct.std::__1::atomic.10"* nocapture nonnull readonly align 2 dereferenceable(2) %0) {
102; CHECK-LABEL: _Z23atomic_load_relaxed_i16RNSt3__16atomicIsEE:
103; CHECK:       # %bb.0:
104; CHECK-NEXT:    ld2b.sx %s0, (, %s0)
105; CHECK-NEXT:    b.l.t (, %s10)
106  %2 = getelementptr inbounds %"struct.std::__1::atomic.10", %"struct.std::__1::atomic.10"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
107  %3 = load atomic i16, i16* %2 monotonic, align 2
108  ret i16 %3
109}
110
111; Function Attrs: nofree norecurse nounwind
112define zeroext i16 @_Z23atomic_load_relaxed_u16RNSt3__16atomicItEE(%"struct.std::__1::atomic.15"* nocapture nonnull readonly align 2 dereferenceable(2) %0) {
113; CHECK-LABEL: _Z23atomic_load_relaxed_u16RNSt3__16atomicItEE:
114; CHECK:       # %bb.0:
115; CHECK-NEXT:    ld2b.zx %s0, (, %s0)
116; CHECK-NEXT:    b.l.t (, %s10)
117  %2 = getelementptr inbounds %"struct.std::__1::atomic.15", %"struct.std::__1::atomic.15"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
118  %3 = load atomic i16, i16* %2 monotonic, align 2
119  ret i16 %3
120}
121
122; Function Attrs: nofree norecurse nounwind
123define signext i32 @_Z23atomic_load_relaxed_i32RNSt3__16atomicIiEE(%"struct.std::__1::atomic.20"* nocapture nonnull readonly align 4 dereferenceable(4) %0) {
124; CHECK-LABEL: _Z23atomic_load_relaxed_i32RNSt3__16atomicIiEE:
125; CHECK:       # %bb.0:
126; CHECK-NEXT:    ldl.sx %s0, (, %s0)
127; CHECK-NEXT:    b.l.t (, %s10)
128  %2 = getelementptr inbounds %"struct.std::__1::atomic.20", %"struct.std::__1::atomic.20"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
129  %3 = load atomic i32, i32* %2 monotonic, align 4
130  ret i32 %3
131}
132
133; Function Attrs: nofree norecurse nounwind
134define zeroext i32 @_Z23atomic_load_relaxed_u32RNSt3__16atomicIjEE(%"struct.std::__1::atomic.25"* nocapture nonnull readonly align 4 dereferenceable(4) %0) {
135; CHECK-LABEL: _Z23atomic_load_relaxed_u32RNSt3__16atomicIjEE:
136; CHECK:       # %bb.0:
137; CHECK-NEXT:    ldl.zx %s0, (, %s0)
138; CHECK-NEXT:    b.l.t (, %s10)
139  %2 = getelementptr inbounds %"struct.std::__1::atomic.25", %"struct.std::__1::atomic.25"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
140  %3 = load atomic i32, i32* %2 monotonic, align 4
141  ret i32 %3
142}
143
144; Function Attrs: nofree norecurse nounwind
145define i64 @_Z23atomic_load_relaxed_i64RNSt3__16atomicIlEE(%"struct.std::__1::atomic.30"* nocapture nonnull readonly align 8 dereferenceable(8) %0) {
146; CHECK-LABEL: _Z23atomic_load_relaxed_i64RNSt3__16atomicIlEE:
147; CHECK:       # %bb.0:
148; CHECK-NEXT:    ld %s0, (, %s0)
149; CHECK-NEXT:    b.l.t (, %s10)
150  %2 = getelementptr inbounds %"struct.std::__1::atomic.30", %"struct.std::__1::atomic.30"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
151  %3 = load atomic i64, i64* %2 monotonic, align 8
152  ret i64 %3
153}
154
155; Function Attrs: nofree norecurse nounwind
156define i64 @_Z23atomic_load_relaxed_u64RNSt3__16atomicImEE(%"struct.std::__1::atomic.35"* nocapture nonnull readonly align 8 dereferenceable(8) %0) {
157; CHECK-LABEL: _Z23atomic_load_relaxed_u64RNSt3__16atomicImEE:
158; CHECK:       # %bb.0:
159; CHECK-NEXT:    ld %s0, (, %s0)
160; CHECK-NEXT:    b.l.t (, %s10)
161  %2 = getelementptr inbounds %"struct.std::__1::atomic.35", %"struct.std::__1::atomic.35"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
162  %3 = load atomic i64, i64* %2 monotonic, align 8
163  ret i64 %3
164}
165
166; Function Attrs: nounwind
167define i128 @_Z24atomic_load_relaxed_i128RNSt3__16atomicInEE(%"struct.std::__1::atomic.40"* nonnull align 16 dereferenceable(16) %0) {
168; CHECK-LABEL: _Z24atomic_load_relaxed_i128RNSt3__16atomicInEE:
169; CHECK:       .LBB{{[0-9]+}}_2:
170; CHECK-NEXT:    or %s1, 0, %s0
171; CHECK-NEXT:    lea %s0, __atomic_load@lo
172; CHECK-NEXT:    and %s0, %s0, (32)0
173; CHECK-NEXT:    lea.sl %s12, __atomic_load@hi(, %s0)
174; CHECK-NEXT:    lea %s2, 240(, %s11)
175; CHECK-NEXT:    or %s0, 16, (0)1
176; CHECK-NEXT:    or %s3, 0, (0)1
177; CHECK-NEXT:    bsic %s10, (, %s12)
178; CHECK-NEXT:    ld %s1, 248(, %s11)
179; CHECK-NEXT:    ld %s0, 240(, %s11)
180; CHECK-NEXT:    or %s11, 0, %s9
181  %2 = alloca i128, align 16
182  %3 = bitcast i128* %2 to i8*
183  call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %3)
184  %4 = bitcast %"struct.std::__1::atomic.40"* %0 to i8*
185  call void @__atomic_load(i64 16, i8* nonnull %4, i8* nonnull %3, i32 signext 0)
186  %5 = load i128, i128* %2, align 16, !tbaa !2
187  call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %3)
188  ret i128 %5
189}
190
191; Function Attrs: nounwind
192define i128 @_Z24atomic_load_relaxed_u128RNSt3__16atomicIoEE(%"struct.std::__1::atomic.45"* nonnull align 16 dereferenceable(16) %0) {
193; CHECK-LABEL: _Z24atomic_load_relaxed_u128RNSt3__16atomicIoEE:
194; CHECK:       .LBB{{[0-9]+}}_2:
195; CHECK-NEXT:    or %s1, 0, %s0
196; CHECK-NEXT:    lea %s0, __atomic_load@lo
197; CHECK-NEXT:    and %s0, %s0, (32)0
198; CHECK-NEXT:    lea.sl %s12, __atomic_load@hi(, %s0)
199; CHECK-NEXT:    lea %s2, 240(, %s11)
200; CHECK-NEXT:    or %s0, 16, (0)1
201; CHECK-NEXT:    or %s3, 0, (0)1
202; CHECK-NEXT:    bsic %s10, (, %s12)
203; CHECK-NEXT:    ld %s1, 248(, %s11)
204; CHECK-NEXT:    ld %s0, 240(, %s11)
205; CHECK-NEXT:    or %s11, 0, %s9
206  %2 = alloca i128, align 16
207  %3 = bitcast i128* %2 to i8*
208  call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %3)
209  %4 = bitcast %"struct.std::__1::atomic.45"* %0 to i8*
210  call void @__atomic_load(i64 16, i8* nonnull %4, i8* nonnull %3, i32 signext 0)
211  %5 = load i128, i128* %2, align 16, !tbaa !2
212  call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %3)
213  ret i128 %5
214}
215
216; Function Attrs: nofree norecurse nounwind
217define zeroext i1 @_Z22atomic_load_acquire_i1RNSt3__16atomicIbEE(%"struct.std::__1::atomic"* nocapture nonnull readonly align 1 dereferenceable(1) %0) {
218; CHECK-LABEL: _Z22atomic_load_acquire_i1RNSt3__16atomicIbEE:
219; CHECK:       # %bb.0:
220; CHECK-NEXT:    ld1b.zx %s0, (, %s0)
221; CHECK-NEXT:    and %s0, 1, %s0
222; CHECK-NEXT:    fencem 2
223; CHECK-NEXT:    b.l.t (, %s10)
224  %2 = getelementptr inbounds %"struct.std::__1::atomic", %"struct.std::__1::atomic"* %0, i64 0, i32 0, i32 0, i32 0, i32 0
225  %3 = load atomic i8, i8* %2 acquire, align 1
226  %4 = and i8 %3, 1
227  %5 = icmp ne i8 %4, 0
228  ret i1 %5
229}
230
231; Function Attrs: nofree norecurse nounwind
232define signext i8 @_Z22atomic_load_acquire_i8RNSt3__16atomicIcEE(%"struct.std::__1::atomic.0"* nocapture nonnull readonly align 1 dereferenceable(1) %0) {
233; CHECK-LABEL: _Z22atomic_load_acquire_i8RNSt3__16atomicIcEE:
234; CHECK:       # %bb.0:
235; CHECK-NEXT:    ld1b.sx %s0, (, %s0)
236; CHECK-NEXT:    fencem 2
237; CHECK-NEXT:    b.l.t (, %s10)
238  %2 = getelementptr inbounds %"struct.std::__1::atomic.0", %"struct.std::__1::atomic.0"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
239  %3 = load atomic i8, i8* %2 acquire, align 1
240  ret i8 %3
241}
242
243; Function Attrs: nofree norecurse nounwind
244define zeroext i8 @_Z22atomic_load_acquire_u8RNSt3__16atomicIhEE(%"struct.std::__1::atomic.5"* nocapture nonnull readonly align 1 dereferenceable(1) %0) {
245; CHECK-LABEL: _Z22atomic_load_acquire_u8RNSt3__16atomicIhEE:
246; CHECK:       # %bb.0:
247; CHECK-NEXT:    ld1b.zx %s0, (, %s0)
248; CHECK-NEXT:    fencem 2
249; CHECK-NEXT:    b.l.t (, %s10)
250  %2 = getelementptr inbounds %"struct.std::__1::atomic.5", %"struct.std::__1::atomic.5"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
251  %3 = load atomic i8, i8* %2 acquire, align 1
252  ret i8 %3
253}
254
255; Function Attrs: nofree norecurse nounwind
256define signext i16 @_Z23atomic_load_acquire_i16RNSt3__16atomicIsEE(%"struct.std::__1::atomic.10"* nocapture nonnull readonly align 2 dereferenceable(2) %0) {
257; CHECK-LABEL: _Z23atomic_load_acquire_i16RNSt3__16atomicIsEE:
258; CHECK:       # %bb.0:
259; CHECK-NEXT:    ld2b.sx %s0, (, %s0)
260; CHECK-NEXT:    fencem 2
261; CHECK-NEXT:    b.l.t (, %s10)
262  %2 = getelementptr inbounds %"struct.std::__1::atomic.10", %"struct.std::__1::atomic.10"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
263  %3 = load atomic i16, i16* %2 acquire, align 2
264  ret i16 %3
265}
266
267; Function Attrs: nofree norecurse nounwind
268define zeroext i16 @_Z23atomic_load_acquire_u16RNSt3__16atomicItEE(%"struct.std::__1::atomic.15"* nocapture nonnull readonly align 2 dereferenceable(2) %0) {
269; CHECK-LABEL: _Z23atomic_load_acquire_u16RNSt3__16atomicItEE:
270; CHECK:       # %bb.0:
271; CHECK-NEXT:    ld2b.zx %s0, (, %s0)
272; CHECK-NEXT:    fencem 2
273; CHECK-NEXT:    b.l.t (, %s10)
274  %2 = getelementptr inbounds %"struct.std::__1::atomic.15", %"struct.std::__1::atomic.15"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
275  %3 = load atomic i16, i16* %2 acquire, align 2
276  ret i16 %3
277}
278
279; Function Attrs: nofree norecurse nounwind
280define signext i32 @_Z23atomic_load_acquire_i32RNSt3__16atomicIiEE(%"struct.std::__1::atomic.20"* nocapture nonnull readonly align 4 dereferenceable(4) %0) {
281; CHECK-LABEL: _Z23atomic_load_acquire_i32RNSt3__16atomicIiEE:
282; CHECK:       # %bb.0:
283; CHECK-NEXT:    ldl.sx %s0, (, %s0)
284; CHECK-NEXT:    fencem 2
285; CHECK-NEXT:    b.l.t (, %s10)
286  %2 = getelementptr inbounds %"struct.std::__1::atomic.20", %"struct.std::__1::atomic.20"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
287  %3 = load atomic i32, i32* %2 acquire, align 4
288  ret i32 %3
289}
290
291; Function Attrs: nofree norecurse nounwind
292define zeroext i32 @_Z23atomic_load_acquire_u32RNSt3__16atomicIjEE(%"struct.std::__1::atomic.25"* nocapture nonnull readonly align 4 dereferenceable(4) %0) {
293; CHECK-LABEL: _Z23atomic_load_acquire_u32RNSt3__16atomicIjEE:
294; CHECK:       # %bb.0:
295; CHECK-NEXT:    ldl.zx %s0, (, %s0)
296; CHECK-NEXT:    fencem 2
297; CHECK-NEXT:    b.l.t (, %s10)
298  %2 = getelementptr inbounds %"struct.std::__1::atomic.25", %"struct.std::__1::atomic.25"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
299  %3 = load atomic i32, i32* %2 acquire, align 4
300  ret i32 %3
301}
302
303; Function Attrs: nofree norecurse nounwind
304define i64 @_Z23atomic_load_acquire_i64RNSt3__16atomicIlEE(%"struct.std::__1::atomic.30"* nocapture nonnull readonly align 8 dereferenceable(8) %0) {
305; CHECK-LABEL: _Z23atomic_load_acquire_i64RNSt3__16atomicIlEE:
306; CHECK:       # %bb.0:
307; CHECK-NEXT:    ld %s0, (, %s0)
308; CHECK-NEXT:    fencem 2
309; CHECK-NEXT:    b.l.t (, %s10)
310  %2 = getelementptr inbounds %"struct.std::__1::atomic.30", %"struct.std::__1::atomic.30"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
311  %3 = load atomic i64, i64* %2 acquire, align 8
312  ret i64 %3
313}
314
315; Function Attrs: nofree norecurse nounwind
316define i64 @_Z23atomic_load_acquire_u64RNSt3__16atomicImEE(%"struct.std::__1::atomic.35"* nocapture nonnull readonly align 8 dereferenceable(8) %0) {
317; CHECK-LABEL: _Z23atomic_load_acquire_u64RNSt3__16atomicImEE:
318; CHECK:       # %bb.0:
319; CHECK-NEXT:    ld %s0, (, %s0)
320; CHECK-NEXT:    fencem 2
321; CHECK-NEXT:    b.l.t (, %s10)
322  %2 = getelementptr inbounds %"struct.std::__1::atomic.35", %"struct.std::__1::atomic.35"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
323  %3 = load atomic i64, i64* %2 acquire, align 8
324  ret i64 %3
325}
326
327; Function Attrs: nounwind
328define i128 @_Z24atomic_load_acquire_i128RNSt3__16atomicInEE(%"struct.std::__1::atomic.40"* nonnull align 16 dereferenceable(16) %0) {
329; CHECK-LABEL: _Z24atomic_load_acquire_i128RNSt3__16atomicInEE:
330; CHECK:       .LBB{{[0-9]+}}_2:
331; CHECK-NEXT:    or %s1, 0, %s0
332; CHECK-NEXT:    lea %s0, __atomic_load@lo
333; CHECK-NEXT:    and %s0, %s0, (32)0
334; CHECK-NEXT:    lea.sl %s12, __atomic_load@hi(, %s0)
335; CHECK-NEXT:    lea %s2, 240(, %s11)
336; CHECK-NEXT:    or %s0, 16, (0)1
337; CHECK-NEXT:    or %s3, 2, (0)1
338; CHECK-NEXT:    bsic %s10, (, %s12)
339; CHECK-NEXT:    ld %s1, 248(, %s11)
340; CHECK-NEXT:    ld %s0, 240(, %s11)
341; CHECK-NEXT:    or %s11, 0, %s9
342  %2 = alloca i128, align 16
343  %3 = bitcast i128* %2 to i8*
344  call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %3)
345  %4 = bitcast %"struct.std::__1::atomic.40"* %0 to i8*
346  call void @__atomic_load(i64 16, i8* nonnull %4, i8* nonnull %3, i32 signext 2)
347  %5 = load i128, i128* %2, align 16, !tbaa !2
348  call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %3)
349  ret i128 %5
350}
351
352; Function Attrs: nounwind
353define i128 @_Z24atomic_load_acquire_u128RNSt3__16atomicIoEE(%"struct.std::__1::atomic.45"* nonnull align 16 dereferenceable(16) %0) {
354; CHECK-LABEL: _Z24atomic_load_acquire_u128RNSt3__16atomicIoEE:
355; CHECK:       .LBB{{[0-9]+}}_2:
356; CHECK-NEXT:    or %s1, 0, %s0
357; CHECK-NEXT:    lea %s0, __atomic_load@lo
358; CHECK-NEXT:    and %s0, %s0, (32)0
359; CHECK-NEXT:    lea.sl %s12, __atomic_load@hi(, %s0)
360; CHECK-NEXT:    lea %s2, 240(, %s11)
361; CHECK-NEXT:    or %s0, 16, (0)1
362; CHECK-NEXT:    or %s3, 2, (0)1
363; CHECK-NEXT:    bsic %s10, (, %s12)
364; CHECK-NEXT:    ld %s1, 248(, %s11)
365; CHECK-NEXT:    ld %s0, 240(, %s11)
366; CHECK-NEXT:    or %s11, 0, %s9
367  %2 = alloca i128, align 16
368  %3 = bitcast i128* %2 to i8*
369  call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %3)
370  %4 = bitcast %"struct.std::__1::atomic.45"* %0 to i8*
371  call void @__atomic_load(i64 16, i8* nonnull %4, i8* nonnull %3, i32 signext 2)
372  %5 = load i128, i128* %2, align 16, !tbaa !2
373  call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %3)
374  ret i128 %5
375}
376
377; Function Attrs: nofree norecurse nounwind
378define zeroext i1 @_Z22atomic_load_seq_cst_i1RNSt3__16atomicIbEE(%"struct.std::__1::atomic"* nocapture nonnull readonly align 1 dereferenceable(1) %0) {
379; CHECK-LABEL: _Z22atomic_load_seq_cst_i1RNSt3__16atomicIbEE:
380; CHECK:       # %bb.0:
381; CHECK-NEXT:    ld1b.zx %s0, (, %s0)
382; CHECK-NEXT:    and %s0, 1, %s0
383; CHECK-NEXT:    fencem 3
384; CHECK-NEXT:    b.l.t (, %s10)
385  %2 = getelementptr inbounds %"struct.std::__1::atomic", %"struct.std::__1::atomic"* %0, i64 0, i32 0, i32 0, i32 0, i32 0
386  %3 = load atomic i8, i8* %2 seq_cst, align 1
387  %4 = and i8 %3, 1
388  %5 = icmp ne i8 %4, 0
389  ret i1 %5
390}
391
392; Function Attrs: nofree norecurse nounwind
393define signext i8 @_Z22atomic_load_seq_cst_i8RNSt3__16atomicIcEE(%"struct.std::__1::atomic.0"* nocapture nonnull readonly align 1 dereferenceable(1) %0) {
394; CHECK-LABEL: _Z22atomic_load_seq_cst_i8RNSt3__16atomicIcEE:
395; CHECK:       # %bb.0:
396; CHECK-NEXT:    ld1b.sx %s0, (, %s0)
397; CHECK-NEXT:    fencem 3
398; CHECK-NEXT:    b.l.t (, %s10)
399  %2 = getelementptr inbounds %"struct.std::__1::atomic.0", %"struct.std::__1::atomic.0"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
400  %3 = load atomic i8, i8* %2 seq_cst, align 1
401  ret i8 %3
402}
403
404; Function Attrs: nofree norecurse nounwind
405define zeroext i8 @_Z22atomic_load_seq_cst_u8RNSt3__16atomicIhEE(%"struct.std::__1::atomic.5"* nocapture nonnull readonly align 1 dereferenceable(1) %0) {
406; CHECK-LABEL: _Z22atomic_load_seq_cst_u8RNSt3__16atomicIhEE:
407; CHECK:       # %bb.0:
408; CHECK-NEXT:    ld1b.zx %s0, (, %s0)
409; CHECK-NEXT:    fencem 3
410; CHECK-NEXT:    b.l.t (, %s10)
411  %2 = getelementptr inbounds %"struct.std::__1::atomic.5", %"struct.std::__1::atomic.5"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
412  %3 = load atomic i8, i8* %2 seq_cst, align 1
413  ret i8 %3
414}
415
416; Function Attrs: nofree norecurse nounwind
417define signext i16 @_Z23atomic_load_seq_cst_i16RNSt3__16atomicIsEE(%"struct.std::__1::atomic.10"* nocapture nonnull readonly align 2 dereferenceable(2) %0) {
418; CHECK-LABEL: _Z23atomic_load_seq_cst_i16RNSt3__16atomicIsEE:
419; CHECK:       # %bb.0:
420; CHECK-NEXT:    ld2b.sx %s0, (, %s0)
421; CHECK-NEXT:    fencem 3
422; CHECK-NEXT:    b.l.t (, %s10)
423  %2 = getelementptr inbounds %"struct.std::__1::atomic.10", %"struct.std::__1::atomic.10"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
424  %3 = load atomic i16, i16* %2 seq_cst, align 2
425  ret i16 %3
426}
427
428; Function Attrs: nofree norecurse nounwind
429define zeroext i16 @_Z23atomic_load_seq_cst_u16RNSt3__16atomicItEE(%"struct.std::__1::atomic.15"* nocapture nonnull readonly align 2 dereferenceable(2) %0) {
430; CHECK-LABEL: _Z23atomic_load_seq_cst_u16RNSt3__16atomicItEE:
431; CHECK:       # %bb.0:
432; CHECK-NEXT:    ld2b.zx %s0, (, %s0)
433; CHECK-NEXT:    fencem 3
434; CHECK-NEXT:    b.l.t (, %s10)
435  %2 = getelementptr inbounds %"struct.std::__1::atomic.15", %"struct.std::__1::atomic.15"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
436  %3 = load atomic i16, i16* %2 seq_cst, align 2
437  ret i16 %3
438}
439
440; Function Attrs: nofree norecurse nounwind
441define signext i32 @_Z23atomic_load_seq_cst_i32RNSt3__16atomicIiEE(%"struct.std::__1::atomic.20"* nocapture nonnull readonly align 4 dereferenceable(4) %0) {
442; CHECK-LABEL: _Z23atomic_load_seq_cst_i32RNSt3__16atomicIiEE:
443; CHECK:       # %bb.0:
444; CHECK-NEXT:    ldl.sx %s0, (, %s0)
445; CHECK-NEXT:    fencem 3
446; CHECK-NEXT:    b.l.t (, %s10)
447  %2 = getelementptr inbounds %"struct.std::__1::atomic.20", %"struct.std::__1::atomic.20"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
448  %3 = load atomic i32, i32* %2 seq_cst, align 4
449  ret i32 %3
450}
451
452; Function Attrs: nofree norecurse nounwind
453define zeroext i32 @_Z23atomic_load_seq_cst_u32RNSt3__16atomicIjEE(%"struct.std::__1::atomic.25"* nocapture nonnull readonly align 4 dereferenceable(4) %0) {
454; CHECK-LABEL: _Z23atomic_load_seq_cst_u32RNSt3__16atomicIjEE:
455; CHECK:       # %bb.0:
456; CHECK-NEXT:    ldl.zx %s0, (, %s0)
457; CHECK-NEXT:    fencem 3
458; CHECK-NEXT:    b.l.t (, %s10)
459  %2 = getelementptr inbounds %"struct.std::__1::atomic.25", %"struct.std::__1::atomic.25"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
460  %3 = load atomic i32, i32* %2 seq_cst, align 4
461  ret i32 %3
462}
463
464; Function Attrs: nofree norecurse nounwind
465define i64 @_Z23atomic_load_seq_cst_i64RNSt3__16atomicIlEE(%"struct.std::__1::atomic.30"* nocapture nonnull readonly align 8 dereferenceable(8) %0) {
466; CHECK-LABEL: _Z23atomic_load_seq_cst_i64RNSt3__16atomicIlEE:
467; CHECK:       # %bb.0:
468; CHECK-NEXT:    ld %s0, (, %s0)
469; CHECK-NEXT:    fencem 3
470; CHECK-NEXT:    b.l.t (, %s10)
471  %2 = getelementptr inbounds %"struct.std::__1::atomic.30", %"struct.std::__1::atomic.30"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
472  %3 = load atomic i64, i64* %2 seq_cst, align 8
473  ret i64 %3
474}
475
476; Function Attrs: nofree norecurse nounwind
477define i64 @_Z23atomic_load_seq_cst_u64RNSt3__16atomicImEE(%"struct.std::__1::atomic.35"* nocapture nonnull readonly align 8 dereferenceable(8) %0) {
478; CHECK-LABEL: _Z23atomic_load_seq_cst_u64RNSt3__16atomicImEE:
479; CHECK:       # %bb.0:
480; CHECK-NEXT:    ld %s0, (, %s0)
481; CHECK-NEXT:    fencem 3
482; CHECK-NEXT:    b.l.t (, %s10)
483  %2 = getelementptr inbounds %"struct.std::__1::atomic.35", %"struct.std::__1::atomic.35"* %0, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
484  %3 = load atomic i64, i64* %2 seq_cst, align 8
485  ret i64 %3
486}
487
488; Function Attrs: nounwind
489define i128 @_Z24atomic_load_seq_cst_i128RNSt3__16atomicInEE(%"struct.std::__1::atomic.40"* nonnull align 16 dereferenceable(16) %0) {
490; CHECK-LABEL: _Z24atomic_load_seq_cst_i128RNSt3__16atomicInEE:
491; CHECK:       .LBB{{[0-9]+}}_2:
492; CHECK-NEXT:    or %s1, 0, %s0
493; CHECK-NEXT:    lea %s0, __atomic_load@lo
494; CHECK-NEXT:    and %s0, %s0, (32)0
495; CHECK-NEXT:    lea.sl %s12, __atomic_load@hi(, %s0)
496; CHECK-NEXT:    lea %s2, 240(, %s11)
497; CHECK-NEXT:    or %s0, 16, (0)1
498; CHECK-NEXT:    or %s3, 5, (0)1
499; CHECK-NEXT:    bsic %s10, (, %s12)
500; CHECK-NEXT:    ld %s1, 248(, %s11)
501; CHECK-NEXT:    ld %s0, 240(, %s11)
502; CHECK-NEXT:    or %s11, 0, %s9
503  %2 = alloca i128, align 16
504  %3 = bitcast i128* %2 to i8*
505  call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %3)
506  %4 = bitcast %"struct.std::__1::atomic.40"* %0 to i8*
507  call void @__atomic_load(i64 16, i8* nonnull %4, i8* nonnull %3, i32 signext 5)
508  %5 = load i128, i128* %2, align 16, !tbaa !2
509  call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %3)
510  ret i128 %5
511}
512
513; Function Attrs: nounwind
514define i128 @_Z24atomic_load_seq_cst_u128RNSt3__16atomicIoEE(%"struct.std::__1::atomic.45"* nonnull align 16 dereferenceable(16) %0) {
515; CHECK-LABEL: _Z24atomic_load_seq_cst_u128RNSt3__16atomicIoEE:
516; CHECK:       .LBB{{[0-9]+}}_2:
517; CHECK-NEXT:    or %s1, 0, %s0
518; CHECK-NEXT:    lea %s0, __atomic_load@lo
519; CHECK-NEXT:    and %s0, %s0, (32)0
520; CHECK-NEXT:    lea.sl %s12, __atomic_load@hi(, %s0)
521; CHECK-NEXT:    lea %s2, 240(, %s11)
522; CHECK-NEXT:    or %s0, 16, (0)1
523; CHECK-NEXT:    or %s3, 5, (0)1
524; CHECK-NEXT:    bsic %s10, (, %s12)
525; CHECK-NEXT:    ld %s1, 248(, %s11)
526; CHECK-NEXT:    ld %s0, 240(, %s11)
527; CHECK-NEXT:    or %s11, 0, %s9
528  %2 = alloca i128, align 16
529  %3 = bitcast i128* %2 to i8*
530  call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %3)
531  %4 = bitcast %"struct.std::__1::atomic.45"* %0 to i8*
532  call void @__atomic_load(i64 16, i8* nonnull %4, i8* nonnull %3, i32 signext 5)
533  %5 = load i128, i128* %2, align 16, !tbaa !2
534  call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %3)
535  ret i128 %5
536}
537
538; Function Attrs: nofree nounwind willreturn
539declare void @__atomic_load(i64, i8*, i8*, i32)
540
541; Function Attrs: argmemonly nounwind willreturn
542declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture)
543
544; Function Attrs: argmemonly nounwind willreturn
545declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture)
546
547!2 = !{!3, !3, i64 0}
548!3 = !{!"__int128", !4, i64 0}
549!4 = !{!"omnipotent char", !5, i64 0}
550!5 = !{!"Simple C++ TBAA"}
551