1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 -ppc-asm-full-reg-names \
3 ; RUN: -mtriple powerpc64-ibm-aix-xcoff -mattr=+aix-small-local-exec-tls < %s \
4 ; RUN: | FileCheck %s --check-prefix=SMALL-LOCAL-EXEC-SMALLCM64
5 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 -ppc-asm-full-reg-names \
6 ; RUN: -mtriple powerpc64-ibm-aix-xcoff --code-model=large \
7 ; RUN: -mattr=+aix-small-local-exec-tls < %s | FileCheck %s \
8 ; RUN: --check-prefix=SMALL-LOCAL-EXEC-LARGECM64
10 @ThreadLocalVarInit = thread_local(localexec) global float 1.000000e+00, align 4
11 @VarInit = local_unnamed_addr global float 8.700000e+01, align 4
12 @IThreadLocalVarInit = internal thread_local(localexec) global float 1.000000e+00, align 4
13 declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #1
14 @e = thread_local(localexec) global [87 x float] zeroinitializer, align 4
16 define nonnull ptr @AddrTest1() local_unnamed_addr #0 {
17 ; SMALL-LOCAL-EXEC-SMALLCM64-LABEL: AddrTest1:
18 ; SMALL-LOCAL-EXEC-SMALLCM64: # %bb.0: # %entry
19 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: la r3, e[TL]@le(r13)
20 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: addi r3, r3, 16
21 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: blr
23 ; SMALL-LOCAL-EXEC-LARGECM64-LABEL: AddrTest1:
24 ; SMALL-LOCAL-EXEC-LARGECM64: # %bb.0: # %entry
25 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: la r3, e[TL]@le(r13)
26 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: addi r3, r3, 16
27 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: blr
29 %0 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @e)
30 %arrayidx = getelementptr inbounds [87 x float], ptr %0, i64 0, i64 4
34 define void @storeITLInit(float noundef %x) {
35 ; SMALL-LOCAL-EXEC-SMALLCM64-LABEL: storeITLInit:
36 ; SMALL-LOCAL-EXEC-SMALLCM64: # %bb.0: # %entry
37 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: stfs f1, IThreadLocalVarInit[TL]@le(r13)
38 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: blr
40 ; SMALL-LOCAL-EXEC-LARGECM64-LABEL: storeITLInit:
41 ; SMALL-LOCAL-EXEC-LARGECM64: # %bb.0: # %entry
42 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: stfs f1, IThreadLocalVarInit[TL]@le(r13)
43 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: blr
45 %0 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @IThreadLocalVarInit)
46 store float %x, ptr %0, align 4
50 define void @storeTLInit(float noundef %x) {
51 ; SMALL-LOCAL-EXEC-SMALLCM64-LABEL: storeTLInit:
52 ; SMALL-LOCAL-EXEC-SMALLCM64: # %bb.0: # %entry
53 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: stfs f1, ThreadLocalVarInit[TL]@le(r13)
54 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: blr
56 ; SMALL-LOCAL-EXEC-LARGECM64-LABEL: storeTLInit:
57 ; SMALL-LOCAL-EXEC-LARGECM64: # %bb.0: # %entry
58 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: stfs f1, ThreadLocalVarInit[TL]@le(r13)
59 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: blr
61 %0 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @ThreadLocalVarInit)
62 store float %x, ptr %0, align 4
66 define float @loadITLInit() {
67 ; SMALL-LOCAL-EXEC-SMALLCM64-LABEL: loadITLInit:
68 ; SMALL-LOCAL-EXEC-SMALLCM64: # %bb.0: # %entry
69 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: lfs f1, IThreadLocalVarInit[TL]@le(r13)
70 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: blr
72 ; SMALL-LOCAL-EXEC-LARGECM64-LABEL: loadITLInit:
73 ; SMALL-LOCAL-EXEC-LARGECM64: # %bb.0: # %entry
74 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: lfs f1, IThreadLocalVarInit[TL]@le(r13)
75 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: blr
77 %0 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @IThreadLocalVarInit)
78 %1 = load float, ptr %0, align 4
82 define float @loadITLInit2() {
83 ; SMALL-LOCAL-EXEC-SMALLCM64-LABEL: loadITLInit2:
84 ; SMALL-LOCAL-EXEC-SMALLCM64: # %bb.0: # %entry
85 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: ld r3, L..C0(r2) # @VarInit
86 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: lfs f0, IThreadLocalVarInit[TL]@le(r13)
87 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: lfs f1, 0(r3)
88 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: fadds f1, f0, f1
89 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: blr
91 ; SMALL-LOCAL-EXEC-LARGECM64-LABEL: loadITLInit2:
92 ; SMALL-LOCAL-EXEC-LARGECM64: # %bb.0: # %entry
93 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: addis r3, L..C0@u(r2)
94 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: lfs f0, IThreadLocalVarInit[TL]@le(r13)
95 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: ld r3, L..C0@l(r3)
96 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: lfs f1, 0(r3)
97 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: fadds f1, f0, f1
98 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: blr
100 %0 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @IThreadLocalVarInit)
101 %1 = load float, ptr %0, align 4
102 %2 = load float, ptr @VarInit, align 4
103 %add = fadd float %1, %2
107 define float @loadTLInit() {
108 ; SMALL-LOCAL-EXEC-SMALLCM64-LABEL: loadTLInit:
109 ; SMALL-LOCAL-EXEC-SMALLCM64: # %bb.0: # %entry
110 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: lfs f1, ThreadLocalVarInit[TL]@le(r13)
111 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: blr
113 ; SMALL-LOCAL-EXEC-LARGECM64-LABEL: loadTLInit:
114 ; SMALL-LOCAL-EXEC-LARGECM64: # %bb.0: # %entry
115 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: lfs f1, ThreadLocalVarInit[TL]@le(r13)
116 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: blr
118 %0 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @ThreadLocalVarInit)
119 %1 = load float, ptr %0, align 4
123 define float @loadTLInit2() {
124 ; SMALL-LOCAL-EXEC-SMALLCM64-LABEL: loadTLInit2:
125 ; SMALL-LOCAL-EXEC-SMALLCM64: # %bb.0: # %entry
126 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: ld r3, L..C0(r2) # @VarInit
127 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: lfs f0, ThreadLocalVarInit[TL]@le(r13)
128 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: lfs f1, 0(r3)
129 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: fadds f1, f0, f1
130 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: blr
132 ; SMALL-LOCAL-EXEC-LARGECM64-LABEL: loadTLInit2:
133 ; SMALL-LOCAL-EXEC-LARGECM64: # %bb.0: # %entry
134 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: addis r3, L..C0@u(r2)
135 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: lfs f0, ThreadLocalVarInit[TL]@le(r13)
136 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: ld r3, L..C0@l(r3)
137 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: lfs f1, 0(r3)
138 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: fadds f1, f0, f1
139 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: blr
141 %0 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @ThreadLocalVarInit)
142 %1 = load float, ptr %0, align 4
143 %2 = load float, ptr @VarInit, align 4
144 %add = fadd float %1, %2
148 define void @loadStore1(float noundef %x) {
149 ; SMALL-LOCAL-EXEC-SMALLCM64-LABEL: loadStore1:
150 ; SMALL-LOCAL-EXEC-SMALLCM64: # %bb.0: # %entry
151 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: vspltisw v2, 1
152 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: lfs f1, IThreadLocalVarInit[TL]@le(r13)
153 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: xvcvsxwdp vs0, vs34
154 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: vspltisw v3, 8
155 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: fadds f0, f1, f0
156 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: xvcvsxwdp vs1, vs35
157 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: fadds f0, f0, f1
158 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: stfs f0, IThreadLocalVarInit[TL]@le(r13)
159 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: blr
161 ; SMALL-LOCAL-EXEC-LARGECM64-LABEL: loadStore1:
162 ; SMALL-LOCAL-EXEC-LARGECM64: # %bb.0: # %entry
163 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: vspltisw v2, 1
164 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: lfs f1, IThreadLocalVarInit[TL]@le(r13)
165 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: xvcvsxwdp vs0, vs34
166 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: vspltisw v3, 8
167 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: fadds f0, f1, f0
168 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: xvcvsxwdp vs1, vs35
169 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: fadds f0, f0, f1
170 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: stfs f0, IThreadLocalVarInit[TL]@le(r13)
171 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: blr
173 %0 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @IThreadLocalVarInit)
174 %1 = load float, ptr %0, align 4
175 %inc = fadd float %1, 1.000000e+00
176 %add = fadd float %inc, 8.000000e+00
177 store float %add, ptr %0, align 4