source: icGREP/icgrep-devel/llvm-3.8.0.src/test/CodeGen/AArch64/cxx-tlscc.ll @ 5027

Last change on this file since 5027 was 5027, checked in by cameron, 3 years ago

Upgrade to llvm 3.8

File size: 3.0 KB
Line 
1; RUN: llc < %s -mtriple=aarch64-apple-ios | FileCheck %s
2; RUN: llc < %s -mtriple=aarch64-apple-ios -enable-shrink-wrap=true | FileCheck --check-prefix=CHECK %s
3; Shrink wrapping currently does not kick in because we have a TLS CALL
4; in the entry block and it will clobber the link register.
5
6%struct.S = type { i8 }
7
8@sg = internal thread_local global %struct.S zeroinitializer, align 1
9@__dso_handle = external global i8
10@__tls_guard = internal thread_local unnamed_addr global i1 false
11@sum1 = internal thread_local global i32 0, align 4
12
13declare %struct.S* @_ZN1SC1Ev(%struct.S* returned)
14declare %struct.S* @_ZN1SD1Ev(%struct.S* returned)
15declare i32 @_tlv_atexit(void (i8*)*, i8*, i8*)
16
17define cxx_fast_tlscc nonnull %struct.S* @_ZTW2sg() nounwind {
18  %.b.i = load i1, i1* @__tls_guard, align 1
19  br i1 %.b.i, label %__tls_init.exit, label %init.i
20
21init.i:
22  store i1 true, i1* @__tls_guard, align 1
23  %call.i.i = tail call %struct.S* @_ZN1SC1Ev(%struct.S* nonnull @sg)
24  %1 = tail call i32 @_tlv_atexit(void (i8*)* nonnull bitcast (%struct.S* (%struct.S*)* @_ZN1SD1Ev to void (i8*)*), i8* nonnull getelementptr inbounds (%struct.S, %struct.S* @sg, i64 0, i32 0), i8* nonnull @__dso_handle)
25  br label %__tls_init.exit
26
27__tls_init.exit:
28  ret %struct.S* @sg
29}
30
31; CHECK-LABEL: _ZTW2sg
32; CHECK-NOT: stp d31, d30
33; CHECK-NOT: stp d29, d28
34; CHECK-NOT: stp d27, d26
35; CHECK-NOT: stp d25, d24
36; CHECK-NOT: stp d23, d22
37; CHECK-NOT: stp d21, d20
38; CHECK-NOT: stp d19, d18
39; CHECK-NOT: stp d17, d16
40; CHECK-NOT: stp d7, d6
41; CHECK-NOT: stp d5, d4
42; CHECK-NOT: stp d3, d2
43; CHECK-NOT: stp d1, d0
44; CHECK-NOT: stp x20, x19
45; CHECK-NOT: stp x14, x13
46; CHECK-NOT: stp x12, x11
47; CHECK-NOT: stp x10, x9
48; CHECK-NOT: stp x8, x7
49; CHECK-NOT: stp x6, x5
50; CHECK-NOT: stp x4, x3
51; CHECK-NOT: stp x2, x1
52; CHECK: blr
53; CHECK: tbnz w{{.*}}, #0, [[BB_end:.?LBB0_[0-9]+]]
54; CHECK: blr
55; CHECK: tlv_atexit
56; CHECK: [[BB_end]]:
57; CHECK: blr
58; CHECK-NOT: ldp x2, x1
59; CHECK-NOT: ldp x4, x3
60; CHECK-NOT: ldp x6, x5
61; CHECK-NOT: ldp x8, x7
62; CHECK-NOT: ldp x10, x9
63; CHECK-NOT: ldp x12, x11
64; CHECK-NOT: ldp x14, x13
65; CHECK-NOT: ldp x20, x19
66; CHECK-NOT: ldp d1, d0
67; CHECK-NOT: ldp d3, d2
68; CHECK-NOT: ldp d5, d4
69; CHECK-NOT: ldp d7, d6
70; CHECK-NOT: ldp d17, d16
71; CHECK-NOT: ldp d19, d18
72; CHECK-NOT: ldp d21, d20
73; CHECK-NOT: ldp d23, d22
74; CHECK-NOT: ldp d25, d24
75; CHECK-NOT: ldp d27, d26
76; CHECK-NOT: ldp d29, d28
77; CHECK-NOT: ldp d31, d30
78
79; CHECK-LABEL: _ZTW4sum1
80; CHECK-NOT: stp d31, d30
81; CHECK-NOT: stp d29, d28
82; CHECK-NOT: stp d27, d26
83; CHECK-NOT: stp d25, d24
84; CHECK-NOT: stp d23, d22
85; CHECK-NOT: stp d21, d20
86; CHECK-NOT: stp d19, d18
87; CHECK-NOT: stp d17, d16
88; CHECK-NOT: stp d7, d6
89; CHECK-NOT: stp d5, d4
90; CHECK-NOT: stp d3, d2
91; CHECK-NOT: stp d1, d0
92; CHECK-NOT: stp x20, x19
93; CHECK-NOT: stp x14, x13
94; CHECK-NOT: stp x12, x11
95; CHECK-NOT: stp x10, x9
96; CHECK-NOT: stp x8, x7
97; CHECK-NOT: stp x6, x5
98; CHECK-NOT: stp x4, x3
99; CHECK-NOT: stp x2, x1
100; CHECK: blr
101define cxx_fast_tlscc nonnull i32* @_ZTW4sum1() nounwind {
102  ret i32* @sum1
103}
Note: See TracBrowser for help on using the repository browser.