blob: a9d3472c3d263af251fb8740542c1a6f2461675a [file] [log] [blame]
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +09001; 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.
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +09008;;; We test an object, a stack object, and a global variable.
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +09009
10%"struct.std::__1::atomic" = type { %"struct.std::__1::__atomic_base" }
11%"struct.std::__1::__atomic_base" = type { %"struct.std::__1::__cxx_atomic_impl" }
12%"struct.std::__1::__cxx_atomic_impl" = type { %"struct.std::__1::__cxx_atomic_base_impl" }
13%"struct.std::__1::__cxx_atomic_base_impl" = type { i8 }
14%"struct.std::__1::atomic.0" = type { %"struct.std::__1::__atomic_base.1" }
15%"struct.std::__1::__atomic_base.1" = type { %"struct.std::__1::__atomic_base.2" }
16%"struct.std::__1::__atomic_base.2" = type { %"struct.std::__1::__cxx_atomic_impl.3" }
17%"struct.std::__1::__cxx_atomic_impl.3" = type { %"struct.std::__1::__cxx_atomic_base_impl.4" }
18%"struct.std::__1::__cxx_atomic_base_impl.4" = type { i8 }
19%"struct.std::__1::atomic.5" = type { %"struct.std::__1::__atomic_base.6" }
20%"struct.std::__1::__atomic_base.6" = type { %"struct.std::__1::__atomic_base.7" }
21%"struct.std::__1::__atomic_base.7" = type { %"struct.std::__1::__cxx_atomic_impl.8" }
22%"struct.std::__1::__cxx_atomic_impl.8" = type { %"struct.std::__1::__cxx_atomic_base_impl.9" }
23%"struct.std::__1::__cxx_atomic_base_impl.9" = type { i8 }
24%"struct.std::__1::atomic.10" = type { %"struct.std::__1::__atomic_base.11" }
25%"struct.std::__1::__atomic_base.11" = type { %"struct.std::__1::__atomic_base.12" }
26%"struct.std::__1::__atomic_base.12" = type { %"struct.std::__1::__cxx_atomic_impl.13" }
27%"struct.std::__1::__cxx_atomic_impl.13" = type { %"struct.std::__1::__cxx_atomic_base_impl.14" }
28%"struct.std::__1::__cxx_atomic_base_impl.14" = type { i16 }
29%"struct.std::__1::atomic.15" = type { %"struct.std::__1::__atomic_base.16" }
30%"struct.std::__1::__atomic_base.16" = type { %"struct.std::__1::__atomic_base.17" }
31%"struct.std::__1::__atomic_base.17" = type { %"struct.std::__1::__cxx_atomic_impl.18" }
32%"struct.std::__1::__cxx_atomic_impl.18" = type { %"struct.std::__1::__cxx_atomic_base_impl.19" }
33%"struct.std::__1::__cxx_atomic_base_impl.19" = type { i16 }
34%"struct.std::__1::atomic.20" = type { %"struct.std::__1::__atomic_base.21" }
35%"struct.std::__1::__atomic_base.21" = type { %"struct.std::__1::__atomic_base.22" }
36%"struct.std::__1::__atomic_base.22" = type { %"struct.std::__1::__cxx_atomic_impl.23" }
37%"struct.std::__1::__cxx_atomic_impl.23" = type { %"struct.std::__1::__cxx_atomic_base_impl.24" }
38%"struct.std::__1::__cxx_atomic_base_impl.24" = type { i32 }
39%"struct.std::__1::atomic.25" = type { %"struct.std::__1::__atomic_base.26" }
40%"struct.std::__1::__atomic_base.26" = type { %"struct.std::__1::__atomic_base.27" }
41%"struct.std::__1::__atomic_base.27" = type { %"struct.std::__1::__cxx_atomic_impl.28" }
42%"struct.std::__1::__cxx_atomic_impl.28" = type { %"struct.std::__1::__cxx_atomic_base_impl.29" }
43%"struct.std::__1::__cxx_atomic_base_impl.29" = type { i32 }
44%"struct.std::__1::atomic.30" = type { %"struct.std::__1::__atomic_base.31" }
45%"struct.std::__1::__atomic_base.31" = type { %"struct.std::__1::__atomic_base.32" }
46%"struct.std::__1::__atomic_base.32" = type { %"struct.std::__1::__cxx_atomic_impl.33" }
47%"struct.std::__1::__cxx_atomic_impl.33" = type { %"struct.std::__1::__cxx_atomic_base_impl.34" }
48%"struct.std::__1::__cxx_atomic_base_impl.34" = type { i64 }
49%"struct.std::__1::atomic.35" = type { %"struct.std::__1::__atomic_base.36" }
50%"struct.std::__1::__atomic_base.36" = type { %"struct.std::__1::__atomic_base.37" }
51%"struct.std::__1::__atomic_base.37" = type { %"struct.std::__1::__cxx_atomic_impl.38" }
52%"struct.std::__1::__cxx_atomic_impl.38" = type { %"struct.std::__1::__cxx_atomic_base_impl.39" }
53%"struct.std::__1::__cxx_atomic_base_impl.39" = type { i64 }
54%"struct.std::__1::atomic.40" = type { %"struct.std::__1::__atomic_base.41" }
55%"struct.std::__1::__atomic_base.41" = type { %"struct.std::__1::__atomic_base.42" }
56%"struct.std::__1::__atomic_base.42" = type { %"struct.std::__1::__cxx_atomic_impl.43" }
57%"struct.std::__1::__cxx_atomic_impl.43" = type { %"struct.std::__1::__cxx_atomic_base_impl.44" }
58%"struct.std::__1::__cxx_atomic_base_impl.44" = type { i128 }
59%"struct.std::__1::atomic.45" = type { %"struct.std::__1::__atomic_base.46" }
60%"struct.std::__1::__atomic_base.46" = type { %"struct.std::__1::__atomic_base.47" }
61%"struct.std::__1::__atomic_base.47" = type { %"struct.std::__1::__cxx_atomic_impl.48" }
62%"struct.std::__1::__cxx_atomic_impl.48" = type { %"struct.std::__1::__cxx_atomic_base_impl.49" }
63%"struct.std::__1::__cxx_atomic_base_impl.49" = type { i128 }
64
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +090065@gv_i1 = global %"struct.std::__1::atomic" zeroinitializer, align 4
66@gv_i8 = global %"struct.std::__1::atomic.0" zeroinitializer, align 4
67@gv_u8 = global %"struct.std::__1::atomic.5" zeroinitializer, align 4
68@gv_i16 = global %"struct.std::__1::atomic.10" zeroinitializer, align 4
69@gv_u16 = global %"struct.std::__1::atomic.15" zeroinitializer, align 4
70@gv_i32 = global %"struct.std::__1::atomic.20" zeroinitializer, align 4
71@gv_u32 = global %"struct.std::__1::atomic.25" zeroinitializer, align 4
72@gv_i64 = global %"struct.std::__1::atomic.30" zeroinitializer, align 8
73@gv_u64 = global %"struct.std::__1::atomic.35" zeroinitializer, align 8
74@gv_i128 = global %"struct.std::__1::atomic.40" zeroinitializer, align 16
75@gv_u128 = global %"struct.std::__1::atomic.45" zeroinitializer, align 16
76
77; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +090078define zeroext i1 @_Z22atomic_load_relaxed_i1RNSt3__16atomicIbEE(%"struct.std::__1::atomic"* nocapture nonnull readonly align 1 dereferenceable(1) %0) {
79; CHECK-LABEL: _Z22atomic_load_relaxed_i1RNSt3__16atomicIbEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +090080; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +090081; CHECK-NEXT: ld1b.zx %s0, (, %s0)
82; CHECK-NEXT: and %s0, 1, %s0
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +090083; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +090084 %2 = getelementptr inbounds %"struct.std::__1::atomic", %"struct.std::__1::atomic"* %0, i64 0, i32 0, i32 0, i32 0, i32 0
85 %3 = load atomic i8, i8* %2 monotonic, align 1
86 %4 = and i8 %3, 1
87 %5 = icmp ne i8 %4, 0
88 ret i1 %5
89}
90
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +090091; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +090092define signext i8 @_Z22atomic_load_relaxed_i8RNSt3__16atomicIcEE(%"struct.std::__1::atomic.0"* nocapture nonnull readonly align 1 dereferenceable(1) %0) {
93; CHECK-LABEL: _Z22atomic_load_relaxed_i8RNSt3__16atomicIcEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +090094; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +090095; CHECK-NEXT: ld1b.sx %s0, (, %s0)
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +090096; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +090097 %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
98 %3 = load atomic i8, i8* %2 monotonic, align 1
99 ret i8 %3
100}
101
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900102; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900103define zeroext i8 @_Z22atomic_load_relaxed_u8RNSt3__16atomicIhEE(%"struct.std::__1::atomic.5"* nocapture nonnull readonly align 1 dereferenceable(1) %0) {
104; CHECK-LABEL: _Z22atomic_load_relaxed_u8RNSt3__16atomicIhEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900105; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900106; CHECK-NEXT: ld1b.zx %s0, (, %s0)
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900107; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900108 %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
109 %3 = load atomic i8, i8* %2 monotonic, align 1
110 ret i8 %3
111}
112
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900113; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900114define signext i16 @_Z23atomic_load_relaxed_i16RNSt3__16atomicIsEE(%"struct.std::__1::atomic.10"* nocapture nonnull readonly align 2 dereferenceable(2) %0) {
115; CHECK-LABEL: _Z23atomic_load_relaxed_i16RNSt3__16atomicIsEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900116; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900117; CHECK-NEXT: ld2b.sx %s0, (, %s0)
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900118; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900119 %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
120 %3 = load atomic i16, i16* %2 monotonic, align 2
121 ret i16 %3
122}
123
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900124; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900125define zeroext i16 @_Z23atomic_load_relaxed_u16RNSt3__16atomicItEE(%"struct.std::__1::atomic.15"* nocapture nonnull readonly align 2 dereferenceable(2) %0) {
126; CHECK-LABEL: _Z23atomic_load_relaxed_u16RNSt3__16atomicItEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900127; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900128; CHECK-NEXT: ld2b.zx %s0, (, %s0)
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900129; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900130 %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
131 %3 = load atomic i16, i16* %2 monotonic, align 2
132 ret i16 %3
133}
134
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900135; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900136define signext i32 @_Z23atomic_load_relaxed_i32RNSt3__16atomicIiEE(%"struct.std::__1::atomic.20"* nocapture nonnull readonly align 4 dereferenceable(4) %0) {
137; CHECK-LABEL: _Z23atomic_load_relaxed_i32RNSt3__16atomicIiEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900138; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900139; CHECK-NEXT: ldl.sx %s0, (, %s0)
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900140; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900141 %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
142 %3 = load atomic i32, i32* %2 monotonic, align 4
143 ret i32 %3
144}
145
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900146; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900147define zeroext i32 @_Z23atomic_load_relaxed_u32RNSt3__16atomicIjEE(%"struct.std::__1::atomic.25"* nocapture nonnull readonly align 4 dereferenceable(4) %0) {
148; CHECK-LABEL: _Z23atomic_load_relaxed_u32RNSt3__16atomicIjEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900149; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900150; CHECK-NEXT: ldl.zx %s0, (, %s0)
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900151; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900152 %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
153 %3 = load atomic i32, i32* %2 monotonic, align 4
154 ret i32 %3
155}
156
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900157; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900158define i64 @_Z23atomic_load_relaxed_i64RNSt3__16atomicIlEE(%"struct.std::__1::atomic.30"* nocapture nonnull readonly align 8 dereferenceable(8) %0) {
159; CHECK-LABEL: _Z23atomic_load_relaxed_i64RNSt3__16atomicIlEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900160; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900161; CHECK-NEXT: ld %s0, (, %s0)
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900162; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900163 %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
164 %3 = load atomic i64, i64* %2 monotonic, align 8
165 ret i64 %3
166}
167
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900168; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900169define i64 @_Z23atomic_load_relaxed_u64RNSt3__16atomicImEE(%"struct.std::__1::atomic.35"* nocapture nonnull readonly align 8 dereferenceable(8) %0) {
170; CHECK-LABEL: _Z23atomic_load_relaxed_u64RNSt3__16atomicImEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900171; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900172; CHECK-NEXT: ld %s0, (, %s0)
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900173; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900174 %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
175 %3 = load atomic i64, i64* %2 monotonic, align 8
176 ret i64 %3
177}
178
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900179; Function Attrs: nofree nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900180define i128 @_Z24atomic_load_relaxed_i128RNSt3__16atomicInEE(%"struct.std::__1::atomic.40"* nonnull align 16 dereferenceable(16) %0) {
181; CHECK-LABEL: _Z24atomic_load_relaxed_i128RNSt3__16atomicInEE:
182; CHECK: .LBB{{[0-9]+}}_2:
183; CHECK-NEXT: or %s1, 0, %s0
184; CHECK-NEXT: lea %s0, __atomic_load@lo
185; CHECK-NEXT: and %s0, %s0, (32)0
186; CHECK-NEXT: lea.sl %s12, __atomic_load@hi(, %s0)
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900187; CHECK-NEXT: lea %s2, 240(, %s11)
Kazushi (Jam) Marukawadd6f6072020-11-03 22:08:57 +0900188; CHECK-NEXT: or %s0, 16, (0)1
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900189; CHECK-NEXT: or %s3, 0, (0)1
190; CHECK-NEXT: bsic %s10, (, %s12)
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900191; CHECK-NEXT: ld %s1, 248(, %s11)
192; CHECK-NEXT: ld %s0, 240(, %s11)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900193; CHECK-NEXT: or %s11, 0, %s9
194 %2 = alloca i128, align 16
195 %3 = bitcast i128* %2 to i8*
196 call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %3)
197 %4 = bitcast %"struct.std::__1::atomic.40"* %0 to i8*
198 call void @__atomic_load(i64 16, i8* nonnull %4, i8* nonnull %3, i32 signext 0)
199 %5 = load i128, i128* %2, align 16, !tbaa !2
200 call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %3)
201 ret i128 %5
202}
203
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900204; Function Attrs: nofree nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900205define i128 @_Z24atomic_load_relaxed_u128RNSt3__16atomicIoEE(%"struct.std::__1::atomic.45"* nonnull align 16 dereferenceable(16) %0) {
206; CHECK-LABEL: _Z24atomic_load_relaxed_u128RNSt3__16atomicIoEE:
207; CHECK: .LBB{{[0-9]+}}_2:
208; CHECK-NEXT: or %s1, 0, %s0
209; CHECK-NEXT: lea %s0, __atomic_load@lo
210; CHECK-NEXT: and %s0, %s0, (32)0
211; CHECK-NEXT: lea.sl %s12, __atomic_load@hi(, %s0)
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900212; CHECK-NEXT: lea %s2, 240(, %s11)
Kazushi (Jam) Marukawadd6f6072020-11-03 22:08:57 +0900213; CHECK-NEXT: or %s0, 16, (0)1
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900214; CHECK-NEXT: or %s3, 0, (0)1
215; CHECK-NEXT: bsic %s10, (, %s12)
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900216; CHECK-NEXT: ld %s1, 248(, %s11)
217; CHECK-NEXT: ld %s0, 240(, %s11)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900218; CHECK-NEXT: or %s11, 0, %s9
219 %2 = alloca i128, align 16
220 %3 = bitcast i128* %2 to i8*
221 call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %3)
222 %4 = bitcast %"struct.std::__1::atomic.45"* %0 to i8*
223 call void @__atomic_load(i64 16, i8* nonnull %4, i8* nonnull %3, i32 signext 0)
224 %5 = load i128, i128* %2, align 16, !tbaa !2
225 call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %3)
226 ret i128 %5
227}
228
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900229; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900230define zeroext i1 @_Z22atomic_load_acquire_i1RNSt3__16atomicIbEE(%"struct.std::__1::atomic"* nocapture nonnull readonly align 1 dereferenceable(1) %0) {
231; CHECK-LABEL: _Z22atomic_load_acquire_i1RNSt3__16atomicIbEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900232; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900233; CHECK-NEXT: ld1b.zx %s0, (, %s0)
234; CHECK-NEXT: and %s0, 1, %s0
235; CHECK-NEXT: fencem 2
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900236; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900237 %2 = getelementptr inbounds %"struct.std::__1::atomic", %"struct.std::__1::atomic"* %0, i64 0, i32 0, i32 0, i32 0, i32 0
238 %3 = load atomic i8, i8* %2 acquire, align 1
239 %4 = and i8 %3, 1
240 %5 = icmp ne i8 %4, 0
241 ret i1 %5
242}
243
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900244; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900245define signext i8 @_Z22atomic_load_acquire_i8RNSt3__16atomicIcEE(%"struct.std::__1::atomic.0"* nocapture nonnull readonly align 1 dereferenceable(1) %0) {
246; CHECK-LABEL: _Z22atomic_load_acquire_i8RNSt3__16atomicIcEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900247; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900248; CHECK-NEXT: ld1b.sx %s0, (, %s0)
249; CHECK-NEXT: fencem 2
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900250; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900251 %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
252 %3 = load atomic i8, i8* %2 acquire, align 1
253 ret i8 %3
254}
255
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900256; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900257define zeroext i8 @_Z22atomic_load_acquire_u8RNSt3__16atomicIhEE(%"struct.std::__1::atomic.5"* nocapture nonnull readonly align 1 dereferenceable(1) %0) {
258; CHECK-LABEL: _Z22atomic_load_acquire_u8RNSt3__16atomicIhEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900259; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900260; CHECK-NEXT: ld1b.zx %s0, (, %s0)
261; CHECK-NEXT: fencem 2
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900262; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900263 %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
264 %3 = load atomic i8, i8* %2 acquire, align 1
265 ret i8 %3
266}
267
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900268; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900269define signext i16 @_Z23atomic_load_acquire_i16RNSt3__16atomicIsEE(%"struct.std::__1::atomic.10"* nocapture nonnull readonly align 2 dereferenceable(2) %0) {
270; CHECK-LABEL: _Z23atomic_load_acquire_i16RNSt3__16atomicIsEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900271; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900272; CHECK-NEXT: ld2b.sx %s0, (, %s0)
273; CHECK-NEXT: fencem 2
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900274; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900275 %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
276 %3 = load atomic i16, i16* %2 acquire, align 2
277 ret i16 %3
278}
279
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900280; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900281define zeroext i16 @_Z23atomic_load_acquire_u16RNSt3__16atomicItEE(%"struct.std::__1::atomic.15"* nocapture nonnull readonly align 2 dereferenceable(2) %0) {
282; CHECK-LABEL: _Z23atomic_load_acquire_u16RNSt3__16atomicItEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900283; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900284; CHECK-NEXT: ld2b.zx %s0, (, %s0)
285; CHECK-NEXT: fencem 2
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900286; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900287 %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
288 %3 = load atomic i16, i16* %2 acquire, align 2
289 ret i16 %3
290}
291
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900292; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900293define signext i32 @_Z23atomic_load_acquire_i32RNSt3__16atomicIiEE(%"struct.std::__1::atomic.20"* nocapture nonnull readonly align 4 dereferenceable(4) %0) {
294; CHECK-LABEL: _Z23atomic_load_acquire_i32RNSt3__16atomicIiEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900295; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900296; CHECK-NEXT: ldl.sx %s0, (, %s0)
297; CHECK-NEXT: fencem 2
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900298; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900299 %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
300 %3 = load atomic i32, i32* %2 acquire, align 4
301 ret i32 %3
302}
303
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900304; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900305define zeroext i32 @_Z23atomic_load_acquire_u32RNSt3__16atomicIjEE(%"struct.std::__1::atomic.25"* nocapture nonnull readonly align 4 dereferenceable(4) %0) {
306; CHECK-LABEL: _Z23atomic_load_acquire_u32RNSt3__16atomicIjEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900307; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900308; CHECK-NEXT: ldl.zx %s0, (, %s0)
309; CHECK-NEXT: fencem 2
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900310; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900311 %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
312 %3 = load atomic i32, i32* %2 acquire, align 4
313 ret i32 %3
314}
315
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900316; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900317define i64 @_Z23atomic_load_acquire_i64RNSt3__16atomicIlEE(%"struct.std::__1::atomic.30"* nocapture nonnull readonly align 8 dereferenceable(8) %0) {
318; CHECK-LABEL: _Z23atomic_load_acquire_i64RNSt3__16atomicIlEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900319; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900320; CHECK-NEXT: ld %s0, (, %s0)
321; CHECK-NEXT: fencem 2
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900322; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900323 %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
324 %3 = load atomic i64, i64* %2 acquire, align 8
325 ret i64 %3
326}
327
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900328; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900329define i64 @_Z23atomic_load_acquire_u64RNSt3__16atomicImEE(%"struct.std::__1::atomic.35"* nocapture nonnull readonly align 8 dereferenceable(8) %0) {
330; CHECK-LABEL: _Z23atomic_load_acquire_u64RNSt3__16atomicImEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900331; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900332; CHECK-NEXT: ld %s0, (, %s0)
333; CHECK-NEXT: fencem 2
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900334; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900335 %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
336 %3 = load atomic i64, i64* %2 acquire, align 8
337 ret i64 %3
338}
339
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900340; Function Attrs: nofree nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900341define i128 @_Z24atomic_load_acquire_i128RNSt3__16atomicInEE(%"struct.std::__1::atomic.40"* nonnull align 16 dereferenceable(16) %0) {
342; CHECK-LABEL: _Z24atomic_load_acquire_i128RNSt3__16atomicInEE:
343; CHECK: .LBB{{[0-9]+}}_2:
344; CHECK-NEXT: or %s1, 0, %s0
345; CHECK-NEXT: lea %s0, __atomic_load@lo
346; CHECK-NEXT: and %s0, %s0, (32)0
347; CHECK-NEXT: lea.sl %s12, __atomic_load@hi(, %s0)
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900348; CHECK-NEXT: lea %s2, 240(, %s11)
Kazushi (Jam) Marukawadd6f6072020-11-03 22:08:57 +0900349; CHECK-NEXT: or %s0, 16, (0)1
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900350; CHECK-NEXT: or %s3, 2, (0)1
351; CHECK-NEXT: bsic %s10, (, %s12)
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900352; CHECK-NEXT: ld %s1, 248(, %s11)
353; CHECK-NEXT: ld %s0, 240(, %s11)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900354; CHECK-NEXT: or %s11, 0, %s9
355 %2 = alloca i128, align 16
356 %3 = bitcast i128* %2 to i8*
357 call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %3)
358 %4 = bitcast %"struct.std::__1::atomic.40"* %0 to i8*
359 call void @__atomic_load(i64 16, i8* nonnull %4, i8* nonnull %3, i32 signext 2)
360 %5 = load i128, i128* %2, align 16, !tbaa !2
361 call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %3)
362 ret i128 %5
363}
364
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900365; Function Attrs: nofree nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900366define i128 @_Z24atomic_load_acquire_u128RNSt3__16atomicIoEE(%"struct.std::__1::atomic.45"* nonnull align 16 dereferenceable(16) %0) {
367; CHECK-LABEL: _Z24atomic_load_acquire_u128RNSt3__16atomicIoEE:
368; CHECK: .LBB{{[0-9]+}}_2:
369; CHECK-NEXT: or %s1, 0, %s0
370; CHECK-NEXT: lea %s0, __atomic_load@lo
371; CHECK-NEXT: and %s0, %s0, (32)0
372; CHECK-NEXT: lea.sl %s12, __atomic_load@hi(, %s0)
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900373; CHECK-NEXT: lea %s2, 240(, %s11)
Kazushi (Jam) Marukawadd6f6072020-11-03 22:08:57 +0900374; CHECK-NEXT: or %s0, 16, (0)1
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900375; CHECK-NEXT: or %s3, 2, (0)1
376; CHECK-NEXT: bsic %s10, (, %s12)
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900377; CHECK-NEXT: ld %s1, 248(, %s11)
378; CHECK-NEXT: ld %s0, 240(, %s11)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900379; CHECK-NEXT: or %s11, 0, %s9
380 %2 = alloca i128, align 16
381 %3 = bitcast i128* %2 to i8*
382 call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %3)
383 %4 = bitcast %"struct.std::__1::atomic.45"* %0 to i8*
384 call void @__atomic_load(i64 16, i8* nonnull %4, i8* nonnull %3, i32 signext 2)
385 %5 = load i128, i128* %2, align 16, !tbaa !2
386 call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %3)
387 ret i128 %5
388}
389
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900390; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900391define zeroext i1 @_Z22atomic_load_seq_cst_i1RNSt3__16atomicIbEE(%"struct.std::__1::atomic"* nocapture nonnull readonly align 1 dereferenceable(1) %0) {
392; CHECK-LABEL: _Z22atomic_load_seq_cst_i1RNSt3__16atomicIbEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900393; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900394; CHECK-NEXT: ld1b.zx %s0, (, %s0)
395; CHECK-NEXT: and %s0, 1, %s0
396; CHECK-NEXT: fencem 3
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900397; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900398 %2 = getelementptr inbounds %"struct.std::__1::atomic", %"struct.std::__1::atomic"* %0, i64 0, i32 0, i32 0, i32 0, i32 0
399 %3 = load atomic i8, i8* %2 seq_cst, align 1
400 %4 = and i8 %3, 1
401 %5 = icmp ne i8 %4, 0
402 ret i1 %5
403}
404
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900405; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900406define signext i8 @_Z22atomic_load_seq_cst_i8RNSt3__16atomicIcEE(%"struct.std::__1::atomic.0"* nocapture nonnull readonly align 1 dereferenceable(1) %0) {
407; CHECK-LABEL: _Z22atomic_load_seq_cst_i8RNSt3__16atomicIcEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900408; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900409; CHECK-NEXT: ld1b.sx %s0, (, %s0)
410; CHECK-NEXT: fencem 3
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900411; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900412 %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
413 %3 = load atomic i8, i8* %2 seq_cst, align 1
414 ret i8 %3
415}
416
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900417; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900418define zeroext i8 @_Z22atomic_load_seq_cst_u8RNSt3__16atomicIhEE(%"struct.std::__1::atomic.5"* nocapture nonnull readonly align 1 dereferenceable(1) %0) {
419; CHECK-LABEL: _Z22atomic_load_seq_cst_u8RNSt3__16atomicIhEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900420; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900421; CHECK-NEXT: ld1b.zx %s0, (, %s0)
422; CHECK-NEXT: fencem 3
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900423; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900424 %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
425 %3 = load atomic i8, i8* %2 seq_cst, align 1
426 ret i8 %3
427}
428
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900429; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900430define signext i16 @_Z23atomic_load_seq_cst_i16RNSt3__16atomicIsEE(%"struct.std::__1::atomic.10"* nocapture nonnull readonly align 2 dereferenceable(2) %0) {
431; CHECK-LABEL: _Z23atomic_load_seq_cst_i16RNSt3__16atomicIsEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900432; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900433; CHECK-NEXT: ld2b.sx %s0, (, %s0)
434; CHECK-NEXT: fencem 3
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900435; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900436 %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
437 %3 = load atomic i16, i16* %2 seq_cst, align 2
438 ret i16 %3
439}
440
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900441; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900442define zeroext i16 @_Z23atomic_load_seq_cst_u16RNSt3__16atomicItEE(%"struct.std::__1::atomic.15"* nocapture nonnull readonly align 2 dereferenceable(2) %0) {
443; CHECK-LABEL: _Z23atomic_load_seq_cst_u16RNSt3__16atomicItEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900444; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900445; CHECK-NEXT: ld2b.zx %s0, (, %s0)
446; CHECK-NEXT: fencem 3
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900447; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900448 %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
449 %3 = load atomic i16, i16* %2 seq_cst, align 2
450 ret i16 %3
451}
452
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900453; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900454define signext i32 @_Z23atomic_load_seq_cst_i32RNSt3__16atomicIiEE(%"struct.std::__1::atomic.20"* nocapture nonnull readonly align 4 dereferenceable(4) %0) {
455; CHECK-LABEL: _Z23atomic_load_seq_cst_i32RNSt3__16atomicIiEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900456; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900457; CHECK-NEXT: ldl.sx %s0, (, %s0)
458; CHECK-NEXT: fencem 3
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900459; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900460 %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
461 %3 = load atomic i32, i32* %2 seq_cst, align 4
462 ret i32 %3
463}
464
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900465; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900466define zeroext i32 @_Z23atomic_load_seq_cst_u32RNSt3__16atomicIjEE(%"struct.std::__1::atomic.25"* nocapture nonnull readonly align 4 dereferenceable(4) %0) {
467; CHECK-LABEL: _Z23atomic_load_seq_cst_u32RNSt3__16atomicIjEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900468; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900469; CHECK-NEXT: ldl.zx %s0, (, %s0)
470; CHECK-NEXT: fencem 3
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900471; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900472 %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
473 %3 = load atomic i32, i32* %2 seq_cst, align 4
474 ret i32 %3
475}
476
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900477; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900478define i64 @_Z23atomic_load_seq_cst_i64RNSt3__16atomicIlEE(%"struct.std::__1::atomic.30"* nocapture nonnull readonly align 8 dereferenceable(8) %0) {
479; CHECK-LABEL: _Z23atomic_load_seq_cst_i64RNSt3__16atomicIlEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900480; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900481; CHECK-NEXT: ld %s0, (, %s0)
482; CHECK-NEXT: fencem 3
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900483; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900484 %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
485 %3 = load atomic i64, i64* %2 seq_cst, align 8
486 ret i64 %3
487}
488
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900489; Function Attrs: nofree norecurse nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900490define i64 @_Z23atomic_load_seq_cst_u64RNSt3__16atomicImEE(%"struct.std::__1::atomic.35"* nocapture nonnull readonly align 8 dereferenceable(8) %0) {
491; CHECK-LABEL: _Z23atomic_load_seq_cst_u64RNSt3__16atomicImEE:
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900492; CHECK: # %bb.0:
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900493; CHECK-NEXT: ld %s0, (, %s0)
494; CHECK-NEXT: fencem 3
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900495; CHECK-NEXT: b.l.t (, %s10)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900496 %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
497 %3 = load atomic i64, i64* %2 seq_cst, align 8
498 ret i64 %3
499}
500
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900501; Function Attrs: nofree nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900502define i128 @_Z24atomic_load_seq_cst_i128RNSt3__16atomicInEE(%"struct.std::__1::atomic.40"* nonnull align 16 dereferenceable(16) %0) {
503; CHECK-LABEL: _Z24atomic_load_seq_cst_i128RNSt3__16atomicInEE:
504; CHECK: .LBB{{[0-9]+}}_2:
505; CHECK-NEXT: or %s1, 0, %s0
506; CHECK-NEXT: lea %s0, __atomic_load@lo
507; CHECK-NEXT: and %s0, %s0, (32)0
508; CHECK-NEXT: lea.sl %s12, __atomic_load@hi(, %s0)
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900509; CHECK-NEXT: lea %s2, 240(, %s11)
Kazushi (Jam) Marukawadd6f6072020-11-03 22:08:57 +0900510; CHECK-NEXT: or %s0, 16, (0)1
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900511; CHECK-NEXT: or %s3, 5, (0)1
512; CHECK-NEXT: bsic %s10, (, %s12)
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900513; CHECK-NEXT: ld %s1, 248(, %s11)
514; CHECK-NEXT: ld %s0, 240(, %s11)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900515; CHECK-NEXT: or %s11, 0, %s9
516 %2 = alloca i128, align 16
517 %3 = bitcast i128* %2 to i8*
518 call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %3)
519 %4 = bitcast %"struct.std::__1::atomic.40"* %0 to i8*
520 call void @__atomic_load(i64 16, i8* nonnull %4, i8* nonnull %3, i32 signext 5)
521 %5 = load i128, i128* %2, align 16, !tbaa !2
522 call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %3)
523 ret i128 %5
524}
525
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900526; Function Attrs: nofree nounwind mustprogress
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900527define i128 @_Z24atomic_load_seq_cst_u128RNSt3__16atomicIoEE(%"struct.std::__1::atomic.45"* nonnull align 16 dereferenceable(16) %0) {
528; CHECK-LABEL: _Z24atomic_load_seq_cst_u128RNSt3__16atomicIoEE:
529; CHECK: .LBB{{[0-9]+}}_2:
530; CHECK-NEXT: or %s1, 0, %s0
531; CHECK-NEXT: lea %s0, __atomic_load@lo
532; CHECK-NEXT: and %s0, %s0, (32)0
533; CHECK-NEXT: lea.sl %s12, __atomic_load@hi(, %s0)
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900534; CHECK-NEXT: lea %s2, 240(, %s11)
Kazushi (Jam) Marukawadd6f6072020-11-03 22:08:57 +0900535; CHECK-NEXT: or %s0, 16, (0)1
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900536; CHECK-NEXT: or %s3, 5, (0)1
537; CHECK-NEXT: bsic %s10, (, %s12)
Kazushi (Jam) Marukawa44a4f932020-11-15 10:08:10 +0900538; CHECK-NEXT: ld %s1, 248(, %s11)
539; CHECK-NEXT: ld %s0, 240(, %s11)
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900540; CHECK-NEXT: or %s11, 0, %s9
541 %2 = alloca i128, align 16
542 %3 = bitcast i128* %2 to i8*
543 call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %3)
544 %4 = bitcast %"struct.std::__1::atomic.45"* %0 to i8*
545 call void @__atomic_load(i64 16, i8* nonnull %4, i8* nonnull %3, i32 signext 5)
546 %5 = load i128, i128* %2, align 16, !tbaa !2
547 call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %3)
548 ret i128 %5
549}
550
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900551; Function Attrs: mustprogress
552define zeroext i1 @_Z26atomic_load_relaxed_stk_i1v() {
553; CHECK-LABEL: _Z26atomic_load_relaxed_stk_i1v:
554; CHECK: .LBB{{[0-9]+}}_2:
555; CHECK-NEXT: lea %s0, _Z6fun_i1RNSt3__16atomicIbEE@lo
556; CHECK-NEXT: and %s0, %s0, (32)0
557; CHECK-NEXT: lea.sl %s12, _Z6fun_i1RNSt3__16atomicIbEE@hi(, %s0)
558; CHECK-NEXT: lea %s0, 248(, %s11)
559; CHECK-NEXT: bsic %s10, (, %s12)
560; CHECK-NEXT: ld1b.zx %s0, 248(, %s11)
561; CHECK-NEXT: and %s0, 1, %s0
562; CHECK-NEXT: or %s11, 0, %s9
563 %1 = alloca %"struct.std::__1::atomic", align 1
564 %2 = getelementptr inbounds %"struct.std::__1::atomic", %"struct.std::__1::atomic"* %1, i64 0, i32 0, i32 0, i32 0, i32 0
565 call void @llvm.lifetime.start.p0i8(i64 1, i8* nonnull %2)
566 call void @_Z6fun_i1RNSt3__16atomicIbEE(%"struct.std::__1::atomic"* nonnull align 1 dereferenceable(1) %1)
567 %3 = load atomic i8, i8* %2 monotonic, align 1
568 %4 = and i8 %3, 1
569 %5 = icmp ne i8 %4, 0
570 call void @llvm.lifetime.end.p0i8(i64 1, i8* nonnull %2)
571 ret i1 %5
572}
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900573
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900574; Function Attrs: argmemonly nofree nosync nounwind willreturn
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900575declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture)
576
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900577declare void @_Z6fun_i1RNSt3__16atomicIbEE(%"struct.std::__1::atomic"* nonnull align 1 dereferenceable(1))
578
579; Function Attrs: argmemonly nofree nosync nounwind willreturn
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +0900580declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture)
581
Kazushi (Jam) Marukawaa2eb07a2020-12-12 12:27:32 +0900582; Function Attrs: mustprogress
583define signext i8 @_Z26atomic_load_relaxed_stk_i8v() {
584; CHECK-LABEL: _Z26atomic_load_relaxed_stk_i8v:
585; CHECK: .LBB{{[0-9]+}}_2:
586; CHECK-NEXT: lea %s0, _Z6fun_i8RNSt3__16atomicIcEE@lo
587; CHECK-NEXT: and %s0, %s0, (32)0
588; CHECK-NEXT: lea.sl %s12, _Z6fun_i8RNSt3__16atomicIcEE@hi(, %s0)
589; CHECK-NEXT: lea %s0, 248(, %s11)
590; CHECK-NEXT: bsic %s10, (, %s12)
591; CHECK-NEXT: ld1b.sx %s0, 248(, %s11)
592; CHECK-NEXT: or %s11, 0, %s9
593 %1 = alloca %"struct.std::__1::atomic.0", align 1
594 %2 = getelementptr inbounds %"struct.std::__1::atomic.0", %"struct.std::__1::atomic.0"* %1, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
595 call void @llvm.lifetime.start.p0i8(i64 1, i8* nonnull %2)
596 call void @_Z6fun_i8RNSt3__16atomicIcEE(%"struct.std::__1::atomic.0"* nonnull align 1 dereferenceable(1) %1)
597 %3 = load atomic i8, i8* %2 monotonic, align 1
598 call void @llvm.lifetime.end.p0i8(i64 1, i8* nonnull %2)
599 ret i8 %3
600}
601
602declare void @_Z6fun_i8RNSt3__16atomicIcEE(%"struct.std::__1::atomic.0"* nonnull align 1 dereferenceable(1))
603
604; Function Attrs: mustprogress
605define zeroext i8 @_Z26atomic_load_relaxed_stk_u8v() {
606; CHECK-LABEL: _Z26atomic_load_relaxed_stk_u8v:
607; CHECK: .LBB{{[0-9]+}}_2:
608; CHECK-NEXT: lea %s0, _Z6fun_u8RNSt3__16atomicIhEE@lo
609; CHECK-NEXT: and %s0, %s0, (32)0
610; CHECK-NEXT: lea.sl %s12, _Z6fun_u8RNSt3__16atomicIhEE@hi(, %s0)
611; CHECK-NEXT: lea %s0, 248(, %s11)
612; CHECK-NEXT: bsic %s10, (, %s12)
613; CHECK-NEXT: ld1b.zx %s0, 248(, %s11)
614; CHECK-NEXT: or %s11, 0, %s9
615 %1 = alloca %"struct.std::__1::atomic.5", align 1
616 %2 = getelementptr inbounds %"struct.std::__1::atomic.5", %"struct.std::__1::atomic.5"* %1, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
617 call void @llvm.lifetime.start.p0i8(i64 1, i8* nonnull %2)
618 call void @_Z6fun_u8RNSt3__16atomicIhEE(%"struct.std::__1::atomic.5"* nonnull align 1 dereferenceable(1) %1)
619 %3 = load atomic i8, i8* %2 monotonic, align 1
620 call void @llvm.lifetime.end.p0i8(i64 1, i8* nonnull %2)
621 ret i8 %3
622}
623
624declare void @_Z6fun_u8RNSt3__16atomicIhEE(%"struct.std::__1::atomic.5"* nonnull align 1 dereferenceable(1))
625
626; Function Attrs: mustprogress
627define signext i16 @_Z27atomic_load_relaxed_stk_i16v() {
628; CHECK-LABEL: _Z27atomic_load_relaxed_stk_i16v:
629; CHECK: .LBB{{[0-9]+}}_2:
630; CHECK-NEXT: lea %s0, _Z7fun_i16RNSt3__16atomicIsEE@lo
631; CHECK-NEXT: and %s0, %s0, (32)0
632; CHECK-NEXT: lea.sl %s12, _Z7fun_i16RNSt3__16atomicIsEE@hi(, %s0)
633; CHECK-NEXT: lea %s0, 248(, %s11)
634; CHECK-NEXT: bsic %s10, (, %s12)
635; CHECK-NEXT: ld2b.sx %s0, 248(, %s11)
636; CHECK-NEXT: or %s11, 0, %s9
637 %1 = alloca %"struct.std::__1::atomic.10", align 2
638 %2 = bitcast %"struct.std::__1::atomic.10"* %1 to i8*
639 call void @llvm.lifetime.start.p0i8(i64 2, i8* nonnull %2)
640 call void @_Z7fun_i16RNSt3__16atomicIsEE(%"struct.std::__1::atomic.10"* nonnull align 2 dereferenceable(2) %1)
641 %3 = getelementptr inbounds %"struct.std::__1::atomic.10", %"struct.std::__1::atomic.10"* %1, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
642 %4 = load atomic i16, i16* %3 monotonic, align 2
643 call void @llvm.lifetime.end.p0i8(i64 2, i8* nonnull %2)
644 ret i16 %4
645}
646
647declare void @_Z7fun_i16RNSt3__16atomicIsEE(%"struct.std::__1::atomic.10"* nonnull align 2 dereferenceable(2))
648
649; Function Attrs: mustprogress
650define zeroext i16 @_Z27atomic_load_relaxed_stk_u16v() {
651; CHECK-LABEL: _Z27atomic_load_relaxed_stk_u16v:
652; CHECK: .LBB{{[0-9]+}}_2:
653; CHECK-NEXT: lea %s0, _Z7fun_u16RNSt3__16atomicItEE@lo
654; CHECK-NEXT: and %s0, %s0, (32)0
655; CHECK-NEXT: lea.sl %s12, _Z7fun_u16RNSt3__16atomicItEE@hi(, %s0)
656; CHECK-NEXT: lea %s0, 248(, %s11)
657; CHECK-NEXT: bsic %s10, (, %s12)
658; CHECK-NEXT: ld2b.zx %s0, 248(, %s11)
659; CHECK-NEXT: or %s11, 0, %s9
660 %1 = alloca %"struct.std::__1::atomic.15", align 2
661 %2 = bitcast %"struct.std::__1::atomic.15"* %1 to i8*
662 call void @llvm.lifetime.start.p0i8(i64 2, i8* nonnull %2)
663 call void @_Z7fun_u16RNSt3__16atomicItEE(%"struct.std::__1::atomic.15"* nonnull align 2 dereferenceable(2) %1)
664 %3 = getelementptr inbounds %"struct.std::__1::atomic.15", %"struct.std::__1::atomic.15"* %1, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
665 %4 = load atomic i16, i16* %3 monotonic, align 2
666 call void @llvm.lifetime.end.p0i8(i64 2, i8* nonnull %2)
667 ret i16 %4
668}
669
670declare void @_Z7fun_u16RNSt3__16atomicItEE(%"struct.std::__1::atomic.15"* nonnull align 2 dereferenceable(2))
671
672; Function Attrs: mustprogress
673define signext i32 @_Z27atomic_load_relaxed_stk_i32v() {
674; CHECK-LABEL: _Z27atomic_load_relaxed_stk_i32v:
675; CHECK: .LBB{{[0-9]+}}_2:
676; CHECK-NEXT: lea %s0, _Z7fun_i32RNSt3__16atomicIiEE@lo
677; CHECK-NEXT: and %s0, %s0, (32)0
678; CHECK-NEXT: lea.sl %s12, _Z7fun_i32RNSt3__16atomicIiEE@hi(, %s0)
679; CHECK-NEXT: lea %s0, 248(, %s11)
680; CHECK-NEXT: bsic %s10, (, %s12)
681; CHECK-NEXT: ldl.sx %s0, 248(, %s11)
682; CHECK-NEXT: or %s11, 0, %s9
683 %1 = alloca %"struct.std::__1::atomic.20", align 4
684 %2 = bitcast %"struct.std::__1::atomic.20"* %1 to i8*
685 call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %2)
686 call void @_Z7fun_i32RNSt3__16atomicIiEE(%"struct.std::__1::atomic.20"* nonnull align 4 dereferenceable(4) %1)
687 %3 = getelementptr inbounds %"struct.std::__1::atomic.20", %"struct.std::__1::atomic.20"* %1, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
688 %4 = load atomic i32, i32* %3 monotonic, align 4
689 call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %2)
690 ret i32 %4
691}
692
693declare void @_Z7fun_i32RNSt3__16atomicIiEE(%"struct.std::__1::atomic.20"* nonnull align 4 dereferenceable(4))
694
695; Function Attrs: mustprogress
696define zeroext i32 @_Z27atomic_load_relaxed_stk_u32v() {
697; CHECK-LABEL: _Z27atomic_load_relaxed_stk_u32v:
698; CHECK: .LBB{{[0-9]+}}_2:
699; CHECK-NEXT: lea %s0, _Z7fun_u32RNSt3__16atomicIjEE@lo
700; CHECK-NEXT: and %s0, %s0, (32)0
701; CHECK-NEXT: lea.sl %s12, _Z7fun_u32RNSt3__16atomicIjEE@hi(, %s0)
702; CHECK-NEXT: lea %s0, 248(, %s11)
703; CHECK-NEXT: bsic %s10, (, %s12)
704; CHECK-NEXT: ldl.zx %s0, 248(, %s11)
705; CHECK-NEXT: or %s11, 0, %s9
706 %1 = alloca %"struct.std::__1::atomic.25", align 4
707 %2 = bitcast %"struct.std::__1::atomic.25"* %1 to i8*
708 call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %2)
709 call void @_Z7fun_u32RNSt3__16atomicIjEE(%"struct.std::__1::atomic.25"* nonnull align 4 dereferenceable(4) %1)
710 %3 = getelementptr inbounds %"struct.std::__1::atomic.25", %"struct.std::__1::atomic.25"* %1, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
711 %4 = load atomic i32, i32* %3 monotonic, align 4
712 call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %2)
713 ret i32 %4
714}
715
716declare void @_Z7fun_u32RNSt3__16atomicIjEE(%"struct.std::__1::atomic.25"* nonnull align 4 dereferenceable(4))
717
718; Function Attrs: mustprogress
719define i64 @_Z27atomic_load_relaxed_stk_i64v() {
720; CHECK-LABEL: _Z27atomic_load_relaxed_stk_i64v:
721; CHECK: .LBB{{[0-9]+}}_2:
722; CHECK-NEXT: lea %s0, _Z7fun_i64RNSt3__16atomicIlEE@lo
723; CHECK-NEXT: and %s0, %s0, (32)0
724; CHECK-NEXT: lea.sl %s12, _Z7fun_i64RNSt3__16atomicIlEE@hi(, %s0)
725; CHECK-NEXT: lea %s0, 248(, %s11)
726; CHECK-NEXT: bsic %s10, (, %s12)
727; CHECK-NEXT: ld %s0, 248(, %s11)
728; CHECK-NEXT: or %s11, 0, %s9
729 %1 = alloca %"struct.std::__1::atomic.30", align 8
730 %2 = bitcast %"struct.std::__1::atomic.30"* %1 to i8*
731 call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull %2)
732 call void @_Z7fun_i64RNSt3__16atomicIlEE(%"struct.std::__1::atomic.30"* nonnull align 8 dereferenceable(8) %1)
733 %3 = getelementptr inbounds %"struct.std::__1::atomic.30", %"struct.std::__1::atomic.30"* %1, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
734 %4 = load atomic i64, i64* %3 monotonic, align 8
735 call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %2)
736 ret i64 %4
737}
738
739declare void @_Z7fun_i64RNSt3__16atomicIlEE(%"struct.std::__1::atomic.30"* nonnull align 8 dereferenceable(8))
740
741; Function Attrs: mustprogress
742define i64 @_Z27atomic_load_relaxed_stk_u64v() {
743; CHECK-LABEL: _Z27atomic_load_relaxed_stk_u64v:
744; CHECK: .LBB{{[0-9]+}}_2:
745; CHECK-NEXT: lea %s0, _Z7fun_u64RNSt3__16atomicImEE@lo
746; CHECK-NEXT: and %s0, %s0, (32)0
747; CHECK-NEXT: lea.sl %s12, _Z7fun_u64RNSt3__16atomicImEE@hi(, %s0)
748; CHECK-NEXT: lea %s0, 248(, %s11)
749; CHECK-NEXT: bsic %s10, (, %s12)
750; CHECK-NEXT: ld %s0, 248(, %s11)
751; CHECK-NEXT: or %s11, 0, %s9
752 %1 = alloca %"struct.std::__1::atomic.35", align 8
753 %2 = bitcast %"struct.std::__1::atomic.35"* %1 to i8*
754 call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull %2)
755 call void @_Z7fun_u64RNSt3__16atomicImEE(%"struct.std::__1::atomic.35"* nonnull align 8 dereferenceable(8) %1)
756 %3 = getelementptr inbounds %"struct.std::__1::atomic.35", %"struct.std::__1::atomic.35"* %1, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
757 %4 = load atomic i64, i64* %3 monotonic, align 8
758 call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %2)
759 ret i64 %4
760}
761
762declare void @_Z7fun_u64RNSt3__16atomicImEE(%"struct.std::__1::atomic.35"* nonnull align 8 dereferenceable(8))
763
764; Function Attrs: mustprogress
765define i128 @_Z28atomic_load_relaxed_stk_i128v() {
766; CHECK-LABEL: _Z28atomic_load_relaxed_stk_i128v:
767; CHECK: .LBB{{[0-9]+}}_2:
768; CHECK-NEXT: lea %s0, _Z8fun_i128RNSt3__16atomicInEE@lo
769; CHECK-NEXT: and %s0, %s0, (32)0
770; CHECK-NEXT: lea.sl %s12, _Z8fun_i128RNSt3__16atomicInEE@hi(, %s0)
771; CHECK-NEXT: lea %s0, 240(, %s11)
772; CHECK-NEXT: bsic %s10, (, %s12)
773; CHECK-NEXT: lea %s0, __atomic_load@lo
774; CHECK-NEXT: and %s0, %s0, (32)0
775; CHECK-NEXT: lea.sl %s12, __atomic_load@hi(, %s0)
776; CHECK-NEXT: lea %s1, 240(, %s11)
777; CHECK-NEXT: lea %s2, 256(, %s11)
778; CHECK-NEXT: or %s0, 16, (0)1
779; CHECK-NEXT: or %s3, 0, (0)1
780; CHECK-NEXT: bsic %s10, (, %s12)
781; CHECK-NEXT: ld %s1, 264(, %s11)
782; CHECK-NEXT: ld %s0, 256(, %s11)
783; CHECK-NEXT: or %s11, 0, %s9
784 %1 = alloca i128, align 16
785 %2 = alloca %"struct.std::__1::atomic.40", align 16
786 %3 = bitcast %"struct.std::__1::atomic.40"* %2 to i8*
787 call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %3)
788 call void @_Z8fun_i128RNSt3__16atomicInEE(%"struct.std::__1::atomic.40"* nonnull align 16 dereferenceable(16) %2)
789 %4 = bitcast i128* %1 to i8*
790 call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %4)
791 call void @__atomic_load(i64 16, i8* nonnull %3, i8* nonnull %4, i32 signext 0)
792 %5 = load i128, i128* %1, align 16, !tbaa !2
793 call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %4)
794 call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %3)
795 ret i128 %5
796}
797
798declare void @_Z8fun_i128RNSt3__16atomicInEE(%"struct.std::__1::atomic.40"* nonnull align 16 dereferenceable(16))
799
800; Function Attrs: mustprogress
801define i128 @_Z28atomic_load_relaxed_stk_u128v() {
802; CHECK-LABEL: _Z28atomic_load_relaxed_stk_u128v:
803; CHECK: .LBB{{[0-9]+}}_2:
804; CHECK-NEXT: lea %s0, _Z8fun_u128RNSt3__16atomicIoEE@lo
805; CHECK-NEXT: and %s0, %s0, (32)0
806; CHECK-NEXT: lea.sl %s12, _Z8fun_u128RNSt3__16atomicIoEE@hi(, %s0)
807; CHECK-NEXT: lea %s0, 240(, %s11)
808; CHECK-NEXT: bsic %s10, (, %s12)
809; CHECK-NEXT: lea %s0, __atomic_load@lo
810; CHECK-NEXT: and %s0, %s0, (32)0
811; CHECK-NEXT: lea.sl %s12, __atomic_load@hi(, %s0)
812; CHECK-NEXT: lea %s1, 240(, %s11)
813; CHECK-NEXT: lea %s2, 256(, %s11)
814; CHECK-NEXT: or %s0, 16, (0)1
815; CHECK-NEXT: or %s3, 0, (0)1
816; CHECK-NEXT: bsic %s10, (, %s12)
817; CHECK-NEXT: ld %s1, 264(, %s11)
818; CHECK-NEXT: ld %s0, 256(, %s11)
819; CHECK-NEXT: or %s11, 0, %s9
820 %1 = alloca i128, align 16
821 %2 = alloca %"struct.std::__1::atomic.45", align 16
822 %3 = bitcast %"struct.std::__1::atomic.45"* %2 to i8*
823 call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %3)
824 call void @_Z8fun_u128RNSt3__16atomicIoEE(%"struct.std::__1::atomic.45"* nonnull align 16 dereferenceable(16) %2)
825 %4 = bitcast i128* %1 to i8*
826 call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %4)
827 call void @__atomic_load(i64 16, i8* nonnull %3, i8* nonnull %4, i32 signext 0)
828 %5 = load i128, i128* %1, align 16, !tbaa !2
829 call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %4)
830 call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %3)
831 ret i128 %5
832}
833
834declare void @_Z8fun_u128RNSt3__16atomicIoEE(%"struct.std::__1::atomic.45"* nonnull align 16 dereferenceable(16))
835
836; Function Attrs: nofree norecurse nounwind mustprogress
837define zeroext i1 @_Z25atomic_load_relaxed_gv_i1v() {
838; CHECK-LABEL: _Z25atomic_load_relaxed_gv_i1v:
839; CHECK: # %bb.0:
840; CHECK-NEXT: lea %s0, gv_i1@lo
841; CHECK-NEXT: and %s0, %s0, (32)0
842; CHECK-NEXT: lea.sl %s0, gv_i1@hi(, %s0)
843; CHECK-NEXT: ld1b.zx %s0, (, %s0)
844; CHECK-NEXT: and %s0, 1, %s0
845; CHECK-NEXT: b.l.t (, %s10)
846 %1 = load atomic i8, i8* getelementptr inbounds (%"struct.std::__1::atomic", %"struct.std::__1::atomic"* @gv_i1, i64 0, i32 0, i32 0, i32 0, i32 0) monotonic, align 4
847 %2 = and i8 %1, 1
848 %3 = icmp ne i8 %2, 0
849 ret i1 %3
850}
851
852; Function Attrs: nofree norecurse nounwind mustprogress
853define signext i8 @_Z25atomic_load_relaxed_gv_i8v() {
854; CHECK-LABEL: _Z25atomic_load_relaxed_gv_i8v:
855; CHECK: # %bb.0:
856; CHECK-NEXT: lea %s0, gv_i8@lo
857; CHECK-NEXT: and %s0, %s0, (32)0
858; CHECK-NEXT: lea.sl %s0, gv_i8@hi(, %s0)
859; CHECK-NEXT: ld1b.sx %s0, (, %s0)
860; CHECK-NEXT: b.l.t (, %s10)
861 %1 = load atomic i8, i8* getelementptr inbounds (%"struct.std::__1::atomic.0", %"struct.std::__1::atomic.0"* @gv_i8, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0) monotonic, align 4
862 ret i8 %1
863}
864
865; Function Attrs: nofree norecurse nounwind mustprogress
866define zeroext i8 @_Z25atomic_load_relaxed_gv_u8v() {
867; CHECK-LABEL: _Z25atomic_load_relaxed_gv_u8v:
868; CHECK: # %bb.0:
869; CHECK-NEXT: lea %s0, gv_u8@lo
870; CHECK-NEXT: and %s0, %s0, (32)0
871; CHECK-NEXT: lea.sl %s0, gv_u8@hi(, %s0)
872; CHECK-NEXT: ld1b.zx %s0, (, %s0)
873; CHECK-NEXT: b.l.t (, %s10)
874 %1 = load atomic i8, i8* getelementptr inbounds (%"struct.std::__1::atomic.5", %"struct.std::__1::atomic.5"* @gv_u8, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0) monotonic, align 4
875 ret i8 %1
876}
877
878; Function Attrs: nofree norecurse nounwind mustprogress
879define signext i16 @_Z26atomic_load_relaxed_gv_i16v() {
880; CHECK-LABEL: _Z26atomic_load_relaxed_gv_i16v:
881; CHECK: # %bb.0:
882; CHECK-NEXT: lea %s0, gv_i16@lo
883; CHECK-NEXT: and %s0, %s0, (32)0
884; CHECK-NEXT: lea.sl %s0, gv_i16@hi(, %s0)
885; CHECK-NEXT: ld2b.sx %s0, (, %s0)
886; CHECK-NEXT: b.l.t (, %s10)
887 %1 = load atomic i16, i16* getelementptr inbounds (%"struct.std::__1::atomic.10", %"struct.std::__1::atomic.10"* @gv_i16, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0) monotonic, align 4
888 ret i16 %1
889}
890
891; Function Attrs: nofree norecurse nounwind mustprogress
892define zeroext i16 @_Z26atomic_load_relaxed_gv_u16v() {
893; CHECK-LABEL: _Z26atomic_load_relaxed_gv_u16v:
894; CHECK: # %bb.0:
895; CHECK-NEXT: lea %s0, gv_u16@lo
896; CHECK-NEXT: and %s0, %s0, (32)0
897; CHECK-NEXT: lea.sl %s0, gv_u16@hi(, %s0)
898; CHECK-NEXT: ld2b.zx %s0, (, %s0)
899; CHECK-NEXT: b.l.t (, %s10)
900 %1 = load atomic i16, i16* getelementptr inbounds (%"struct.std::__1::atomic.15", %"struct.std::__1::atomic.15"* @gv_u16, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0) monotonic, align 4
901 ret i16 %1
902}
903
904; Function Attrs: nofree norecurse nounwind mustprogress
905define signext i32 @_Z26atomic_load_relaxed_gv_i32v() {
906; CHECK-LABEL: _Z26atomic_load_relaxed_gv_i32v:
907; CHECK: # %bb.0:
908; CHECK-NEXT: lea %s0, gv_i32@lo
909; CHECK-NEXT: and %s0, %s0, (32)0
910; CHECK-NEXT: lea.sl %s0, gv_i32@hi(, %s0)
911; CHECK-NEXT: ldl.sx %s0, (, %s0)
912; CHECK-NEXT: b.l.t (, %s10)
913 %1 = load atomic i32, i32* getelementptr inbounds (%"struct.std::__1::atomic.20", %"struct.std::__1::atomic.20"* @gv_i32, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0) monotonic, align 4
914 ret i32 %1
915}
916
917; Function Attrs: nofree norecurse nounwind mustprogress
918define zeroext i32 @_Z26atomic_load_relaxed_gv_u32v() {
919; CHECK-LABEL: _Z26atomic_load_relaxed_gv_u32v:
920; CHECK: # %bb.0:
921; CHECK-NEXT: lea %s0, gv_u32@lo
922; CHECK-NEXT: and %s0, %s0, (32)0
923; CHECK-NEXT: lea.sl %s0, gv_u32@hi(, %s0)
924; CHECK-NEXT: ldl.zx %s0, (, %s0)
925; CHECK-NEXT: b.l.t (, %s10)
926 %1 = load atomic i32, i32* getelementptr inbounds (%"struct.std::__1::atomic.25", %"struct.std::__1::atomic.25"* @gv_u32, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0) monotonic, align 4
927 ret i32 %1
928}
929
930; Function Attrs: nofree norecurse nounwind mustprogress
931define i64 @_Z26atomic_load_relaxed_gv_i64v() {
932; CHECK-LABEL: _Z26atomic_load_relaxed_gv_i64v:
933; CHECK: # %bb.0:
934; CHECK-NEXT: lea %s0, gv_i64@lo
935; CHECK-NEXT: and %s0, %s0, (32)0
936; CHECK-NEXT: lea.sl %s0, gv_i64@hi(, %s0)
937; CHECK-NEXT: ld %s0, (, %s0)
938; CHECK-NEXT: b.l.t (, %s10)
939 %1 = load atomic i64, i64* getelementptr inbounds (%"struct.std::__1::atomic.30", %"struct.std::__1::atomic.30"* @gv_i64, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0) monotonic, align 8
940 ret i64 %1
941}
942
943; Function Attrs: nofree norecurse nounwind mustprogress
944define i64 @_Z26atomic_load_relaxed_gv_u64v() {
945; CHECK-LABEL: _Z26atomic_load_relaxed_gv_u64v:
946; CHECK: # %bb.0:
947; CHECK-NEXT: lea %s0, gv_u64@lo
948; CHECK-NEXT: and %s0, %s0, (32)0
949; CHECK-NEXT: lea.sl %s0, gv_u64@hi(, %s0)
950; CHECK-NEXT: ld %s0, (, %s0)
951; CHECK-NEXT: b.l.t (, %s10)
952 %1 = load atomic i64, i64* getelementptr inbounds (%"struct.std::__1::atomic.35", %"struct.std::__1::atomic.35"* @gv_u64, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0) monotonic, align 8
953 ret i64 %1
954}
955
956; Function Attrs: nofree nounwind mustprogress
957define i128 @_Z27atomic_load_relaxed_gv_i128v() {
958; CHECK-LABEL: _Z27atomic_load_relaxed_gv_i128v:
959; CHECK: .LBB{{[0-9]+}}_2:
960; CHECK-NEXT: lea %s0, __atomic_load@lo
961; CHECK-NEXT: and %s0, %s0, (32)0
962; CHECK-NEXT: lea.sl %s12, __atomic_load@hi(, %s0)
963; CHECK-NEXT: lea %s0, gv_i128@lo
964; CHECK-NEXT: and %s0, %s0, (32)0
965; CHECK-NEXT: lea.sl %s1, gv_i128@hi(, %s0)
966; CHECK-NEXT: lea %s2, 240(, %s11)
967; CHECK-NEXT: or %s0, 16, (0)1
968; CHECK-NEXT: or %s3, 0, (0)1
969; CHECK-NEXT: bsic %s10, (, %s12)
970; CHECK-NEXT: ld %s1, 248(, %s11)
971; CHECK-NEXT: ld %s0, 240(, %s11)
972; CHECK-NEXT: or %s11, 0, %s9
973 %1 = alloca i128, align 16
974 %2 = bitcast i128* %1 to i8*
975 call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %2)
976 call void @__atomic_load(i64 16, i8* nonnull bitcast (%"struct.std::__1::atomic.40"* @gv_i128 to i8*), i8* nonnull %2, i32 signext 0)
977 %3 = load i128, i128* %1, align 16, !tbaa !2
978 call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %2)
979 ret i128 %3
980}
981
982; Function Attrs: nofree nounwind mustprogress
983define i128 @_Z27atomic_load_relaxed_gv_u128v() {
984; CHECK-LABEL: _Z27atomic_load_relaxed_gv_u128v:
985; CHECK: .LBB{{[0-9]+}}_2:
986; CHECK-NEXT: lea %s0, __atomic_load@lo
987; CHECK-NEXT: and %s0, %s0, (32)0
988; CHECK-NEXT: lea.sl %s12, __atomic_load@hi(, %s0)
989; CHECK-NEXT: lea %s0, gv_u128@lo
990; CHECK-NEXT: and %s0, %s0, (32)0
991; CHECK-NEXT: lea.sl %s1, gv_u128@hi(, %s0)
992; CHECK-NEXT: lea %s2, 240(, %s11)
993; CHECK-NEXT: or %s0, 16, (0)1
994; CHECK-NEXT: or %s3, 0, (0)1
995; CHECK-NEXT: bsic %s10, (, %s12)
996; CHECK-NEXT: ld %s1, 248(, %s11)
997; CHECK-NEXT: ld %s0, 240(, %s11)
998; CHECK-NEXT: or %s11, 0, %s9
999 %1 = alloca i128, align 16
1000 %2 = bitcast i128* %1 to i8*
1001 call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %2)
1002 call void @__atomic_load(i64 16, i8* nonnull bitcast (%"struct.std::__1::atomic.45"* @gv_u128 to i8*), i8* nonnull %2, i32 signext 0)
1003 %3 = load i128, i128* %1, align 16, !tbaa !2
1004 call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %2)
1005 ret i128 %3
1006}
1007
1008; Function Attrs: nofree nounwind willreturn
1009declare void @__atomic_load(i64, i8*, i8*, i32)
1010
Kazushi (Jam) Marukawaf32992a2020-10-23 22:10:34 +09001011!2 = !{!3, !3, i64 0}
1012!3 = !{!"__int128", !4, i64 0}
1013!4 = !{!"omnipotent char", !5, i64 0}
1014!5 = !{!"Simple C++ TBAA"}