1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt -S -O1 -mtriple=amdgcn-- -amdgpu-simplify-libcall=1 -amdgpu-prelink < %s | FileCheck %s
4 target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8"
6 declare float @_Z3sinf(float) #0
7 declare float @_Z3cosf(float) #0
8 declare <2 x float> @_Z3sinDv2_f(<2 x float>) #0
9 declare <2 x float> @_Z3cosDv2_f(<2 x float>) #0
10 declare <3 x float> @_Z3sinDv3_f(<3 x float>) #0
11 declare <3 x float> @_Z3cosDv3_f(<3 x float>) #0
12 declare <4 x float> @_Z3sinDv4_f(<4 x float>) #0
13 declare <4 x float> @_Z3cosDv4_f(<4 x float>) #0
14 declare <8 x float> @_Z3sinDv8_f(<8 x float>) #0
15 declare <8 x float> @_Z3cosDv8_f(<8 x float>) #0
16 declare <16 x float> @_Z3sinDv16_f(<16 x float>) #0
17 declare <16 x float> @_Z3cosDv16_f(<16 x float>) #0
20 declare half @_Z3sinDh(half) #0
21 declare half @_Z3cosDh(half) #0
22 declare <2 x half> @_Z3sinDv2_Dh(<2 x half>) #0
23 declare <2 x half> @_Z3cosDv2_Dh(<2 x half>) #0
24 declare <3 x half> @_Z3sinDv3_Dh(<3 x half>) #0
25 declare <3 x half> @_Z3cosDv3_Dh(<3 x half>) #0
26 declare <4 x half> @_Z3sinDv4_Dh(<4 x half>) #0
27 declare <4 x half> @_Z3cosDv4_Dh(<4 x half>) #0
28 declare <8 x half> @_Z3sinDv8_Dh(<8 x half>) #0
29 declare <8 x half> @_Z3cosDv8_Dh(<8 x half>) #0
30 declare <16 x half> @_Z3sinDv16_Dh(<16 x half>) #0
31 declare <16 x half> @_Z3cosDv16_Dh(<16 x half>) #0
34 declare double @_Z3sind(double) #0
35 declare double @_Z3cosd(double) #0
36 declare <2 x double> @_Z3sinDv2_d(<2 x double>) #0
37 declare <2 x double> @_Z3cosDv2_d(<2 x double>) #0
38 declare <3 x double> @_Z3sinDv3_d(<3 x double>) #0
39 declare <3 x double> @_Z3cosDv3_d(<3 x double>) #0
40 declare <4 x double> @_Z3sinDv4_d(<4 x double>) #0
41 declare <4 x double> @_Z3cosDv4_d(<4 x double>) #0
42 declare <8 x double> @_Z3sinDv8_d(<8 x double>) #0
43 declare <8 x double> @_Z3cosDv8_d(<8 x double>) #0
44 declare <16 x double> @_Z3sinDv16_d(<16 x double>) #0
45 declare <16 x double> @_Z3cosDv16_d(<16 x double>) #0
47 declare float @_Z6sincosfPU3AS5f(float %x, ptr addrspace(5) writeonly %ptr) #1
48 declare float @_Z6sincosfPU3AS0f(float %x, ptr writeonly %ptr) #1
50 define void @sincos_f16_nocontract(half %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
51 ; CHECK-LABEL: define void @sincos_f16_nocontract
52 ; CHECK-SAME: (half [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] {
54 ; CHECK-NEXT: [[CALL:%.*]] = tail call half @_Z3sinDh(half [[X]])
55 ; CHECK-NEXT: store half [[CALL]], ptr addrspace(1) [[SIN_OUT]], align 2
56 ; CHECK-NEXT: [[CALL1:%.*]] = tail call half @_Z3cosDh(half [[X]])
57 ; CHECK-NEXT: store half [[CALL1]], ptr addrspace(1) [[COS_OUT]], align 2
58 ; CHECK-NEXT: ret void
61 %call = tail call half @_Z3sinDh(half %x)
62 store half %call, ptr addrspace(1) %sin_out, align 2
63 %call1 = tail call half @_Z3cosDh(half %x)
64 store half %call1, ptr addrspace(1) %cos_out, align 2
69 define void @sincos_v2f16_nocontract(<2 x half> %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
70 ; CHECK-LABEL: define void @sincos_v2f16_nocontract
71 ; CHECK-SAME: (<2 x half> [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR2]] {
73 ; CHECK-NEXT: [[CALL:%.*]] = tail call <2 x half> @_Z3sinDv2_Dh(<2 x half> [[X]])
74 ; CHECK-NEXT: store <2 x half> [[CALL]], ptr addrspace(1) [[SIN_OUT]], align 4
75 ; CHECK-NEXT: [[CALL1:%.*]] = tail call <2 x half> @_Z3cosDv2_Dh(<2 x half> [[X]])
76 ; CHECK-NEXT: store <2 x half> [[CALL1]], ptr addrspace(1) [[COS_OUT]], align 4
77 ; CHECK-NEXT: ret void
80 %call = tail call <2 x half> @_Z3sinDv2_Dh(<2 x half> %x)
81 store <2 x half> %call, ptr addrspace(1) %sin_out, align 4
82 %call1 = tail call <2 x half> @_Z3cosDv2_Dh(<2 x half> %x)
83 store <2 x half> %call1, ptr addrspace(1) %cos_out, align 4
88 define void @sincos_f16(half %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
89 ; CHECK-LABEL: define void @sincos_f16
90 ; CHECK-SAME: (half [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR2]] {
92 ; CHECK-NEXT: [[CALL:%.*]] = tail call contract half @_Z3sinDh(half [[X]])
93 ; CHECK-NEXT: store half [[CALL]], ptr addrspace(1) [[SIN_OUT]], align 2
94 ; CHECK-NEXT: [[CALL1:%.*]] = tail call contract half @_Z3cosDh(half [[X]])
95 ; CHECK-NEXT: store half [[CALL1]], ptr addrspace(1) [[COS_OUT]], align 2
96 ; CHECK-NEXT: ret void
99 %call = tail call contract half @_Z3sinDh(half %x)
100 store half %call, ptr addrspace(1) %sin_out, align 2
101 %call1 = tail call contract half @_Z3cosDh(half %x)
102 store half %call1, ptr addrspace(1) %cos_out, align 2
106 define void @sincos_f16_order1(half %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
107 ; CHECK-LABEL: define void @sincos_f16_order1
108 ; CHECK-SAME: (half [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR2]] {
110 ; CHECK-NEXT: [[CALL1:%.*]] = tail call contract half @_Z3cosDh(half [[X]])
111 ; CHECK-NEXT: store half [[CALL1]], ptr addrspace(1) [[COS_OUT]], align 2
112 ; CHECK-NEXT: [[CALL:%.*]] = tail call contract half @_Z3sinDh(half [[X]])
113 ; CHECK-NEXT: store half [[CALL]], ptr addrspace(1) [[SIN_OUT]], align 2
114 ; CHECK-NEXT: ret void
117 %call1 = tail call contract half @_Z3cosDh(half %x)
118 store half %call1, ptr addrspace(1) %cos_out, align 2
119 %call = tail call contract half @_Z3sinDh(half %x)
120 store half %call, ptr addrspace(1) %sin_out, align 2
124 define void @sincos_v2f16(<2 x half> %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
125 ; CHECK-LABEL: define void @sincos_v2f16
126 ; CHECK-SAME: (<2 x half> [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR2]] {
128 ; CHECK-NEXT: [[CALL:%.*]] = tail call contract <2 x half> @_Z3sinDv2_Dh(<2 x half> [[X]])
129 ; CHECK-NEXT: store <2 x half> [[CALL]], ptr addrspace(1) [[SIN_OUT]], align 4
130 ; CHECK-NEXT: [[CALL1:%.*]] = tail call contract <2 x half> @_Z3cosDv2_Dh(<2 x half> [[X]])
131 ; CHECK-NEXT: store <2 x half> [[CALL1]], ptr addrspace(1) [[COS_OUT]], align 4
132 ; CHECK-NEXT: ret void
135 %call = tail call contract <2 x half> @_Z3sinDv2_Dh(<2 x half> %x)
136 store <2 x half> %call, ptr addrspace(1) %sin_out, align 4
137 %call1 = tail call contract <2 x half> @_Z3cosDv2_Dh(<2 x half> %x)
138 store <2 x half> %call1, ptr addrspace(1) %cos_out, align 4
142 define void @sincos_v3f16(<3 x half> %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
143 ; CHECK-LABEL: define void @sincos_v3f16
144 ; CHECK-SAME: (<3 x half> [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR2]] {
146 ; CHECK-NEXT: [[CALL:%.*]] = tail call contract <3 x half> @_Z3sinDv3_Dh(<3 x half> [[X]])
147 ; CHECK-NEXT: [[EXTRACTVEC2:%.*]] = shufflevector <3 x half> [[CALL]], <3 x half> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
148 ; CHECK-NEXT: store <4 x half> [[EXTRACTVEC2]], ptr addrspace(1) [[SIN_OUT]], align 8
149 ; CHECK-NEXT: [[CALL5:%.*]] = tail call contract <3 x half> @_Z3cosDv3_Dh(<3 x half> [[X]])
150 ; CHECK-NEXT: [[EXTRACTVEC6:%.*]] = shufflevector <3 x half> [[CALL5]], <3 x half> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
151 ; CHECK-NEXT: store <4 x half> [[EXTRACTVEC6]], ptr addrspace(1) [[COS_OUT]], align 8
152 ; CHECK-NEXT: ret void
155 %call = tail call contract <3 x half> @_Z3sinDv3_Dh(<3 x half> %x)
156 %extractVec2 = shufflevector <3 x half> %call, <3 x half> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
157 store <4 x half> %extractVec2, ptr addrspace(1) %sin_out, align 8
158 %call5 = tail call contract <3 x half> @_Z3cosDv3_Dh(<3 x half> %x)
159 %extractVec6 = shufflevector <3 x half> %call5, <3 x half> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
160 store <4 x half> %extractVec6, ptr addrspace(1) %cos_out, align 8
165 define void @sincos_v4f16(<4 x half> %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
166 ; CHECK-LABEL: define void @sincos_v4f16
167 ; CHECK-SAME: (<4 x half> [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR2]] {
169 ; CHECK-NEXT: [[CALL:%.*]] = tail call contract <4 x half> @_Z3sinDv4_Dh(<4 x half> [[X]])
170 ; CHECK-NEXT: store <4 x half> [[CALL]], ptr addrspace(1) [[SIN_OUT]], align 8
171 ; CHECK-NEXT: [[CALL1:%.*]] = tail call contract <4 x half> @_Z3cosDv4_Dh(<4 x half> [[X]])
172 ; CHECK-NEXT: store <4 x half> [[CALL1]], ptr addrspace(1) [[COS_OUT]], align 8
173 ; CHECK-NEXT: ret void
176 %call = tail call contract <4 x half> @_Z3sinDv4_Dh(<4 x half> %x)
177 store <4 x half> %call, ptr addrspace(1) %sin_out, align 8
178 %call1 = tail call contract <4 x half> @_Z3cosDv4_Dh(<4 x half> %x)
179 store <4 x half> %call1, ptr addrspace(1) %cos_out, align 8
183 define void @sincos_v8f16(<8 x half> %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
184 ; CHECK-LABEL: define void @sincos_v8f16
185 ; CHECK-SAME: (<8 x half> [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR2]] {
187 ; CHECK-NEXT: [[CALL:%.*]] = tail call contract <8 x half> @_Z3sinDv8_Dh(<8 x half> [[X]])
188 ; CHECK-NEXT: store <8 x half> [[CALL]], ptr addrspace(1) [[SIN_OUT]], align 16
189 ; CHECK-NEXT: [[CALL1:%.*]] = tail call contract <8 x half> @_Z3cosDv8_Dh(<8 x half> [[X]])
190 ; CHECK-NEXT: store <8 x half> [[CALL1]], ptr addrspace(1) [[COS_OUT]], align 16
191 ; CHECK-NEXT: ret void
194 %call = tail call contract <8 x half> @_Z3sinDv8_Dh(<8 x half> %x)
195 store <8 x half> %call, ptr addrspace(1) %sin_out, align 16
196 %call1 = tail call contract <8 x half> @_Z3cosDv8_Dh(<8 x half> %x)
197 store <8 x half> %call1, ptr addrspace(1) %cos_out, align 16
202 define void @sincos_v16f16(<16 x half> %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
203 ; CHECK-LABEL: define void @sincos_v16f16
204 ; CHECK-SAME: (<16 x half> [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR2]] {
206 ; CHECK-NEXT: [[CALL:%.*]] = tail call contract <16 x half> @_Z3sinDv16_Dh(<16 x half> [[X]])
207 ; CHECK-NEXT: store <16 x half> [[CALL]], ptr addrspace(1) [[SIN_OUT]], align 32
208 ; CHECK-NEXT: [[CALL1:%.*]] = tail call contract <16 x half> @_Z3cosDv16_Dh(<16 x half> [[X]])
209 ; CHECK-NEXT: store <16 x half> [[CALL1]], ptr addrspace(1) [[COS_OUT]], align 32
210 ; CHECK-NEXT: ret void
213 %call = tail call contract <16 x half> @_Z3sinDv16_Dh(<16 x half> %x)
214 store <16 x half> %call, ptr addrspace(1) %sin_out, align 32
215 %call1 = tail call contract <16 x half> @_Z3cosDv16_Dh(<16 x half> %x)
216 store <16 x half> %call1, ptr addrspace(1) %cos_out, align 32
221 define void @sincos_f32_nocontract(float %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
222 ; CHECK-LABEL: define void @sincos_f32_nocontract
223 ; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR3:[0-9]+]] {
225 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5)
226 ; CHECK-NEXT: [[TMP0:%.*]] = call float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[__SINCOS_]])
227 ; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr addrspace(5) [[__SINCOS_]], align 4
228 ; CHECK-NEXT: store float [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 4
229 ; CHECK-NEXT: store float [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 4
230 ; CHECK-NEXT: ret void
233 %call = tail call float @_Z3sinf(float %x)
234 store float %call, ptr addrspace(1) %sin_out, align 4
235 %call1 = tail call float @_Z3cosf(float %x)
236 store float %call1, ptr addrspace(1) %cos_out, align 4
241 define void @sincos_v2f32_nocontract(<2 x float> %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
242 ; CHECK-LABEL: define void @sincos_v2f32_nocontract
243 ; CHECK-SAME: (<2 x float> [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr {
245 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca <2 x float>, align 8, addrspace(5)
246 ; CHECK-NEXT: [[TMP0:%.*]] = call <2 x float> @_Z6sincosDv2_fPU3AS5S_(<2 x float> [[X]], ptr addrspace(5) [[__SINCOS_]])
247 ; CHECK-NEXT: [[TMP1:%.*]] = load <2 x float>, ptr addrspace(5) [[__SINCOS_]], align 8
248 ; CHECK-NEXT: store <2 x float> [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 8
249 ; CHECK-NEXT: store <2 x float> [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 8
250 ; CHECK-NEXT: ret void
253 %call = tail call <2 x float> @_Z3sinDv2_f(<2 x float> %x)
254 store <2 x float> %call, ptr addrspace(1) %sin_out, align 8
255 %call1 = tail call <2 x float> @_Z3cosDv2_f(<2 x float> %x)
256 store <2 x float> %call1, ptr addrspace(1) %cos_out, align 8
261 define void @sincos_f32(float %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
262 ; CHECK-LABEL: define void @sincos_f32
263 ; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR3]] {
265 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5)
266 ; CHECK-NEXT: [[TMP0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[__SINCOS_]])
267 ; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr addrspace(5) [[__SINCOS_]], align 4
268 ; CHECK-NEXT: store float [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 4
269 ; CHECK-NEXT: store float [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 4
270 ; CHECK-NEXT: ret void
273 %call = tail call contract float @_Z3sinf(float %x)
274 store float %call, ptr addrspace(1) %sin_out, align 4
275 %call1 = tail call contract float @_Z3cosf(float %x)
276 store float %call1, ptr addrspace(1) %cos_out, align 4
280 define void @sincos_f32_order1(float %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
281 ; CHECK-LABEL: define void @sincos_f32_order1
282 ; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR3]] {
284 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5)
285 ; CHECK-NEXT: [[TMP0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[__SINCOS_]])
286 ; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr addrspace(5) [[__SINCOS_]], align 4
287 ; CHECK-NEXT: store float [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 4
288 ; CHECK-NEXT: store float [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 4
289 ; CHECK-NEXT: ret void
292 %call1 = tail call contract float @_Z3cosf(float %x)
293 store float %call1, ptr addrspace(1) %cos_out, align 4
294 %call = tail call contract float @_Z3sinf(float %x)
295 store float %call, ptr addrspace(1) %sin_out, align 4
299 define void @sincos_v2f32(<2 x float> %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
300 ; CHECK-LABEL: define void @sincos_v2f32
301 ; CHECK-SAME: (<2 x float> [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr {
303 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca <2 x float>, align 8, addrspace(5)
304 ; CHECK-NEXT: [[TMP0:%.*]] = call contract <2 x float> @_Z6sincosDv2_fPU3AS5S_(<2 x float> [[X]], ptr addrspace(5) [[__SINCOS_]])
305 ; CHECK-NEXT: [[TMP1:%.*]] = load <2 x float>, ptr addrspace(5) [[__SINCOS_]], align 8
306 ; CHECK-NEXT: store <2 x float> [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 8
307 ; CHECK-NEXT: store <2 x float> [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 8
308 ; CHECK-NEXT: ret void
311 %call = tail call contract <2 x float> @_Z3sinDv2_f(<2 x float> %x)
312 store <2 x float> %call, ptr addrspace(1) %sin_out, align 8
313 %call1 = tail call contract <2 x float> @_Z3cosDv2_f(<2 x float> %x)
314 store <2 x float> %call1, ptr addrspace(1) %cos_out, align 8
318 define void @sincos_v3f32(<3 x float> %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
319 ; CHECK-LABEL: define void @sincos_v3f32
320 ; CHECK-SAME: (<3 x float> [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr {
322 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca <3 x float>, align 16, addrspace(5)
323 ; CHECK-NEXT: [[TMP0:%.*]] = call contract <3 x float> @_Z6sincosDv3_fPU3AS5S_(<3 x float> [[X]], ptr addrspace(5) [[__SINCOS_]])
324 ; CHECK-NEXT: [[TMP1:%.*]] = load <3 x float>, ptr addrspace(5) [[__SINCOS_]], align 16
325 ; CHECK-NEXT: [[EXTRACTVEC2:%.*]] = shufflevector <3 x float> [[TMP0]], <3 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
326 ; CHECK-NEXT: store <4 x float> [[EXTRACTVEC2]], ptr addrspace(1) [[SIN_OUT]], align 16
327 ; CHECK-NEXT: [[EXTRACTVEC6:%.*]] = shufflevector <3 x float> [[TMP1]], <3 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
328 ; CHECK-NEXT: store <4 x float> [[EXTRACTVEC6]], ptr addrspace(1) [[COS_OUT]], align 16
329 ; CHECK-NEXT: ret void
332 %call = tail call contract <3 x float> @_Z3sinDv3_f(<3 x float> %x)
333 %extractVec2 = shufflevector <3 x float> %call, <3 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
334 store <4 x float> %extractVec2, ptr addrspace(1) %sin_out, align 16
335 %call5 = tail call contract <3 x float> @_Z3cosDv3_f(<3 x float> %x)
336 %extractVec6 = shufflevector <3 x float> %call5, <3 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
337 store <4 x float> %extractVec6, ptr addrspace(1) %cos_out, align 16
341 define void @sincos_v4f32(<4 x float> %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
342 ; CHECK-LABEL: define void @sincos_v4f32
343 ; CHECK-SAME: (<4 x float> [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr {
345 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca <4 x float>, align 16, addrspace(5)
346 ; CHECK-NEXT: [[TMP0:%.*]] = call contract <4 x float> @_Z6sincosDv4_fPU3AS5S_(<4 x float> [[X]], ptr addrspace(5) [[__SINCOS_]])
347 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x float>, ptr addrspace(5) [[__SINCOS_]], align 16
348 ; CHECK-NEXT: store <4 x float> [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 16
349 ; CHECK-NEXT: store <4 x float> [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 16
350 ; CHECK-NEXT: ret void
353 %call = tail call contract <4 x float> @_Z3sinDv4_f(<4 x float> %x)
354 store <4 x float> %call, ptr addrspace(1) %sin_out, align 16
355 %call1 = tail call contract <4 x float> @_Z3cosDv4_f(<4 x float> %x)
356 store <4 x float> %call1, ptr addrspace(1) %cos_out, align 16
360 define void @sincos_v8f32(<8 x float> %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
361 ; CHECK-LABEL: define void @sincos_v8f32
362 ; CHECK-SAME: (<8 x float> [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr {
364 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca <8 x float>, align 32, addrspace(5)
365 ; CHECK-NEXT: [[TMP0:%.*]] = call contract <8 x float> @_Z6sincosDv8_fPU3AS5S_(<8 x float> [[X]], ptr addrspace(5) [[__SINCOS_]])
366 ; CHECK-NEXT: [[TMP1:%.*]] = load <8 x float>, ptr addrspace(5) [[__SINCOS_]], align 32
367 ; CHECK-NEXT: store <8 x float> [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 32
368 ; CHECK-NEXT: store <8 x float> [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 32
369 ; CHECK-NEXT: ret void
372 %call = tail call contract <8 x float> @_Z3sinDv8_f(<8 x float> %x)
373 store <8 x float> %call, ptr addrspace(1) %sin_out, align 32
374 %call1 = tail call contract <8 x float> @_Z3cosDv8_f(<8 x float> %x)
375 store <8 x float> %call1, ptr addrspace(1) %cos_out, align 32
379 define void @sincos_v16f32(<16 x float> %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
380 ; CHECK-LABEL: define void @sincos_v16f32
381 ; CHECK-SAME: (<16 x float> [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr {
383 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca <16 x float>, align 64, addrspace(5)
384 ; CHECK-NEXT: [[TMP0:%.*]] = call contract <16 x float> @_Z6sincosDv16_fPU3AS5S_(<16 x float> [[X]], ptr addrspace(5) [[__SINCOS_]])
385 ; CHECK-NEXT: [[TMP1:%.*]] = load <16 x float>, ptr addrspace(5) [[__SINCOS_]], align 64
386 ; CHECK-NEXT: store <16 x float> [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 64
387 ; CHECK-NEXT: store <16 x float> [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 64
388 ; CHECK-NEXT: ret void
391 %call = tail call contract <16 x float> @_Z3sinDv16_f(<16 x float> %x)
392 store <16 x float> %call, ptr addrspace(1) %sin_out, align 64
393 %call1 = tail call contract <16 x float> @_Z3cosDv16_f(<16 x float> %x)
394 store <16 x float> %call1, ptr addrspace(1) %cos_out, align 64
398 define void @sincos_f64_nocontract(double %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
399 ; CHECK-LABEL: define void @sincos_f64_nocontract
400 ; CHECK-SAME: (double [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr {
402 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca double, align 8, addrspace(5)
403 ; CHECK-NEXT: [[TMP0:%.*]] = call double @_Z6sincosdPU3AS5d(double [[X]], ptr addrspace(5) [[__SINCOS_]])
404 ; CHECK-NEXT: [[TMP1:%.*]] = load double, ptr addrspace(5) [[__SINCOS_]], align 8
405 ; CHECK-NEXT: store double [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 8
406 ; CHECK-NEXT: store double [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 8
407 ; CHECK-NEXT: ret void
410 %call = tail call double @_Z3sind(double %x)
411 store double %call, ptr addrspace(1) %sin_out, align 8
412 %call1 = tail call double @_Z3cosd(double %x)
413 store double %call1, ptr addrspace(1) %cos_out, align 8
418 define void @sincos_v2f64_nocontract(<2 x double> %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
419 ; CHECK-LABEL: define void @sincos_v2f64_nocontract
420 ; CHECK-SAME: (<2 x double> [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr {
422 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca <2 x double>, align 16, addrspace(5)
423 ; CHECK-NEXT: [[TMP0:%.*]] = call <2 x double> @_Z6sincosDv2_dPU3AS5S_(<2 x double> [[X]], ptr addrspace(5) [[__SINCOS_]])
424 ; CHECK-NEXT: [[TMP1:%.*]] = load <2 x double>, ptr addrspace(5) [[__SINCOS_]], align 16
425 ; CHECK-NEXT: store <2 x double> [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 16
426 ; CHECK-NEXT: store <2 x double> [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 16
427 ; CHECK-NEXT: ret void
430 %call = tail call <2 x double> @_Z3sinDv2_d(<2 x double> %x)
431 store <2 x double> %call, ptr addrspace(1) %sin_out, align 16
432 %call1 = tail call <2 x double> @_Z3cosDv2_d(<2 x double> %x)
433 store <2 x double> %call1, ptr addrspace(1) %cos_out, align 16
437 define void @sincos_f64(double %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
438 ; CHECK-LABEL: define void @sincos_f64
439 ; CHECK-SAME: (double [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr {
441 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca double, align 8, addrspace(5)
442 ; CHECK-NEXT: [[TMP0:%.*]] = call contract double @_Z6sincosdPU3AS5d(double [[X]], ptr addrspace(5) [[__SINCOS_]])
443 ; CHECK-NEXT: [[TMP1:%.*]] = load double, ptr addrspace(5) [[__SINCOS_]], align 8
444 ; CHECK-NEXT: store double [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 8
445 ; CHECK-NEXT: store double [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 8
446 ; CHECK-NEXT: ret void
449 %call = tail call contract double @_Z3sind(double %x)
450 store double %call, ptr addrspace(1) %sin_out, align 8
451 %call1 = tail call contract double @_Z3cosd(double %x)
452 store double %call1, ptr addrspace(1) %cos_out, align 8
456 define void @sincos_f64_order1(double %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
457 ; CHECK-LABEL: define void @sincos_f64_order1
458 ; CHECK-SAME: (double [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr {
460 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca double, align 8, addrspace(5)
461 ; CHECK-NEXT: [[TMP0:%.*]] = call contract double @_Z6sincosdPU3AS5d(double [[X]], ptr addrspace(5) [[__SINCOS_]])
462 ; CHECK-NEXT: [[TMP1:%.*]] = load double, ptr addrspace(5) [[__SINCOS_]], align 8
463 ; CHECK-NEXT: store double [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 8
464 ; CHECK-NEXT: store double [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 8
465 ; CHECK-NEXT: ret void
468 %call1 = tail call contract double @_Z3cosd(double %x)
469 store double %call1, ptr addrspace(1) %cos_out, align 8
470 %call = tail call contract double @_Z3sind(double %x)
471 store double %call, ptr addrspace(1) %sin_out, align 8
475 define void @sincos_v2f64(<2 x double> %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
476 ; CHECK-LABEL: define void @sincos_v2f64
477 ; CHECK-SAME: (<2 x double> [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr {
479 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca <2 x double>, align 16, addrspace(5)
480 ; CHECK-NEXT: [[TMP0:%.*]] = call contract <2 x double> @_Z6sincosDv2_dPU3AS5S_(<2 x double> [[X]], ptr addrspace(5) [[__SINCOS_]])
481 ; CHECK-NEXT: [[TMP1:%.*]] = load <2 x double>, ptr addrspace(5) [[__SINCOS_]], align 16
482 ; CHECK-NEXT: store <2 x double> [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 16
483 ; CHECK-NEXT: store <2 x double> [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 16
484 ; CHECK-NEXT: ret void
487 %call = tail call contract <2 x double> @_Z3sinDv2_d(<2 x double> %x)
488 store <2 x double> %call, ptr addrspace(1) %sin_out, align 16
489 %call1 = tail call contract <2 x double> @_Z3cosDv2_d(<2 x double> %x)
490 store <2 x double> %call1, ptr addrspace(1) %cos_out, align 16
494 define void @sincos_v3f64(<3 x double> %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
495 ; CHECK-LABEL: define void @sincos_v3f64
496 ; CHECK-SAME: (<3 x double> [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr {
498 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca <3 x double>, align 32, addrspace(5)
499 ; CHECK-NEXT: [[TMP0:%.*]] = call contract <3 x double> @_Z6sincosDv3_dPU3AS5S_(<3 x double> [[X]], ptr addrspace(5) [[__SINCOS_]])
500 ; CHECK-NEXT: [[TMP1:%.*]] = load <3 x double>, ptr addrspace(5) [[__SINCOS_]], align 32
501 ; CHECK-NEXT: [[EXTRACTVEC2:%.*]] = shufflevector <3 x double> [[TMP0]], <3 x double> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
502 ; CHECK-NEXT: store <4 x double> [[EXTRACTVEC2]], ptr addrspace(1) [[SIN_OUT]], align 32
503 ; CHECK-NEXT: [[EXTRACTVEC6:%.*]] = shufflevector <3 x double> [[TMP1]], <3 x double> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
504 ; CHECK-NEXT: store <4 x double> [[EXTRACTVEC6]], ptr addrspace(1) [[COS_OUT]], align 32
505 ; CHECK-NEXT: ret void
508 %call = tail call contract <3 x double> @_Z3sinDv3_d(<3 x double> %x)
509 %extractVec2 = shufflevector <3 x double> %call, <3 x double> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
510 store <4 x double> %extractVec2, ptr addrspace(1) %sin_out, align 32
511 %call5 = tail call contract <3 x double> @_Z3cosDv3_d(<3 x double> %x)
512 %extractVec6 = shufflevector <3 x double> %call5, <3 x double> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
513 store <4 x double> %extractVec6, ptr addrspace(1) %cos_out, align 32
517 define void @sincos_v4f64(<4 x double> %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
518 ; CHECK-LABEL: define void @sincos_v4f64
519 ; CHECK-SAME: (<4 x double> [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr {
521 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca <4 x double>, align 32, addrspace(5)
522 ; CHECK-NEXT: [[TMP0:%.*]] = call contract <4 x double> @_Z6sincosDv4_dPU3AS5S_(<4 x double> [[X]], ptr addrspace(5) [[__SINCOS_]])
523 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x double>, ptr addrspace(5) [[__SINCOS_]], align 32
524 ; CHECK-NEXT: store <4 x double> [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 32
525 ; CHECK-NEXT: store <4 x double> [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 32
526 ; CHECK-NEXT: ret void
529 %call = tail call contract <4 x double> @_Z3sinDv4_d(<4 x double> %x)
530 store <4 x double> %call, ptr addrspace(1) %sin_out, align 32
531 %call1 = tail call contract <4 x double> @_Z3cosDv4_d(<4 x double> %x)
532 store <4 x double> %call1, ptr addrspace(1) %cos_out, align 32
536 define void @sincos_v8f64(<8 x double> %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
537 ; CHECK-LABEL: define void @sincos_v8f64
538 ; CHECK-SAME: (<8 x double> [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr {
540 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca <8 x double>, align 64, addrspace(5)
541 ; CHECK-NEXT: [[TMP0:%.*]] = call contract <8 x double> @_Z6sincosDv8_dPU3AS5S_(<8 x double> [[X]], ptr addrspace(5) [[__SINCOS_]])
542 ; CHECK-NEXT: [[TMP1:%.*]] = load <8 x double>, ptr addrspace(5) [[__SINCOS_]], align 64
543 ; CHECK-NEXT: store <8 x double> [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 64
544 ; CHECK-NEXT: store <8 x double> [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 64
545 ; CHECK-NEXT: ret void
548 %call = tail call contract <8 x double> @_Z3sinDv8_d(<8 x double> %x)
549 store <8 x double> %call, ptr addrspace(1) %sin_out, align 64
550 %call1 = tail call contract <8 x double> @_Z3cosDv8_d(<8 x double> %x)
551 store <8 x double> %call1, ptr addrspace(1) %cos_out, align 64
555 define void @sincos_v16f64(<16 x double> %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
556 ; CHECK-LABEL: define void @sincos_v16f64
557 ; CHECK-SAME: (<16 x double> [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr {
559 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca <16 x double>, align 128, addrspace(5)
560 ; CHECK-NEXT: [[TMP0:%.*]] = call contract <16 x double> @_Z6sincosDv16_dPU3AS5S_(<16 x double> [[X]], ptr addrspace(5) [[__SINCOS_]])
561 ; CHECK-NEXT: [[TMP1:%.*]] = load <16 x double>, ptr addrspace(5) [[__SINCOS_]], align 128
562 ; CHECK-NEXT: store <16 x double> [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 128
563 ; CHECK-NEXT: store <16 x double> [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 128
564 ; CHECK-NEXT: ret void
567 %call = tail call contract <16 x double> @_Z3sinDv16_d(<16 x double> %x)
568 store <16 x double> %call, ptr addrspace(1) %sin_out, align 128
569 %call1 = tail call contract <16 x double> @_Z3cosDv16_d(<16 x double> %x)
570 store <16 x double> %call1, ptr addrspace(1) %cos_out, align 128
576 define void @sincos_f32_different_blocks(i1 %cond, float %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
577 ; CHECK-LABEL: define void @sincos_f32_different_blocks
578 ; CHECK-SAME: (i1 [[COND:%.*]], float [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR3]] {
580 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5)
581 ; CHECK-NEXT: [[TMP0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[__SINCOS_]])
582 ; CHECK-NEXT: br i1 [[COND]], label [[BB0:%.*]], label [[BB1:%.*]]
584 ; CHECK-NEXT: ret void
586 ; CHECK-NEXT: store float [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 4
587 ; CHECK-NEXT: br label [[COMMON_RET:%.*]]
589 ; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr addrspace(5) [[__SINCOS_]], align 4
590 ; CHECK-NEXT: store float [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 4
591 ; CHECK-NEXT: br label [[COMMON_RET]]
594 br i1 %cond, label %bb0, label %bb1
597 %call = tail call contract float @_Z3sinf(float %x)
598 store float %call, ptr addrspace(1) %sin_out, align 4
602 %call1 = tail call contract float @_Z3cosf(float %x)
603 store float %call1, ptr addrspace(1) %cos_out, align 4
607 ; The sin and cos are in different blocks but always execute
608 define void @sincos_f32_different_blocks_dominating_always_execute(i1 %cond, float %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out, ptr addrspace(1) %other) {
609 ; CHECK-LABEL: define void @sincos_f32_different_blocks_dominating_always_execute
610 ; CHECK-SAME: (i1 [[COND:%.*]], float [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[OTHER:%.*]]) local_unnamed_addr #[[ATTR3]] {
612 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5)
613 ; CHECK-NEXT: [[TMP0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[__SINCOS_]])
614 ; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr addrspace(5) [[__SINCOS_]], align 4
615 ; CHECK-NEXT: store float [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 4
616 ; CHECK-NEXT: br i1 [[COND]], label [[BB0:%.*]], label [[BB1:%.*]]
618 ; CHECK-NEXT: store i32 0, ptr addrspace(1) [[OTHER]], align 4
619 ; CHECK-NEXT: br label [[BB1]]
621 ; CHECK-NEXT: store float [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 4
622 ; CHECK-NEXT: ret void
625 %call = tail call contract float @_Z3sinf(float %x)
626 store float %call, ptr addrspace(1) %sin_out, align 4
627 br i1 %cond, label %bb0, label %bb1
630 store i32 0, ptr addrspace(1) %other
634 %call1 = tail call contract float @_Z3cosf(float %x)
635 store float %call1, ptr addrspace(1) %cos_out, align 4
639 ; sin dominates cos but cos doesn't always execute.
640 define void @sincos_f32_different_blocks_dominating_conditional_execute(i1 %cond, float %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out, ptr addrspace(1) %other) {
641 ; CHECK-LABEL: define void @sincos_f32_different_blocks_dominating_conditional_execute
642 ; CHECK-SAME: (i1 [[COND:%.*]], float [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]], ptr addrspace(1) nocapture readnone [[OTHER:%.*]]) local_unnamed_addr #[[ATTR3]] {
644 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5)
645 ; CHECK-NEXT: [[TMP0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[__SINCOS_]])
646 ; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr addrspace(5) [[__SINCOS_]], align 4
647 ; CHECK-NEXT: store float [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 4
648 ; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[COND]], float [[TMP1]], float 0.000000e+00
649 ; CHECK-NEXT: store float [[SPEC_SELECT]], ptr addrspace(1) [[COS_OUT]], align 4
650 ; CHECK-NEXT: ret void
653 %call = tail call contract float @_Z3sinf(float %x)
654 store float %call, ptr addrspace(1) %sin_out, align 4
655 br i1 %cond, label %bb0, label %bb1
658 %call1 = tail call contract float @_Z3cosf(float %x)
662 %phi = phi float [%call1, %bb0], [0.0, %entry]
663 store float %phi, ptr addrspace(1) %cos_out, align 4
667 define float @select_sin_or_cos_f32(i1 %cond, float %x) {
668 ; CHECK-LABEL: define float @select_sin_or_cos_f32
669 ; CHECK-SAME: (i1 [[COND:%.*]], float [[X:%.*]]) local_unnamed_addr #[[ATTR4:[0-9]+]] {
671 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5)
672 ; CHECK-NEXT: [[TMP0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[__SINCOS_]])
673 ; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr addrspace(5) [[__SINCOS_]], align 4
674 ; CHECK-NEXT: [[SELECT:%.*]] = select i1 [[COND]], float [[TMP0]], float [[TMP1]]
675 ; CHECK-NEXT: ret float [[SELECT]]
678 %sin = tail call contract float @_Z3sinf(float %x)
679 %cos = tail call contract float @_Z3cosf(float %x)
680 %select = select i1 %cond, float %sin, float %cos
684 declare void @func(ptr addrspace(1))
686 define void @sincos_f32_value_is_instr(ptr addrspace(1) %value.ptr, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
687 ; CHECK-LABEL: define void @sincos_f32_value_is_instr
688 ; CHECK-SAME: (ptr addrspace(1) [[VALUE_PTR:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr {
690 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5)
691 ; CHECK-NEXT: tail call void @func(ptr addrspace(1) [[VALUE_PTR]])
692 ; CHECK-NEXT: [[X:%.*]] = load float, ptr addrspace(1) [[VALUE_PTR]], align 4
693 ; CHECK-NEXT: [[TMP0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[__SINCOS_]])
694 ; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr addrspace(5) [[__SINCOS_]], align 4
695 ; CHECK-NEXT: store float [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 4
696 ; CHECK-NEXT: store float [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 4
697 ; CHECK-NEXT: ret void
700 call void @func(ptr addrspace(1) %value.ptr)
701 %x = load float, ptr addrspace(1) %value.ptr
702 %call = tail call contract float @_Z3sinf(float %x)
703 store float %call, ptr addrspace(1) %sin_out, align 4
704 %call1 = tail call contract float @_Z3cosf(float %x)
705 store float %call1, ptr addrspace(1) %cos_out, align 4
709 define void @sincos_f32_value_is_same_constexpr(ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
710 ; CHECK-LABEL: define void @sincos_f32_value_is_same_constexpr
711 ; CHECK-SAME: (ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR3]] {
713 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5)
714 ; CHECK-NEXT: [[TMP0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float bitcast (i32 ptrtoint (ptr @func to i32) to float), ptr addrspace(5) [[__SINCOS_]])
715 ; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr addrspace(5) [[__SINCOS_]], align 4
716 ; CHECK-NEXT: store float [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 4
717 ; CHECK-NEXT: store float [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 4
718 ; CHECK-NEXT: ret void
721 %call = tail call contract float @_Z3sinf(float bitcast (i32 ptrtoint (ptr @func to i32) to float))
722 store float %call, ptr addrspace(1) %sin_out, align 4
723 %call1 = tail call contract float @_Z3cosf(float bitcast (i32 ptrtoint (ptr @func to i32) to float))
724 store float %call1, ptr addrspace(1) %cos_out, align 4
728 define void @sincos_f32_value_is_different_constexpr(ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
729 ; CHECK-LABEL: define void @sincos_f32_value_is_different_constexpr
730 ; CHECK-SAME: (ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) #[[ATTR2]] {
732 ; CHECK-NEXT: [[CALL:%.*]] = tail call contract float @_Z3sinf(float bitcast (i32 ptrtoint (ptr @func to i32) to float))
733 ; CHECK-NEXT: store float [[CALL]], ptr addrspace(1) [[SIN_OUT]], align 4
734 ; CHECK-NEXT: [[CALL1:%.*]] = tail call contract float @_Z3cosf(float bitcast (i32 ptrtoint (ptr @sincos_f32_value_is_different_constexpr to i32) to float))
735 ; CHECK-NEXT: store float [[CALL1]], ptr addrspace(1) [[COS_OUT]], align 4
736 ; CHECK-NEXT: ret void
739 %call = tail call contract float @_Z3sinf(float bitcast (i32 ptrtoint (ptr @func to i32) to float))
740 store float %call, ptr addrspace(1) %sin_out, align 4
741 %call1 = tail call contract float @_Z3cosf(float bitcast (i32 ptrtoint (ptr @sincos_f32_value_is_different_constexpr to i32) to float))
742 store float %call1, ptr addrspace(1) %cos_out, align 4
746 define void @sincos_f32_value_is_same_constantfp(ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
747 ; CHECK-LABEL: define void @sincos_f32_value_is_same_constantfp
748 ; CHECK-SAME: (ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR3]] {
750 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5)
751 ; CHECK-NEXT: [[TMP0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float 4.200000e+01, ptr addrspace(5) [[__SINCOS_]])
752 ; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr addrspace(5) [[__SINCOS_]], align 4
753 ; CHECK-NEXT: store float [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 4
754 ; CHECK-NEXT: store float [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 4
755 ; CHECK-NEXT: ret void
758 %call = tail call contract float @_Z3sinf(float 42.0)
759 store float %call, ptr addrspace(1) %sin_out, align 4
760 %call1 = tail call contract float @_Z3cosf(float 42.0)
761 store float %call1, ptr addrspace(1) %cos_out, align 4
765 define void @sincos_f32_value_is_different_constantfp(ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
766 ; CHECK-LABEL: define void @sincos_f32_value_is_different_constantfp
767 ; CHECK-SAME: (ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR2]] {
769 ; CHECK-NEXT: [[CALL:%.*]] = tail call contract float @_Z3sinf(float 4.200000e+01)
770 ; CHECK-NEXT: store float [[CALL]], ptr addrspace(1) [[SIN_OUT]], align 4
771 ; CHECK-NEXT: [[CALL1:%.*]] = tail call contract float @_Z3cosf(float 4.250000e+01)
772 ; CHECK-NEXT: store float [[CALL1]], ptr addrspace(1) [[COS_OUT]], align 4
773 ; CHECK-NEXT: ret void
776 %call = tail call contract float @_Z3sinf(float 42.0)
777 store float %call, ptr addrspace(1) %sin_out, align 4
778 %call1 = tail call contract float @_Z3cosf(float 42.5)
779 store float %call1, ptr addrspace(1) %cos_out, align 4
783 define void @sincos_f32_different_args(float %x, float %y, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
784 ; CHECK-LABEL: define void @sincos_f32_different_args
785 ; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR2]] {
787 ; CHECK-NEXT: [[CALL:%.*]] = tail call contract float @_Z3sinf(float [[X]])
788 ; CHECK-NEXT: store float [[CALL]], ptr addrspace(1) [[SIN_OUT]], align 4
789 ; CHECK-NEXT: [[CALL1:%.*]] = tail call contract float @_Z3cosf(float [[Y]])
790 ; CHECK-NEXT: store float [[CALL1]], ptr addrspace(1) [[COS_OUT]], align 4
791 ; CHECK-NEXT: ret void
794 %call = tail call contract float @_Z3sinf(float %x)
795 store float %call, ptr addrspace(1) %sin_out, align 4
796 %call1 = tail call contract float @_Z3cosf(float %y)
797 store float %call1, ptr addrspace(1) %cos_out, align 4
801 define void @sincos_f32_flag_intersect0(float %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
802 ; CHECK-LABEL: define void @sincos_f32_flag_intersect0
803 ; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR3]] {
805 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5)
806 ; CHECK-NEXT: [[TMP0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[__SINCOS_]])
807 ; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr addrspace(5) [[__SINCOS_]], align 4
808 ; CHECK-NEXT: store float [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 4
809 ; CHECK-NEXT: store float [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 4
810 ; CHECK-NEXT: ret void
813 %call = tail call nnan contract float @_Z3sinf(float %x)
814 store float %call, ptr addrspace(1) %sin_out, align 4
815 %call1 = tail call ninf contract float @_Z3cosf(float %x)
816 store float %call1, ptr addrspace(1) %cos_out, align 4
820 define void @sincos_f32_flag_intersect1(float %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
821 ; CHECK-LABEL: define void @sincos_f32_flag_intersect1
822 ; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR3]] {
824 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5)
825 ; CHECK-NEXT: [[TMP0:%.*]] = call nnan contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[__SINCOS_]])
826 ; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr addrspace(5) [[__SINCOS_]], align 4
827 ; CHECK-NEXT: store float [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 4
828 ; CHECK-NEXT: store float [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 4
829 ; CHECK-NEXT: ret void
832 %call = tail call nnan nsz contract float @_Z3sinf(float %x)
833 store float %call, ptr addrspace(1) %sin_out, align 4
834 %call1 = tail call nnan ninf contract float @_Z3cosf(float %x)
835 store float %call1, ptr addrspace(1) %cos_out, align 4
839 define void @sincos_v2f32_flag_intersect1(<2 x float> %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
840 ; CHECK-LABEL: define void @sincos_v2f32_flag_intersect1
841 ; CHECK-SAME: (<2 x float> [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr {
843 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca <2 x float>, align 8, addrspace(5)
844 ; CHECK-NEXT: [[TMP0:%.*]] = call nnan contract <2 x float> @_Z6sincosDv2_fPU3AS5S_(<2 x float> [[X]], ptr addrspace(5) [[__SINCOS_]])
845 ; CHECK-NEXT: [[TMP1:%.*]] = load <2 x float>, ptr addrspace(5) [[__SINCOS_]], align 8
846 ; CHECK-NEXT: store <2 x float> [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 8
847 ; CHECK-NEXT: store <2 x float> [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 8
848 ; CHECK-NEXT: ret void
851 %call = tail call contract ninf nnan <2 x float> @_Z3sinDv2_f(<2 x float> %x)
852 store <2 x float> %call, ptr addrspace(1) %sin_out, align 8
853 %call1 = tail call contract nsz nnan <2 x float> @_Z3cosDv2_f(<2 x float> %x)
854 store <2 x float> %call1, ptr addrspace(1) %cos_out, align 8
858 declare void @use_stack_ptrs(ptr addrspace(5), ptr addrspace(5))
860 define void @sincos_f32_alloca_insertpt(float %x) {
861 ; CHECK-LABEL: define void @sincos_f32_alloca_insertpt
862 ; CHECK-SAME: (float [[X:%.*]]) local_unnamed_addr {
864 ; CHECK-NEXT: [[ALLOCA0:%.*]] = alloca i32, align 4, addrspace(5)
865 ; CHECK-NEXT: [[ALLOCA1:%.*]] = alloca i32, align 4, addrspace(5)
866 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5)
867 ; CHECK-NEXT: [[TMP0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[__SINCOS_]])
868 ; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr addrspace(5) [[__SINCOS_]], align 4
869 ; CHECK-NEXT: store float [[TMP0]], ptr addrspace(5) [[ALLOCA0]], align 4
870 ; CHECK-NEXT: store float [[TMP1]], ptr addrspace(5) [[ALLOCA1]], align 4
871 ; CHECK-NEXT: call void @use_stack_ptrs(ptr addrspace(5) [[ALLOCA0]], ptr addrspace(5) [[ALLOCA1]])
872 ; CHECK-NEXT: ret void
875 %alloca0 = alloca i32, addrspace(5)
876 %alloca1 = alloca i32, addrspace(5)
877 %sin = tail call contract float @_Z3sinf(float %x)
878 %cos = tail call contract float @_Z3cosf(float %x)
879 store float %sin, ptr addrspace(5) %alloca0
880 store float %cos, ptr addrspace(5) %alloca1
881 call void @use_stack_ptrs(ptr addrspace(5) %alloca0, ptr addrspace(5) %alloca1)
885 define float @sincos_f32_unused_result_cos(float %x) {
886 ; CHECK-LABEL: define float @sincos_f32_unused_result_cos
887 ; CHECK-SAME: (float [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
889 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5)
890 ; CHECK-NEXT: [[TMP0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[__SINCOS_]])
891 ; CHECK-NEXT: ret float [[TMP0]]
894 %alloca0 = alloca i32, addrspace(5)
895 %alloca1 = alloca i32, addrspace(5)
896 %sin = tail call contract float @_Z3sinf(float %x)
897 %dead = tail call contract float @_Z3cosf(float %x)
901 define float @sincos_f32_unused_result_sin(float %x) {
902 ; CHECK-LABEL: define float @sincos_f32_unused_result_sin
903 ; CHECK-SAME: (float [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
905 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5)
906 ; CHECK-NEXT: [[TMP0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[__SINCOS_]])
907 ; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr addrspace(5) [[__SINCOS_]], align 4
908 ; CHECK-NEXT: ret float [[TMP1]]
911 %alloca0 = alloca i32, addrspace(5)
912 %alloca1 = alloca i32, addrspace(5)
913 %dead = tail call contract float @_Z3sinf(float %x)
914 %cos = tail call contract float @_Z3cosf(float %x)
918 define void @sincos_f32_repeated_uses(float %x, ptr addrspace(1) %sin_out, ptr addrspace(1) %cos_out) {
919 ; CHECK-LABEL: define void @sincos_f32_repeated_uses
920 ; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) [[SIN_OUT:%.*]], ptr addrspace(1) [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR5:[0-9]+]] {
922 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5)
923 ; CHECK-NEXT: [[__SINCOS_3:%.*]] = alloca float, align 4, addrspace(5)
924 ; CHECK-NEXT: [[TMP0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[__SINCOS_3]])
925 ; CHECK-NEXT: [[TMP1:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[__SINCOS_]])
926 ; CHECK-NEXT: [[TMP2:%.*]] = load float, ptr addrspace(5) [[__SINCOS_]], align 4
927 ; CHECK-NEXT: store volatile float [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 4
928 ; CHECK-NEXT: store volatile float [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 4
929 ; CHECK-NEXT: store volatile float [[TMP2]], ptr addrspace(1) [[COS_OUT]], align 4
930 ; CHECK-NEXT: store volatile float [[TMP2]], ptr addrspace(1) [[COS_OUT]], align 4
931 ; CHECK-NEXT: store volatile float [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 4
932 ; CHECK-NEXT: ret void
935 %sin0 = tail call contract float @_Z3sinf(float %x)
936 store volatile float %sin0, ptr addrspace(1) %sin_out, align 4
938 %sin1 = tail call contract float @_Z3sinf(float %x)
939 store volatile float %sin1, ptr addrspace(1) %sin_out, align 4
941 %cos0 = tail call contract float @_Z3cosf(float %x)
942 store volatile float %cos0, ptr addrspace(1) %cos_out, align 4
944 %cos1 = tail call contract float @_Z3cosf(float %x)
945 store volatile float %cos1, ptr addrspace(1) %cos_out, align 4
947 %sin2 = tail call contract float @_Z3sinf(float %x)
948 store volatile float %sin2, ptr addrspace(1) %sin_out, align 4
953 define void @sin_f32_indirect_call_user(float %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out, ptr %func.ptr) {
954 ; CHECK-LABEL: define void @sin_f32_indirect_call_user
955 ; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]], ptr nocapture readonly [[FUNC_PTR:%.*]]) local_unnamed_addr {
957 ; CHECK-NEXT: [[CALL:%.*]] = tail call contract float @_Z3sinf(float [[X]])
958 ; CHECK-NEXT: store float [[CALL]], ptr addrspace(1) [[SIN_OUT]], align 4
959 ; CHECK-NEXT: [[CALL1:%.*]] = tail call contract float [[FUNC_PTR]](float [[X]])
960 ; CHECK-NEXT: store float [[CALL1]], ptr addrspace(1) [[COS_OUT]], align 4
961 ; CHECK-NEXT: ret void
964 %call = tail call contract float @_Z3sinf(float %x)
965 store float %call, ptr addrspace(1) %sin_out, align 4
966 %call1 = tail call contract float %func.ptr(float %x)
967 store float %call1, ptr addrspace(1) %cos_out, align 4
971 define void @cos_f32_indirect_call_user(float %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out, ptr %func.ptr) {
972 ; CHECK-LABEL: define void @cos_f32_indirect_call_user
973 ; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]], ptr nocapture readonly [[FUNC_PTR:%.*]]) local_unnamed_addr {
975 ; CHECK-NEXT: [[CALL:%.*]] = tail call contract float @_Z3cosf(float [[X]])
976 ; CHECK-NEXT: store float [[CALL]], ptr addrspace(1) [[COS_OUT]], align 4
977 ; CHECK-NEXT: [[CALL1:%.*]] = tail call contract float [[FUNC_PTR]](float [[X]])
978 ; CHECK-NEXT: store float [[CALL1]], ptr addrspace(1) [[SIN_OUT]], align 4
979 ; CHECK-NEXT: ret void
982 %call = tail call contract float @_Z3cosf(float %x)
983 store float %call, ptr addrspace(1) %cos_out, align 4
984 %call1 = tail call contract float %func.ptr(float %x)
985 store float %call1, ptr addrspace(1) %sin_out, align 4
989 define void @sincos_f32_preserve_fpmath_0(float %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
990 ; CHECK-LABEL: define void @sincos_f32_preserve_fpmath_0
991 ; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR3]] {
993 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5)
994 ; CHECK-NEXT: [[TMP0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[__SINCOS_]]), !fpmath !5
995 ; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr addrspace(5) [[__SINCOS_]], align 4
996 ; CHECK-NEXT: store float [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 4
997 ; CHECK-NEXT: store float [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 4
998 ; CHECK-NEXT: ret void
1001 %call = tail call contract float @_Z3sinf(float %x), !fpmath !5
1002 store float %call, ptr addrspace(1) %sin_out, align 4
1003 %call1 = tail call contract float @_Z3cosf(float %x), !fpmath !5
1004 store float %call1, ptr addrspace(1) %cos_out, align 4
1008 define void @sincos_f32_preserve_fpmath_1(float %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
1009 ; CHECK-LABEL: define void @sincos_f32_preserve_fpmath_1
1010 ; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR3]] {
1011 ; CHECK-NEXT: entry:
1012 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5)
1013 ; CHECK-NEXT: [[TMP0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[__SINCOS_]]), !fpmath !6
1014 ; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr addrspace(5) [[__SINCOS_]], align 4
1015 ; CHECK-NEXT: store float [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 4
1016 ; CHECK-NEXT: store float [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 4
1017 ; CHECK-NEXT: ret void
1020 %call = tail call contract float @_Z3sinf(float %x), !fpmath !5
1021 store float %call, ptr addrspace(1) %sin_out, align 4
1022 %call1 = tail call contract float @_Z3cosf(float %x), !fpmath !6
1023 store float %call1, ptr addrspace(1) %cos_out, align 4
1027 ; Should drop the metadata
1028 define void @sincos_f32_drop_fpmath(float %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) {
1029 ; CHECK-LABEL: define void @sincos_f32_drop_fpmath
1030 ; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR3]] {
1031 ; CHECK-NEXT: entry:
1032 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5)
1033 ; CHECK-NEXT: [[TMP0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[__SINCOS_]])
1034 ; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr addrspace(5) [[__SINCOS_]], align 4
1035 ; CHECK-NEXT: store float [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 4
1036 ; CHECK-NEXT: store float [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 4
1037 ; CHECK-NEXT: ret void
1040 %call = tail call contract float @_Z3sinf(float %x), !fpmath !5
1041 store float %call, ptr addrspace(1) %sin_out, align 4
1042 %call1 = tail call contract float @_Z3cosf(float %x)
1043 store float %call1, ptr addrspace(1) %cos_out, align 4
1047 define void @sincos_f32_debuginfo(float %x, ptr addrspace(1) nocapture writeonly %sin_out, ptr addrspace(1) nocapture writeonly %cos_out) !dbg !15 {
1048 ; CHECK-LABEL: define void @sincos_f32_debuginfo
1049 ; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR3]] !dbg [[DBG7:![0-9]+]] {
1050 ; CHECK-NEXT: entry:
1051 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5), !dbg [[DBG14:![0-9]+]]
1052 ; CHECK-NEXT: [[TMP0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[__SINCOS_]]), !dbg [[DBG14]]
1053 ; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr addrspace(5) [[__SINCOS_]], align 4, !dbg [[DBG14]]
1054 ; CHECK-NEXT: call void @llvm.dbg.value(metadata float [[TMP0]], metadata [[META11:![0-9]+]], metadata !DIExpression()), !dbg [[DBG15:![0-9]+]]
1055 ; CHECK-NEXT: store float [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 4, !dbg [[DBG16:![0-9]+]]
1056 ; CHECK-NEXT: call void @llvm.dbg.value(metadata float [[TMP1]], metadata [[META13:![0-9]+]], metadata !DIExpression()), !dbg [[DBG17:![0-9]+]]
1057 ; CHECK-NEXT: store float [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 4, !dbg [[DBG18:![0-9]+]]
1058 ; CHECK-NEXT: ret void, !dbg [[DBG19:![0-9]+]]
1061 %call = tail call contract float @_Z3sinf(float %x), !dbg !19
1062 call void @llvm.dbg.value(metadata float %call, metadata !17, metadata !DIExpression()), !dbg !19
1063 store float %call, ptr addrspace(1) %sin_out, align 4, !dbg !20
1064 %call1 = tail call contract float @_Z3cosf(float %x), !dbg !21
1065 call void @llvm.dbg.value(metadata float %call1, metadata !18, metadata !DIExpression()), !dbg !21
1066 store float %call1, ptr addrspace(1) %cos_out, align 4, !dbg !22
1070 define float @sin_sincos_private_f32(float %x, ptr addrspace(1) %sin_out, ptr addrspace(1) %cos_out) {
1071 ; CHECK-LABEL: define float @sin_sincos_private_f32
1072 ; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR3]] {
1073 ; CHECK-NEXT: entry:
1074 ; CHECK-NEXT: [[COS_TMP:%.*]] = alloca float, align 4, addrspace(5)
1075 ; CHECK-NEXT: [[SIN0:%.*]] = tail call nnan ninf nsz contract float @_Z3sinf(float [[X]]), !fpmath !5
1076 ; CHECK-NEXT: store float [[SIN0]], ptr addrspace(1) [[SIN_OUT]], align 4
1077 ; CHECK-NEXT: [[SIN1:%.*]] = call nnan contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[COS_TMP]]), !fpmath !6
1078 ; CHECK-NEXT: [[COS1:%.*]] = load float, ptr addrspace(5) [[COS_TMP]], align 4
1079 ; CHECK-NEXT: store float [[COS1]], ptr addrspace(1) [[COS_OUT]], align 4
1080 ; CHECK-NEXT: ret float [[SIN1]]
1083 %cos.tmp = alloca float, addrspace(5)
1084 %sin0 = tail call nsz ninf nnan contract float @_Z3sinf(float %x), !fpmath !5
1085 store float %sin0, ptr addrspace(1) %sin_out, align 4
1086 %sin1 = call contract nnan float @_Z6sincosfPU3AS5f(float %x, ptr addrspace(5) %cos.tmp), !fpmath !6
1087 %cos1 = load float, ptr addrspace(5) %cos.tmp
1088 store float %cos1, ptr addrspace(1) %cos_out, align 4
1092 define float @sin_sincos_generic_f32(float %x, ptr addrspace(1) %sin_out, ptr addrspace(1) %cos_out) {
1093 ; CHECK-LABEL: define float @sin_sincos_generic_f32
1094 ; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR3]] {
1095 ; CHECK-NEXT: entry:
1096 ; CHECK-NEXT: [[COS_TMP:%.*]] = alloca float, align 4, addrspace(5)
1097 ; CHECK-NEXT: [[SIN0:%.*]] = tail call nsz contract float @_Z3sinf(float [[X]]), !fpmath !5
1098 ; CHECK-NEXT: store float [[SIN0]], ptr addrspace(1) [[SIN_OUT]], align 4
1099 ; CHECK-NEXT: [[COS_TMP_CAST:%.*]] = addrspacecast ptr addrspace(5) [[COS_TMP]] to ptr
1100 ; CHECK-NEXT: [[SIN1:%.*]] = call ninf nsz contract float @_Z6sincosfPU3AS0f(float [[X]], ptr [[COS_TMP_CAST]]), !fpmath !6
1101 ; CHECK-NEXT: [[COS1:%.*]] = load float, ptr addrspace(5) [[COS_TMP]], align 4
1102 ; CHECK-NEXT: store float [[COS1]], ptr addrspace(1) [[COS_OUT]], align 4
1103 ; CHECK-NEXT: ret float [[SIN1]]
1106 %cos.tmp = alloca float, addrspace(5)
1107 %sin0 = tail call nsz contract float @_Z3sinf(float %x), !fpmath !5
1108 store float %sin0, ptr addrspace(1) %sin_out, align 4
1109 %cos.tmp.cast = addrspacecast ptr addrspace(5) %cos.tmp to ptr
1110 %sin1 = call contract nsz ninf float @_Z6sincosfPU3AS0f(float %x, ptr %cos.tmp.cast), !fpmath !6
1111 %cos1 = load float, ptr addrspace(5) %cos.tmp
1112 store float %cos1, ptr addrspace(1) %cos_out, align 4
1116 define float @cos_sincos_private_f32(float %x, ptr addrspace(1) %sin_out, ptr addrspace(1) %cos_out) {
1117 ; CHECK-LABEL: define float @cos_sincos_private_f32
1118 ; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) nocapture readnone [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR3]] {
1119 ; CHECK-NEXT: entry:
1120 ; CHECK-NEXT: [[COS_TMP:%.*]] = alloca float, align 4, addrspace(5)
1121 ; CHECK-NEXT: [[COS0:%.*]] = tail call contract float @_Z3cosf(float [[X]])
1122 ; CHECK-NEXT: store float [[COS0]], ptr addrspace(1) [[COS_OUT]], align 4
1123 ; CHECK-NEXT: [[SIN1:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[COS_TMP]])
1124 ; CHECK-NEXT: [[COS1:%.*]] = load float, ptr addrspace(5) [[COS_TMP]], align 4
1125 ; CHECK-NEXT: store float [[COS1]], ptr addrspace(1) [[COS_OUT]], align 4
1126 ; CHECK-NEXT: ret float [[SIN1]]
1129 %cos.tmp = alloca float, addrspace(5)
1130 %cos0 = tail call contract float @_Z3cosf(float %x)
1131 store float %cos0, ptr addrspace(1) %cos_out, align 4
1132 %sin1 = call contract float @_Z6sincosfPU3AS5f(float %x, ptr addrspace(5) %cos.tmp)
1133 %cos1 = load float, ptr addrspace(5) %cos.tmp
1134 store float %cos1, ptr addrspace(1) %cos_out, align 4
1138 define float @cos_sincos_generic_f32(float %x, ptr addrspace(1) %sin_out, ptr addrspace(1) %cos_out) {
1139 ; CHECK-LABEL: define float @cos_sincos_generic_f32
1140 ; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) nocapture readnone [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR3]] {
1141 ; CHECK-NEXT: entry:
1142 ; CHECK-NEXT: [[COS_TMP:%.*]] = alloca float, align 4, addrspace(5)
1143 ; CHECK-NEXT: [[COS0:%.*]] = tail call contract float @_Z3cosf(float [[X]])
1144 ; CHECK-NEXT: store float [[COS0]], ptr addrspace(1) [[COS_OUT]], align 4
1145 ; CHECK-NEXT: [[COS_TMP_CAST:%.*]] = addrspacecast ptr addrspace(5) [[COS_TMP]] to ptr
1146 ; CHECK-NEXT: [[SIN1:%.*]] = call contract float @_Z6sincosfPU3AS0f(float [[X]], ptr [[COS_TMP_CAST]])
1147 ; CHECK-NEXT: [[COS1:%.*]] = load float, ptr addrspace(5) [[COS_TMP]], align 4
1148 ; CHECK-NEXT: store float [[COS1]], ptr addrspace(1) [[COS_OUT]], align 4
1149 ; CHECK-NEXT: ret float [[SIN1]]
1152 %cos.tmp = alloca float, addrspace(5)
1153 %cos0 = tail call contract float @_Z3cosf(float %x)
1154 store float %cos0, ptr addrspace(1) %cos_out, align 4
1155 %cos.tmp.cast = addrspacecast ptr addrspace(5) %cos.tmp to ptr
1156 %sin1 = call contract float @_Z6sincosfPU3AS0f(float %x, ptr %cos.tmp.cast)
1157 %cos1 = load float, ptr addrspace(5) %cos.tmp
1158 store float %cos1, ptr addrspace(1) %cos_out, align 4
1162 define float @sincos_private_f32_x2(float %x, ptr addrspace(1) %sin_out, ptr addrspace(1) %cos_out) {
1163 ; CHECK-LABEL: define float @sincos_private_f32_x2
1164 ; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) nocapture readnone [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR3]] {
1165 ; CHECK-NEXT: entry:
1166 ; CHECK-NEXT: [[COS_TMP0:%.*]] = alloca float, align 4, addrspace(5)
1167 ; CHECK-NEXT: [[COS_TMP1:%.*]] = alloca float, align 4, addrspace(5)
1168 ; CHECK-NEXT: [[SIN0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[COS_TMP0]])
1169 ; CHECK-NEXT: [[COS0:%.*]] = load float, ptr addrspace(5) [[COS_TMP0]], align 4
1170 ; CHECK-NEXT: store float [[COS0]], ptr addrspace(1) [[COS_OUT]], align 4
1171 ; CHECK-NEXT: [[SIN1:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[COS_TMP1]])
1172 ; CHECK-NEXT: [[COS1:%.*]] = load float, ptr addrspace(5) [[COS_TMP1]], align 4
1173 ; CHECK-NEXT: store float [[COS1]], ptr addrspace(1) [[COS_OUT]], align 4
1174 ; CHECK-NEXT: ret float [[SIN1]]
1177 %cos.tmp0 = alloca float, addrspace(5)
1178 %cos.tmp1 = alloca float, addrspace(5)
1180 %sin0 = call contract float @_Z6sincosfPU3AS5f(float %x, ptr addrspace(5) %cos.tmp0)
1181 %cos0 = load float, ptr addrspace(5) %cos.tmp0
1182 store float %cos0, ptr addrspace(1) %cos_out, align 4
1184 %sin1 = call contract float @_Z6sincosfPU3AS5f(float %x, ptr addrspace(5) %cos.tmp1)
1185 %cos1 = load float, ptr addrspace(5) %cos.tmp1
1186 store float %cos1, ptr addrspace(1) %cos_out, align 4
1190 define float @sincos_generic_f32_x2(float %x, ptr addrspace(1) %sin_out, ptr addrspace(1) %cos_out) {
1191 ; CHECK-LABEL: define float @sincos_generic_f32_x2
1192 ; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) nocapture readnone [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR3]] {
1193 ; CHECK-NEXT: entry:
1194 ; CHECK-NEXT: [[COS_TMP0:%.*]] = alloca float, align 4, addrspace(5)
1195 ; CHECK-NEXT: [[COS_TMP1:%.*]] = alloca float, align 4, addrspace(5)
1196 ; CHECK-NEXT: [[COS_TMP0_CAST:%.*]] = addrspacecast ptr addrspace(5) [[COS_TMP0]] to ptr
1197 ; CHECK-NEXT: [[SIN0:%.*]] = call contract float @_Z6sincosfPU3AS0f(float [[X]], ptr [[COS_TMP0_CAST]])
1198 ; CHECK-NEXT: [[COS0:%.*]] = load float, ptr addrspace(5) [[COS_TMP0]], align 4
1199 ; CHECK-NEXT: store float [[COS0]], ptr addrspace(1) [[COS_OUT]], align 4
1200 ; CHECK-NEXT: [[COS_TMP1_CAST:%.*]] = addrspacecast ptr addrspace(5) [[COS_TMP1]] to ptr
1201 ; CHECK-NEXT: [[SIN1:%.*]] = call contract float @_Z6sincosfPU3AS0f(float [[X]], ptr [[COS_TMP1_CAST]])
1202 ; CHECK-NEXT: store float [[COS0]], ptr addrspace(1) [[COS_OUT]], align 4
1203 ; CHECK-NEXT: ret float [[SIN1]]
1206 %cos.tmp0 = alloca float, addrspace(5)
1207 %cos.tmp1 = alloca float, addrspace(5)
1208 %cos.tmp0.cast = addrspacecast ptr addrspace(5) %cos.tmp0 to ptr
1209 %sin0 = call contract float @_Z6sincosfPU3AS0f(float %x, ptr %cos.tmp0.cast)
1210 %cos0 = load float, ptr addrspace(5) %cos.tmp0
1211 store float %cos0, ptr addrspace(1) %cos_out, align 4
1212 %cos.tmp1.cast = addrspacecast ptr addrspace(5) %cos.tmp1 to ptr
1213 %sin1 = call contract float @_Z6sincosfPU3AS0f(float %x, ptr %cos.tmp1.cast)
1214 %cos1 = load float, ptr addrspace(5) %cos.tmp0
1215 store float %cos1, ptr addrspace(1) %cos_out, align 4
1219 define float @sincos_generic_private_f32(float %x, ptr addrspace(1) %sin_out, ptr addrspace(1) %cos_out) {
1220 ; CHECK-LABEL: define float @sincos_generic_private_f32
1221 ; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) nocapture readnone [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR3]] {
1222 ; CHECK-NEXT: entry:
1223 ; CHECK-NEXT: [[COS_TMP0:%.*]] = alloca float, align 4, addrspace(5)
1224 ; CHECK-NEXT: [[COS_TMP1:%.*]] = alloca float, align 4, addrspace(5)
1225 ; CHECK-NEXT: [[SIN0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[COS_TMP0]])
1226 ; CHECK-NEXT: [[COS0:%.*]] = load float, ptr addrspace(5) [[COS_TMP0]], align 4
1227 ; CHECK-NEXT: store float [[COS0]], ptr addrspace(1) [[COS_OUT]], align 4
1228 ; CHECK-NEXT: [[COS_TMP1_CAST:%.*]] = addrspacecast ptr addrspace(5) [[COS_TMP1]] to ptr
1229 ; CHECK-NEXT: [[SIN1:%.*]] = call contract float @_Z6sincosfPU3AS0f(float [[X]], ptr [[COS_TMP1_CAST]])
1230 ; CHECK-NEXT: store float [[COS0]], ptr addrspace(1) [[COS_OUT]], align 4
1231 ; CHECK-NEXT: ret float [[SIN1]]
1234 %cos.tmp0 = alloca float, addrspace(5)
1235 %cos.tmp1 = alloca float, addrspace(5)
1236 %sin0 = call contract float @_Z6sincosfPU3AS5f(float %x, ptr addrspace(5) %cos.tmp0)
1237 %cos0 = load float, ptr addrspace(5) %cos.tmp0
1238 store float %cos0, ptr addrspace(1) %cos_out, align 4
1239 %cos.tmp1.cast = addrspacecast ptr addrspace(5) %cos.tmp1 to ptr
1240 %sin1 = call contract float @_Z6sincosfPU3AS0f(float %x, ptr %cos.tmp1.cast)
1241 %cos1 = load float, ptr addrspace(5) %cos.tmp0
1242 store float %cos1, ptr addrspace(1) %cos_out, align 4
1246 define float @sincos_mixed_sin_cos_generic_private_f32(float %x, ptr addrspace(1) %sin_out, ptr addrspace(1) %cos_out) {
1247 ; CHECK-LABEL: define float @sincos_mixed_sin_cos_generic_private_f32
1248 ; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) nocapture writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture writeonly [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR3]] {
1249 ; CHECK-NEXT: entry:
1250 ; CHECK-NEXT: [[COS_TMP0:%.*]] = alloca float, align 4, addrspace(5)
1251 ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5)
1252 ; CHECK-NEXT: [[TMP0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[__SINCOS_]])
1253 ; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr addrspace(5) [[__SINCOS_]], align 4
1254 ; CHECK-NEXT: [[SIN0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[COS_TMP0]])
1255 ; CHECK-NEXT: store float [[TMP0]], ptr addrspace(1) [[SIN_OUT]], align 4
1256 ; CHECK-NEXT: store float [[TMP1]], ptr addrspace(1) [[COS_OUT]], align 4
1257 ; CHECK-NEXT: [[COS2:%.*]] = load float, ptr addrspace(5) [[COS_TMP0]], align 4
1258 ; CHECK-NEXT: store float [[COS2]], ptr addrspace(1) [[COS_OUT]], align 4
1259 ; CHECK-NEXT: ret float [[TMP0]]
1262 %cos.tmp0 = alloca float, addrspace(5)
1263 %cos.tmp1 = alloca float, addrspace(5)
1264 %sin0 = call contract float @_Z6sincosfPU3AS5f(float %x, ptr addrspace(5) %cos.tmp0)
1265 %sin1 = call contract float @_Z3sinf(float %x)
1266 store float %sin1, ptr addrspace(1) %sin_out
1267 %cos0 = load float, ptr addrspace(5) %cos.tmp0
1268 store float %cos0, ptr addrspace(1) %cos_out, align 4
1269 %cos.tmp1.cast = addrspacecast ptr addrspace(5) %cos.tmp1 to ptr
1270 %cos1 = call contract float @_Z3cosf(float %x)
1271 store float %cos1, ptr addrspace(1) %cos_out, align 4
1272 %sin2 = call contract float @_Z6sincosfPU3AS0f(float %x, ptr %cos.tmp1.cast)
1273 %cos2 = load float, ptr addrspace(5) %cos.tmp0
1274 store float %cos2, ptr addrspace(1) %cos_out, align 4
1278 declare void @llvm.dbg.value(metadata, metadata, metadata) #0
1280 attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
1281 attributes #1 = { argmemonly nounwind willreturn }
1283 !llvm.dbg.cu = !{!0}
1284 !llvm.debugify = !{!2, !3}
1285 !llvm.module.flags = !{!4}
1287 !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)
1288 !1 = !DIFile(filename: "/tmp/arst.ll", directory: "/")
1291 !4 = !{i32 2, !"Debug Info Version", i32 3}
1292 !5 = !{float 4.000000e+00}
1293 !6 = !{float 2.000000e+00}
1294 !7 = !DILocation(line: 5, column: 1, scope: !8)
1295 !8 = distinct !DISubprogram(name: "sincos_f32_preserve_fpmath_1", linkageName: "sincos_f32_preserve_fpmath_1", scope: null, file: !1, line: 1, type: !9, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !11)
1296 !9 = !DISubroutineType(types: !10)
1299 !12 = !DILocalVariable(name: "1", scope: !8, file: !1, line: 1, type: !13)
1300 !13 = !DIBasicType(name: "ty32", size: 32, encoding: DW_ATE_unsigned)
1301 !14 = !DILocalVariable(name: "2", scope: !8, file: !1, line: 3, type: !13)
1302 !15 = distinct !DISubprogram(name: "sincos_f32_debuginfo", linkageName: "sincos_f32_debuginfo", scope: null, file: !1, line: 6, type: !9, scopeLine: 6, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !16)
1304 !17 = !DILocalVariable(name: "3", scope: !15, file: !1, line: 6, type: !13)
1305 !18 = !DILocalVariable(name: "4", scope: !15, file: !1, line: 8, type: !13)
1306 !19 = !DILocation(line: 6, column: 1, scope: !15)
1307 !20 = !DILocation(line: 7, column: 1, scope: !15)
1308 !21 = !DILocation(line: 8, column: 1, scope: !15)
1309 !22 = !DILocation(line: 9, column: 1, scope: !15)
1310 !23 = !DILocation(line: 10, column: 1, scope: !15)