Debian Codegraph @

clang/test/Headers/__clang_hip_math.hip

raw
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 6
2 // REQUIRES: amdgpu-registered-target
3 // REQUIRES: spirv-registered-target
4
5 // Test without OCML_BASIC_ROUNDED_OPERATIONS
6 // RUN: %clang_cc1 -include __clang_hip_runtime_wrapper.h \
7 // RUN: -internal-isystem %S/../../lib/Headers/cuda_wrappers \
8 // RUN: -internal-isystem %S/Inputs/include \
9 // RUN: -triple amdgcn-amd-amdhsa -aux-triple x86_64-unknown-unknown \
10 // RUN: -target-cpu gfx906 -emit-llvm %s -fcuda-is-device -O1 -o - \
11 // RUN: -D__HIPCC_RTC__ | FileCheck -check-prefixes=CHECK,DEFAULT %s
12
13 // Check that we end up with fast math flags set on intrinsic calls
14 // RUN: %clang_cc1 -include __clang_hip_runtime_wrapper.h \
15 // RUN: -internal-isystem %S/../../lib/Headers/cuda_wrappers \
16 // RUN: -internal-isystem %S/Inputs/include \
17 // RUN: -triple amdgcn-amd-amdhsa -aux-triple x86_64-unknown-unknown \
18 // RUN: -target-cpu gfx906 -emit-llvm %s -fcuda-is-device -O1 -menable-no-infs \
19 // RUN: -menable-no-nans -o - \
20 // RUN: -D__HIPCC_RTC__ | FileCheck -check-prefixes=CHECK,FINITEONLY %s
21
22 // Check that we end up with -fapprox-func set on intrinsic calls
23 // RUN: %clang_cc1 -include __clang_hip_runtime_wrapper.h \
24 // RUN: -internal-isystem %S/../../lib/Headers/cuda_wrappers \
25 // RUN: -internal-isystem %S/Inputs/include \
26 // RUN: -triple amdgcn-amd-amdhsa -aux-triple x86_64-unknown-unknown \
27 // RUN: -target-cpu gfx906 -emit-llvm %s -fcuda-is-device -O1 -fgpu-approx-transcendentals -o - \
28 // RUN: -D__HIPCC_RTC__ | FileCheck -check-prefixes=CHECK,APPROX %s
29
30 // Check that we end up with fpmath metadata set on sqrt calls
31 // RUN: %clang_cc1 -include __clang_hip_runtime_wrapper.h \
32 // RUN: -internal-isystem %S/../../lib/Headers/cuda_wrappers \
33 // RUN: -internal-isystem %S/Inputs/include \
34 // RUN: -triple amdgcn-amd-amdhsa -aux-triple x86_64-unknown-unknown \
35 // RUN: -target-cpu gfx906 -emit-llvm %s -fcuda-is-device -O1 -fno-hip-fp32-correctly-rounded-divide-sqrt -o - \
36 // RUN: -D__HIPCC_RTC__ | FileCheck -check-prefixes=CHECK,NCRDIV %s
37
38
39 // Check that we use the AMDGCNSPIRV address space map
40 // RUN: %clang_cc1 -include __clang_hip_runtime_wrapper.h \
41 // RUN: -internal-isystem %S/../../lib/Headers/cuda_wrappers \
42 // RUN: -internal-isystem %S/Inputs/include \
43 // RUN: -triple spirv64-amd-amdhsa -aux-triple x86_64-unknown-unknown \
44 // RUN: -emit-llvm %s -fcuda-is-device -O1 -o - \
45 // RUN: -D__HIPCC_RTC__ | FileCheck -check-prefixes=AMDGCNSPIRV %s
46
47 #define BOOL_TYPE int
48 typedef unsigned long long uint64_t;
49
50 // CHECK-LABEL: define dso_local i64 @test___make_mantissa_base8(
51 // CHECK-SAME: ptr noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] {
52 // CHECK-NEXT: [[ENTRY:.*]]:
53 // CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[P]], align 1, !tbaa [[CHAR_TBAA8:![0-9]+]]
54 // CHECK-NEXT: [[CMP_NOT_I1:%.*]] = icmp eq i8 [[TMP0]], 0
55 // CHECK-NEXT: br i1 [[CMP_NOT_I1]], label %[[_ZL21__MAKE_MANTISSA_BASE8PKC_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
56 // CHECK: [[WHILE_BODY_I]]:
57 // CHECK-NEXT: [[TMP1:%.*]] = phi i8 [ [[TMP3:%.*]], %[[IF_THEN_I:.*]] ], [ [[TMP0]], %[[ENTRY]] ]
58 // CHECK-NEXT: [[__R_0_I3:%.*]] = phi i64 [ [[SUB_I:%.*]], %[[IF_THEN_I]] ], [ 0, %[[ENTRY]] ]
59 // CHECK-NEXT: [[__TAGP_ADDR_0_I2:%.*]] = phi ptr [ [[INCDEC_PTR_I:%.*]], %[[IF_THEN_I]] ], [ [[P]], %[[ENTRY]] ]
60 // CHECK-NEXT: [[TMP2:%.*]] = and i8 [[TMP1]], -8
61 // CHECK-NEXT: [[OR_COND_I:%.*]] = icmp eq i8 [[TMP2]], 48
62 // CHECK-NEXT: br i1 [[OR_COND_I]], label %[[IF_THEN_I]], label %[[_ZL21__MAKE_MANTISSA_BASE8PKC_EXIT]]
63 // CHECK: [[IF_THEN_I]]:
64 // CHECK-NEXT: [[MUL_I:%.*]] = shl i64 [[__R_0_I3]], 3
65 // CHECK-NEXT: [[CONV5_I:%.*]] = zext nneg i8 [[TMP1]] to i64
66 // CHECK-NEXT: [[ADD_I:%.*]] = add i64 [[MUL_I]], -48
67 // CHECK-NEXT: [[SUB_I]] = add i64 [[ADD_I]], [[CONV5_I]]
68 // CHECK-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I2]], i64 1
69 // CHECK-NEXT: [[TMP3]] = load i8, ptr [[INCDEC_PTR_I]], align 1, !tbaa [[CHAR_TBAA8]]
70 // CHECK-NEXT: [[CMP_NOT_I:%.*]] = icmp eq i8 [[TMP3]], 0
71 // CHECK-NEXT: br i1 [[CMP_NOT_I]], label %[[_ZL21__MAKE_MANTISSA_BASE8PKC_EXIT]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP9:![0-9]+]]
72 // CHECK: [[_ZL21__MAKE_MANTISSA_BASE8PKC_EXIT]]:
73 // CHECK-NEXT: [[RETVAL_2_I:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ 0, %[[WHILE_BODY_I]] ], [ [[SUB_I]], %[[IF_THEN_I]] ]
74 // CHECK-NEXT: ret i64 [[RETVAL_2_I]]
75 //
76 // AMDGCNSPIRV-LABEL: define spir_func i64 @test___make_mantissa_base8(
77 // AMDGCNSPIRV-SAME: ptr addrspace(4) noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR2:[0-9]+]] {
78 // AMDGCNSPIRV-NEXT: [[ENTRY:.*]]:
79 // AMDGCNSPIRV-NEXT: br label %[[WHILE_COND_I:.*]]
80 // AMDGCNSPIRV: [[WHILE_COND_I]]:
81 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_0_I:%.*]] = phi ptr addrspace(4) [ [[P]], %[[ENTRY]] ], [ [[__TAGP_ADDR_1_I:%.*]], %[[WHILE_BODY_I:.*]] ]
82 // AMDGCNSPIRV-NEXT: [[__R_0_I:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[__R_1_I:%.*]], %[[WHILE_BODY_I]] ]
83 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = load i8, ptr addrspace(4) [[__TAGP_ADDR_0_I]], align 1, !tbaa [[CHAR_TBAA9:![0-9]+]]
84 // AMDGCNSPIRV-NEXT: [[CMP_NOT_I:%.*]] = icmp eq i8 [[TMP0]], 0
85 // AMDGCNSPIRV-NEXT: br i1 [[CMP_NOT_I]], label %[[_ZL21__MAKE_MANTISSA_BASE8PKC_EXIT:.*]], label %[[WHILE_BODY_I]]
86 // AMDGCNSPIRV: [[WHILE_BODY_I]]:
87 // AMDGCNSPIRV-NEXT: [[TMP1:%.*]] = and i8 [[TMP0]], -8
88 // AMDGCNSPIRV-NEXT: [[OR_COND_I:%.*]] = icmp eq i8 [[TMP1]], 48
89 // AMDGCNSPIRV-NEXT: [[MUL_I:%.*]] = shl i64 [[__R_0_I]], 3
90 // AMDGCNSPIRV-NEXT: [[CONV5_I:%.*]] = zext nneg i8 [[TMP0]] to i64
91 // AMDGCNSPIRV-NEXT: [[ADD_I:%.*]] = add i64 [[MUL_I]], -48
92 // AMDGCNSPIRV-NEXT: [[SUB_I:%.*]] = add i64 [[ADD_I]], [[CONV5_I]]
93 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_1_I_IDX:%.*]] = zext i1 [[OR_COND_I]] to i64
94 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_1_I]] = getelementptr inbounds nuw i8, ptr addrspace(4) [[__TAGP_ADDR_0_I]], i64 [[__TAGP_ADDR_1_I_IDX]]
95 // AMDGCNSPIRV-NEXT: [[__R_1_I]] = select i1 [[OR_COND_I]], i64 [[SUB_I]], i64 [[__R_0_I]]
96 // AMDGCNSPIRV-NEXT: br i1 [[OR_COND_I]], label %[[WHILE_COND_I]], label %[[_ZL21__MAKE_MANTISSA_BASE8PKC_EXIT]], !llvm.loop [[LOOP10:![0-9]+]]
97 // AMDGCNSPIRV: [[_ZL21__MAKE_MANTISSA_BASE8PKC_EXIT]]:
98 // AMDGCNSPIRV-NEXT: [[RETVAL_2_I:%.*]] = phi i64 [ 0, %[[WHILE_BODY_I]] ], [ [[__R_0_I]], %[[WHILE_COND_I]] ]
99 // AMDGCNSPIRV-NEXT: ret i64 [[RETVAL_2_I]]
100 //
101 extern "C" __device__ uint64_t test___make_mantissa_base8(const char *p) {
102 return __make_mantissa_base8(p);
103 }
104
105 // CHECK-LABEL: define dso_local i64 @test___make_mantissa_base10(
106 // CHECK-SAME: ptr noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr #[[ATTR2]] {
107 // CHECK-NEXT: [[ENTRY:.*]]:
108 // CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[P]], align 1, !tbaa [[CHAR_TBAA8]]
109 // CHECK-NEXT: [[CMP_NOT_I1:%.*]] = icmp eq i8 [[TMP0]], 0
110 // CHECK-NEXT: br i1 [[CMP_NOT_I1]], label %[[_ZL22__MAKE_MANTISSA_BASE10PKC_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
111 // CHECK: [[WHILE_BODY_I]]:
112 // CHECK-NEXT: [[TMP1:%.*]] = phi i8 [ [[TMP3:%.*]], %[[IF_THEN_I:.*]] ], [ [[TMP0]], %[[ENTRY]] ]
113 // CHECK-NEXT: [[__R_0_I3:%.*]] = phi i64 [ [[SUB_I:%.*]], %[[IF_THEN_I]] ], [ 0, %[[ENTRY]] ]
114 // CHECK-NEXT: [[__TAGP_ADDR_0_I2:%.*]] = phi ptr [ [[INCDEC_PTR_I:%.*]], %[[IF_THEN_I]] ], [ [[P]], %[[ENTRY]] ]
115 // CHECK-NEXT: [[TMP2:%.*]] = add i8 [[TMP1]], -48
116 // CHECK-NEXT: [[OR_COND_I:%.*]] = icmp ult i8 [[TMP2]], 10
117 // CHECK-NEXT: br i1 [[OR_COND_I]], label %[[IF_THEN_I]], label %[[_ZL22__MAKE_MANTISSA_BASE10PKC_EXIT]]
118 // CHECK: [[IF_THEN_I]]:
119 // CHECK-NEXT: [[MUL_I:%.*]] = mul i64 [[__R_0_I3]], 10
120 // CHECK-NEXT: [[CONV5_I:%.*]] = zext nneg i8 [[TMP1]] to i64
121 // CHECK-NEXT: [[ADD_I:%.*]] = add i64 [[MUL_I]], -48
122 // CHECK-NEXT: [[SUB_I]] = add i64 [[ADD_I]], [[CONV5_I]]
123 // CHECK-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I2]], i64 1
124 // CHECK-NEXT: [[TMP3]] = load i8, ptr [[INCDEC_PTR_I]], align 1, !tbaa [[CHAR_TBAA8]]
125 // CHECK-NEXT: [[CMP_NOT_I:%.*]] = icmp eq i8 [[TMP3]], 0
126 // CHECK-NEXT: br i1 [[CMP_NOT_I]], label %[[_ZL22__MAKE_MANTISSA_BASE10PKC_EXIT]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP12:![0-9]+]]
127 // CHECK: [[_ZL22__MAKE_MANTISSA_BASE10PKC_EXIT]]:
128 // CHECK-NEXT: [[RETVAL_2_I:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ 0, %[[WHILE_BODY_I]] ], [ [[SUB_I]], %[[IF_THEN_I]] ]
129 // CHECK-NEXT: ret i64 [[RETVAL_2_I]]
130 //
131 // AMDGCNSPIRV-LABEL: define spir_func i64 @test___make_mantissa_base10(
132 // AMDGCNSPIRV-SAME: ptr addrspace(4) noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR2]] {
133 // AMDGCNSPIRV-NEXT: [[ENTRY:.*]]:
134 // AMDGCNSPIRV-NEXT: br label %[[WHILE_COND_I:.*]]
135 // AMDGCNSPIRV: [[WHILE_COND_I]]:
136 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_0_I:%.*]] = phi ptr addrspace(4) [ [[P]], %[[ENTRY]] ], [ [[__TAGP_ADDR_1_I:%.*]], %[[WHILE_BODY_I:.*]] ]
137 // AMDGCNSPIRV-NEXT: [[__R_0_I:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[__R_1_I:%.*]], %[[WHILE_BODY_I]] ]
138 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = load i8, ptr addrspace(4) [[__TAGP_ADDR_0_I]], align 1, !tbaa [[CHAR_TBAA9]]
139 // AMDGCNSPIRV-NEXT: [[CMP_NOT_I:%.*]] = icmp eq i8 [[TMP0]], 0
140 // AMDGCNSPIRV-NEXT: br i1 [[CMP_NOT_I]], label %[[_ZL22__MAKE_MANTISSA_BASE10PKC_EXIT:.*]], label %[[WHILE_BODY_I]]
141 // AMDGCNSPIRV: [[WHILE_BODY_I]]:
142 // AMDGCNSPIRV-NEXT: [[TMP1:%.*]] = add i8 [[TMP0]], -48
143 // AMDGCNSPIRV-NEXT: [[OR_COND_I:%.*]] = icmp ult i8 [[TMP1]], 10
144 // AMDGCNSPIRV-NEXT: [[MUL_I:%.*]] = mul i64 [[__R_0_I]], 10
145 // AMDGCNSPIRV-NEXT: [[CONV5_I:%.*]] = zext nneg i8 [[TMP0]] to i64
146 // AMDGCNSPIRV-NEXT: [[ADD_I:%.*]] = add i64 [[MUL_I]], -48
147 // AMDGCNSPIRV-NEXT: [[SUB_I:%.*]] = add i64 [[ADD_I]], [[CONV5_I]]
148 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_1_I_IDX:%.*]] = zext i1 [[OR_COND_I]] to i64
149 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_1_I]] = getelementptr inbounds nuw i8, ptr addrspace(4) [[__TAGP_ADDR_0_I]], i64 [[__TAGP_ADDR_1_I_IDX]]
150 // AMDGCNSPIRV-NEXT: [[__R_1_I]] = select i1 [[OR_COND_I]], i64 [[SUB_I]], i64 [[__R_0_I]]
151 // AMDGCNSPIRV-NEXT: br i1 [[OR_COND_I]], label %[[WHILE_COND_I]], label %[[_ZL22__MAKE_MANTISSA_BASE10PKC_EXIT]], !llvm.loop [[LOOP13:![0-9]+]]
152 // AMDGCNSPIRV: [[_ZL22__MAKE_MANTISSA_BASE10PKC_EXIT]]:
153 // AMDGCNSPIRV-NEXT: [[RETVAL_2_I:%.*]] = phi i64 [ 0, %[[WHILE_BODY_I]] ], [ [[__R_0_I]], %[[WHILE_COND_I]] ]
154 // AMDGCNSPIRV-NEXT: ret i64 [[RETVAL_2_I]]
155 //
156 extern "C" __device__ uint64_t test___make_mantissa_base10(const char *p) {
157 return __make_mantissa_base10(p);
158 }
159
160 // CHECK-LABEL: define dso_local i64 @test___make_mantissa_base16(
161 // CHECK-SAME: ptr noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr #[[ATTR2]] {
162 // CHECK-NEXT: [[ENTRY:.*]]:
163 // CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[P]], align 1, !tbaa [[CHAR_TBAA8]]
164 // CHECK-NEXT: [[CMP_NOT_I1:%.*]] = icmp eq i8 [[TMP0]], 0
165 // CHECK-NEXT: br i1 [[CMP_NOT_I1]], label %[[_ZL22__MAKE_MANTISSA_BASE16PKC_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
166 // CHECK: [[WHILE_BODY_I]]:
167 // CHECK-NEXT: [[TMP1:%.*]] = phi i8 [ [[TMP5:%.*]], %[[IF_END31_I:.*]] ], [ [[TMP0]], %[[ENTRY]] ]
168 // CHECK-NEXT: [[__R_0_I3:%.*]] = phi i64 [ [[ADD28_I:%.*]], %[[IF_END31_I]] ], [ 0, %[[ENTRY]] ]
169 // CHECK-NEXT: [[__TAGP_ADDR_0_I2:%.*]] = phi ptr [ [[INCDEC_PTR_I:%.*]], %[[IF_END31_I]] ], [ [[P]], %[[ENTRY]] ]
170 // CHECK-NEXT: [[TMP2:%.*]] = add i8 [[TMP1]], -48
171 // CHECK-NEXT: [[OR_COND_I:%.*]] = icmp ult i8 [[TMP2]], 10
172 // CHECK-NEXT: br i1 [[OR_COND_I]], label %[[IF_END31_I]], label %[[IF_ELSE_I:.*]]
173 // CHECK: [[IF_ELSE_I]]:
174 // CHECK-NEXT: [[TMP3:%.*]] = add i8 [[TMP1]], -97
175 // CHECK-NEXT: [[OR_COND33_I:%.*]] = icmp ult i8 [[TMP3]], 6
176 // CHECK-NEXT: br i1 [[OR_COND33_I]], label %[[IF_END31_I]], label %[[IF_ELSE17_I:.*]]
177 // CHECK: [[IF_ELSE17_I]]:
178 // CHECK-NEXT: [[TMP4:%.*]] = add i8 [[TMP1]], -65
179 // CHECK-NEXT: [[OR_COND34_I:%.*]] = icmp ult i8 [[TMP4]], 6
180 // CHECK-NEXT: br i1 [[OR_COND34_I]], label %[[IF_END31_I]], label %[[_ZL22__MAKE_MANTISSA_BASE16PKC_EXIT]]
181 // CHECK: [[IF_END31_I]]:
182 // CHECK-NEXT: [[DOTSINK:%.*]] = phi i64 [ -87, %[[IF_ELSE_I]] ], [ -48, %[[WHILE_BODY_I]] ], [ -55, %[[IF_ELSE17_I]] ]
183 // CHECK-NEXT: [[MUL24_I:%.*]] = shl i64 [[__R_0_I3]], 4
184 // CHECK-NEXT: [[CONV25_I:%.*]] = zext nneg i8 [[TMP1]] to i64
185 // CHECK-NEXT: [[ADD26_I:%.*]] = add i64 [[MUL24_I]], [[DOTSINK]]
186 // CHECK-NEXT: [[ADD28_I]] = add i64 [[ADD26_I]], [[CONV25_I]]
187 // CHECK-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I2]], i64 1
188 // CHECK-NEXT: [[TMP5]] = load i8, ptr [[INCDEC_PTR_I]], align 1, !tbaa [[CHAR_TBAA8]]
189 // CHECK-NEXT: [[CMP_NOT_I:%.*]] = icmp eq i8 [[TMP5]], 0
190 // CHECK-NEXT: br i1 [[CMP_NOT_I]], label %[[_ZL22__MAKE_MANTISSA_BASE16PKC_EXIT]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP13:![0-9]+]]
191 // CHECK: [[_ZL22__MAKE_MANTISSA_BASE16PKC_EXIT]]:
192 // CHECK-NEXT: [[RETVAL_2_I:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ 0, %[[IF_ELSE17_I]] ], [ [[ADD28_I]], %[[IF_END31_I]] ]
193 // CHECK-NEXT: ret i64 [[RETVAL_2_I]]
194 //
195 // AMDGCNSPIRV-LABEL: define spir_func i64 @test___make_mantissa_base16(
196 // AMDGCNSPIRV-SAME: ptr addrspace(4) noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR2]] {
197 // AMDGCNSPIRV-NEXT: [[ENTRY:.*]]:
198 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = load i8, ptr addrspace(4) [[P]], align 1, !tbaa [[CHAR_TBAA9]]
199 // AMDGCNSPIRV-NEXT: [[CMP_NOT_I1:%.*]] = icmp eq i8 [[TMP0]], 0
200 // AMDGCNSPIRV-NEXT: br i1 [[CMP_NOT_I1]], label %[[_ZL22__MAKE_MANTISSA_BASE16PKC_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
201 // AMDGCNSPIRV: [[WHILE_BODY_I]]:
202 // AMDGCNSPIRV-NEXT: [[TMP1:%.*]] = phi i8 [ [[TMP5:%.*]], %[[IF_END31_I:.*]] ], [ [[TMP0]], %[[ENTRY]] ]
203 // AMDGCNSPIRV-NEXT: [[__R_0_I3:%.*]] = phi i64 [ [[ADD28_I:%.*]], %[[IF_END31_I]] ], [ 0, %[[ENTRY]] ]
204 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_0_I2:%.*]] = phi ptr addrspace(4) [ [[INCDEC_PTR_I:%.*]], %[[IF_END31_I]] ], [ [[P]], %[[ENTRY]] ]
205 // AMDGCNSPIRV-NEXT: [[TMP2:%.*]] = add i8 [[TMP1]], -48
206 // AMDGCNSPIRV-NEXT: [[OR_COND_I:%.*]] = icmp ult i8 [[TMP2]], 10
207 // AMDGCNSPIRV-NEXT: br i1 [[OR_COND_I]], label %[[IF_END31_I]], label %[[IF_ELSE_I:.*]]
208 // AMDGCNSPIRV: [[IF_ELSE_I]]:
209 // AMDGCNSPIRV-NEXT: [[TMP3:%.*]] = add i8 [[TMP1]], -97
210 // AMDGCNSPIRV-NEXT: [[OR_COND33_I:%.*]] = icmp ult i8 [[TMP3]], 6
211 // AMDGCNSPIRV-NEXT: br i1 [[OR_COND33_I]], label %[[IF_END31_I]], label %[[IF_ELSE17_I:.*]]
212 // AMDGCNSPIRV: [[IF_ELSE17_I]]:
213 // AMDGCNSPIRV-NEXT: [[TMP4:%.*]] = add i8 [[TMP1]], -65
214 // AMDGCNSPIRV-NEXT: [[OR_COND34_I:%.*]] = icmp ult i8 [[TMP4]], 6
215 // AMDGCNSPIRV-NEXT: br i1 [[OR_COND34_I]], label %[[IF_END31_I]], label %[[_ZL22__MAKE_MANTISSA_BASE16PKC_EXIT]]
216 // AMDGCNSPIRV: [[IF_END31_I]]:
217 // AMDGCNSPIRV-NEXT: [[DOTSINK:%.*]] = phi i64 [ -87, %[[IF_ELSE_I]] ], [ -48, %[[WHILE_BODY_I]] ], [ -55, %[[IF_ELSE17_I]] ]
218 // AMDGCNSPIRV-NEXT: [[MUL24_I:%.*]] = shl i64 [[__R_0_I3]], 4
219 // AMDGCNSPIRV-NEXT: [[CONV25_I:%.*]] = zext nneg i8 [[TMP1]] to i64
220 // AMDGCNSPIRV-NEXT: [[ADD26_I:%.*]] = add i64 [[MUL24_I]], [[DOTSINK]]
221 // AMDGCNSPIRV-NEXT: [[ADD28_I]] = add i64 [[ADD26_I]], [[CONV25_I]]
222 // AMDGCNSPIRV-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr addrspace(4) [[__TAGP_ADDR_0_I2]], i64 1
223 // AMDGCNSPIRV-NEXT: [[TMP5]] = load i8, ptr addrspace(4) [[INCDEC_PTR_I]], align 1, !tbaa [[CHAR_TBAA9]]
224 // AMDGCNSPIRV-NEXT: [[CMP_NOT_I:%.*]] = icmp eq i8 [[TMP5]], 0
225 // AMDGCNSPIRV-NEXT: br i1 [[CMP_NOT_I]], label %[[_ZL22__MAKE_MANTISSA_BASE16PKC_EXIT]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP14:![0-9]+]]
226 // AMDGCNSPIRV: [[_ZL22__MAKE_MANTISSA_BASE16PKC_EXIT]]:
227 // AMDGCNSPIRV-NEXT: [[RETVAL_2_I:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ 0, %[[IF_ELSE17_I]] ], [ [[ADD28_I]], %[[IF_END31_I]] ]
228 // AMDGCNSPIRV-NEXT: ret i64 [[RETVAL_2_I]]
229 //
230 extern "C" __device__ uint64_t test___make_mantissa_base16(const char *p) {
231 return __make_mantissa_base16(p);
232 }
233
234 // CHECK-LABEL: define dso_local i64 @test___make_mantissa(
235 // CHECK-SAME: ptr noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr #[[ATTR2]] {
236 // CHECK-NEXT: [[ENTRY:.*:]]
237 // CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[P]], align 1, !tbaa [[CHAR_TBAA8]]
238 // CHECK-NEXT: [[CMP_I:%.*]] = icmp eq i8 [[TMP0]], 48
239 // CHECK-NEXT: br i1 [[CMP_I]], label %[[IF_THEN_I:.*]], label %[[WHILE_COND_I14_I_PREHEADER:.*]]
240 // CHECK: [[WHILE_COND_I14_I_PREHEADER]]:
241 // CHECK-NEXT: [[TMP1:%.*]] = load i8, ptr [[P]], align 1, !tbaa [[CHAR_TBAA8]]
242 // CHECK-NEXT: [[CMP_NOT_I17_I5:%.*]] = icmp eq i8 [[TMP1]], 0
243 // CHECK-NEXT: br i1 [[CMP_NOT_I17_I5]], label %[[_ZL15__MAKE_MANTISSAPKC_EXIT:.*]], label %[[WHILE_BODY_I18_I:.*]]
244 // CHECK: [[IF_THEN_I]]:
245 // CHECK-NEXT: [[INCDEC_PTR_I:%.*]] = getelementptr inbounds nuw i8, ptr [[P]], i64 1
246 // CHECK-NEXT: [[TMP2:%.*]] = load i8, ptr [[INCDEC_PTR_I]], align 1, !tbaa [[CHAR_TBAA8]]
247 // CHECK-NEXT: [[CMP_NOT_I_I14:%.*]] = icmp eq i8 [[TMP2]], 0
248 // CHECK-NEXT: switch i8 [[TMP2]], label %[[WHILE_COND_I_I_PREHEADER:.*]] [
249 // CHECK-NEXT: i8 120, label %[[IF_THEN5_I:.*]]
250 // CHECK-NEXT: i8 88, label %[[IF_THEN5_I]]
251 // CHECK-NEXT: ]
252 // CHECK: [[WHILE_COND_I_I_PREHEADER]]:
253 // CHECK-NEXT: br i1 [[CMP_NOT_I_I14]], label %[[_ZL15__MAKE_MANTISSAPKC_EXIT]], label %[[WHILE_BODY_I_I:.*]]
254 // CHECK: [[IF_THEN5_I]]:
255 // CHECK-NEXT: br i1 [[CMP_NOT_I_I14]], label %[[_ZL15__MAKE_MANTISSAPKC_EXIT]], label %[[WHILE_BODY_I31_I:.*]]
256 // CHECK: [[WHILE_BODY_I31_I]]:
257 // CHECK-NEXT: [[TMP3:%.*]] = phi i8 [ [[TMP7:%.*]], %[[IF_END31_I_I:.*]] ], [ [[TMP2]], %[[IF_THEN5_I]] ]
258 // CHECK-NEXT: [[__R_0_I29_I11:%.*]] = phi i64 [ [[ADD28_I_I:%.*]], %[[IF_END31_I_I]] ], [ 0, %[[IF_THEN5_I]] ]
259 // CHECK-NEXT: [[__TAGP_ADDR_0_I28_I10:%.*]] = phi ptr [ [[INCDEC_PTR_I34_I:%.*]], %[[IF_END31_I_I]] ], [ [[INCDEC_PTR_I]], %[[IF_THEN5_I]] ]
260 // CHECK-NEXT: [[TMP4:%.*]] = add i8 [[TMP3]], -48
261 // CHECK-NEXT: [[OR_COND_I32_I:%.*]] = icmp ult i8 [[TMP4]], 10
262 // CHECK-NEXT: br i1 [[OR_COND_I32_I]], label %[[IF_END31_I_I]], label %[[IF_ELSE_I_I:.*]]
263 // CHECK: [[IF_ELSE_I_I]]:
264 // CHECK-NEXT: [[TMP5:%.*]] = add i8 [[TMP3]], -97
265 // CHECK-NEXT: [[OR_COND33_I_I:%.*]] = icmp ult i8 [[TMP5]], 6
266 // CHECK-NEXT: br i1 [[OR_COND33_I_I]], label %[[IF_END31_I_I]], label %[[IF_ELSE17_I_I:.*]]
267 // CHECK: [[IF_ELSE17_I_I]]:
268 // CHECK-NEXT: [[TMP6:%.*]] = add i8 [[TMP3]], -65
269 // CHECK-NEXT: [[OR_COND34_I_I:%.*]] = icmp ult i8 [[TMP6]], 6
270 // CHECK-NEXT: br i1 [[OR_COND34_I_I]], label %[[IF_END31_I_I]], label %[[_ZL15__MAKE_MANTISSAPKC_EXIT]]
271 // CHECK: [[IF_END31_I_I]]:
272 // CHECK-NEXT: [[DOTSINK:%.*]] = phi i64 [ -87, %[[IF_ELSE_I_I]] ], [ -48, %[[WHILE_BODY_I31_I]] ], [ -55, %[[IF_ELSE17_I_I]] ]
273 // CHECK-NEXT: [[MUL24_I_I:%.*]] = shl i64 [[__R_0_I29_I11]], 4
274 // CHECK-NEXT: [[CONV25_I_I:%.*]] = zext nneg i8 [[TMP3]] to i64
275 // CHECK-NEXT: [[ADD26_I_I:%.*]] = add i64 [[MUL24_I_I]], [[DOTSINK]]
276 // CHECK-NEXT: [[ADD28_I_I]] = add i64 [[ADD26_I_I]], [[CONV25_I_I]]
277 // CHECK-NEXT: [[INCDEC_PTR_I34_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I28_I10]], i64 1
278 // CHECK-NEXT: [[TMP7]] = load i8, ptr [[INCDEC_PTR_I34_I]], align 1, !tbaa [[CHAR_TBAA8]]
279 // CHECK-NEXT: [[CMP_NOT_I30_I:%.*]] = icmp eq i8 [[TMP7]], 0
280 // CHECK-NEXT: br i1 [[CMP_NOT_I30_I]], label %[[_ZL15__MAKE_MANTISSAPKC_EXIT]], label %[[WHILE_BODY_I31_I]], !llvm.loop [[LOOP13]]
281 // CHECK: [[WHILE_BODY_I_I]]:
282 // CHECK-NEXT: [[TMP8:%.*]] = phi i8 [ [[TMP10:%.*]], %[[IF_THEN_I_I:.*]] ], [ [[TMP2]], %[[WHILE_COND_I_I_PREHEADER]] ]
283 // CHECK-NEXT: [[__R_0_I_I16:%.*]] = phi i64 [ [[SUB_I_I:%.*]], %[[IF_THEN_I_I]] ], [ 0, %[[WHILE_COND_I_I_PREHEADER]] ]
284 // CHECK-NEXT: [[__TAGP_ADDR_0_I_I15:%.*]] = phi ptr [ [[INCDEC_PTR_I_I:%.*]], %[[IF_THEN_I_I]] ], [ [[INCDEC_PTR_I]], %[[WHILE_COND_I_I_PREHEADER]] ]
285 // CHECK-NEXT: [[TMP9:%.*]] = and i8 [[TMP8]], -8
286 // CHECK-NEXT: [[OR_COND_I_I:%.*]] = icmp eq i8 [[TMP9]], 48
287 // CHECK-NEXT: br i1 [[OR_COND_I_I]], label %[[IF_THEN_I_I]], label %[[_ZL15__MAKE_MANTISSAPKC_EXIT]]
288 // CHECK: [[IF_THEN_I_I]]:
289 // CHECK-NEXT: [[MUL_I_I:%.*]] = shl i64 [[__R_0_I_I16]], 3
290 // CHECK-NEXT: [[CONV5_I_I:%.*]] = zext nneg i8 [[TMP8]] to i64
291 // CHECK-NEXT: [[ADD_I_I:%.*]] = add i64 [[MUL_I_I]], -48
292 // CHECK-NEXT: [[SUB_I_I]] = add i64 [[ADD_I_I]], [[CONV5_I_I]]
293 // CHECK-NEXT: [[INCDEC_PTR_I_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I_I15]], i64 1
294 // CHECK-NEXT: [[TMP10]] = load i8, ptr [[INCDEC_PTR_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
295 // CHECK-NEXT: [[CMP_NOT_I_I:%.*]] = icmp eq i8 [[TMP10]], 0
296 // CHECK-NEXT: br i1 [[CMP_NOT_I_I]], label %[[_ZL15__MAKE_MANTISSAPKC_EXIT]], label %[[WHILE_BODY_I_I]], !llvm.loop [[LOOP9]]
297 // CHECK: [[WHILE_BODY_I18_I]]:
298 // CHECK-NEXT: [[TMP11:%.*]] = phi i8 [ [[TMP13:%.*]], %[[IF_THEN_I21_I:.*]] ], [ [[TMP1]], %[[WHILE_COND_I14_I_PREHEADER]] ]
299 // CHECK-NEXT: [[__R_0_I16_I7:%.*]] = phi i64 [ [[SUB_I25_I:%.*]], %[[IF_THEN_I21_I]] ], [ 0, %[[WHILE_COND_I14_I_PREHEADER]] ]
300 // CHECK-NEXT: [[__TAGP_ADDR_0_I15_I6:%.*]] = phi ptr [ [[INCDEC_PTR_I26_I:%.*]], %[[IF_THEN_I21_I]] ], [ [[P]], %[[WHILE_COND_I14_I_PREHEADER]] ]
301 // CHECK-NEXT: [[TMP12:%.*]] = add i8 [[TMP11]], -48
302 // CHECK-NEXT: [[OR_COND_I19_I:%.*]] = icmp ult i8 [[TMP12]], 10
303 // CHECK-NEXT: br i1 [[OR_COND_I19_I]], label %[[IF_THEN_I21_I]], label %[[_ZL15__MAKE_MANTISSAPKC_EXIT]]
304 // CHECK: [[IF_THEN_I21_I]]:
305 // CHECK-NEXT: [[MUL_I22_I:%.*]] = mul i64 [[__R_0_I16_I7]], 10
306 // CHECK-NEXT: [[CONV5_I23_I:%.*]] = zext nneg i8 [[TMP11]] to i64
307 // CHECK-NEXT: [[ADD_I24_I:%.*]] = add i64 [[MUL_I22_I]], -48
308 // CHECK-NEXT: [[SUB_I25_I]] = add i64 [[ADD_I24_I]], [[CONV5_I23_I]]
309 // CHECK-NEXT: [[INCDEC_PTR_I26_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I15_I6]], i64 1
310 // CHECK-NEXT: [[TMP13]] = load i8, ptr [[INCDEC_PTR_I26_I]], align 1, !tbaa [[CHAR_TBAA8]]
311 // CHECK-NEXT: [[CMP_NOT_I17_I:%.*]] = icmp eq i8 [[TMP13]], 0
312 // CHECK-NEXT: br i1 [[CMP_NOT_I17_I]], label %[[_ZL15__MAKE_MANTISSAPKC_EXIT]], label %[[WHILE_BODY_I18_I]], !llvm.loop [[LOOP12]]
313 // CHECK: [[_ZL15__MAKE_MANTISSAPKC_EXIT]]:
314 // CHECK-NEXT: [[RETVAL_0_I:%.*]] = phi i64 [ 0, %[[IF_THEN5_I]] ], [ 0, %[[WHILE_COND_I14_I_PREHEADER]] ], [ 0, %[[WHILE_COND_I_I_PREHEADER]] ], [ [[SUB_I_I]], %[[IF_THEN_I_I]] ], [ [[ADD28_I_I]], %[[IF_END31_I_I]] ], [ 0, %[[WHILE_BODY_I_I]] ], [ 0, %[[IF_ELSE17_I_I]] ], [ [[SUB_I25_I]], %[[IF_THEN_I21_I]] ], [ 0, %[[WHILE_BODY_I18_I]] ]
315 // CHECK-NEXT: ret i64 [[RETVAL_0_I]]
316 //
317 // AMDGCNSPIRV-LABEL: define spir_func i64 @test___make_mantissa(
318 // AMDGCNSPIRV-SAME: ptr addrspace(4) noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR2]] {
319 // AMDGCNSPIRV-NEXT: [[ENTRY:.*]]:
320 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = load i8, ptr addrspace(4) [[P]], align 1, !tbaa [[CHAR_TBAA9]]
321 // AMDGCNSPIRV-NEXT: [[CMP_I:%.*]] = icmp eq i8 [[TMP0]], 48
322 // AMDGCNSPIRV-NEXT: br i1 [[CMP_I]], label %[[IF_THEN_I:.*]], label %[[WHILE_COND_I14_I:.*]]
323 // AMDGCNSPIRV: [[IF_THEN_I]]:
324 // AMDGCNSPIRV-NEXT: [[INCDEC_PTR_I:%.*]] = getelementptr inbounds nuw i8, ptr addrspace(4) [[P]], i64 1
325 // AMDGCNSPIRV-NEXT: [[TMP1:%.*]] = load i8, ptr addrspace(4) [[INCDEC_PTR_I]], align 1, !tbaa [[CHAR_TBAA9]]
326 // AMDGCNSPIRV-NEXT: switch i8 [[TMP1]], label %[[WHILE_COND_I_I:.*]] [
327 // AMDGCNSPIRV-NEXT: i8 120, label %[[IF_THEN5_I:.*]]
328 // AMDGCNSPIRV-NEXT: i8 88, label %[[IF_THEN5_I]]
329 // AMDGCNSPIRV-NEXT: ]
330 // AMDGCNSPIRV: [[IF_THEN5_I]]:
331 // AMDGCNSPIRV-NEXT: [[TMP2:%.*]] = load i8, ptr addrspace(4) [[INCDEC_PTR_I]], align 1, !tbaa [[CHAR_TBAA9]]
332 // AMDGCNSPIRV-NEXT: [[CMP_NOT_I31_I5:%.*]] = icmp eq i8 [[TMP2]], 0
333 // AMDGCNSPIRV-NEXT: br i1 [[CMP_NOT_I31_I5]], label %[[_ZL15__MAKE_MANTISSAPKC_EXIT:.*]], label %[[WHILE_BODY_I32_I:.*]]
334 // AMDGCNSPIRV: [[WHILE_BODY_I32_I]]:
335 // AMDGCNSPIRV-NEXT: [[TMP3:%.*]] = phi i8 [ [[TMP7:%.*]], %[[IF_END31_I_I:.*]] ], [ [[TMP2]], %[[IF_THEN5_I]] ]
336 // AMDGCNSPIRV-NEXT: [[__R_0_I30_I7:%.*]] = phi i64 [ [[ADD28_I_I:%.*]], %[[IF_END31_I_I]] ], [ 0, %[[IF_THEN5_I]] ]
337 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_0_I29_I6:%.*]] = phi ptr addrspace(4) [ [[INCDEC_PTR_I36_I:%.*]], %[[IF_END31_I_I]] ], [ [[INCDEC_PTR_I]], %[[IF_THEN5_I]] ]
338 // AMDGCNSPIRV-NEXT: [[TMP4:%.*]] = add i8 [[TMP3]], -48
339 // AMDGCNSPIRV-NEXT: [[OR_COND_I33_I:%.*]] = icmp ult i8 [[TMP4]], 10
340 // AMDGCNSPIRV-NEXT: br i1 [[OR_COND_I33_I]], label %[[IF_END31_I_I]], label %[[IF_ELSE_I_I:.*]]
341 // AMDGCNSPIRV: [[IF_ELSE_I_I]]:
342 // AMDGCNSPIRV-NEXT: [[TMP5:%.*]] = add i8 [[TMP3]], -97
343 // AMDGCNSPIRV-NEXT: [[OR_COND33_I_I:%.*]] = icmp ult i8 [[TMP5]], 6
344 // AMDGCNSPIRV-NEXT: br i1 [[OR_COND33_I_I]], label %[[IF_END31_I_I]], label %[[IF_ELSE17_I_I:.*]]
345 // AMDGCNSPIRV: [[IF_ELSE17_I_I]]:
346 // AMDGCNSPIRV-NEXT: [[TMP6:%.*]] = add i8 [[TMP3]], -65
347 // AMDGCNSPIRV-NEXT: [[OR_COND34_I_I:%.*]] = icmp ult i8 [[TMP6]], 6
348 // AMDGCNSPIRV-NEXT: br i1 [[OR_COND34_I_I]], label %[[IF_END31_I_I]], label %[[_ZL15__MAKE_MANTISSAPKC_EXIT]]
349 // AMDGCNSPIRV: [[IF_END31_I_I]]:
350 // AMDGCNSPIRV-NEXT: [[DOTSINK:%.*]] = phi i64 [ -87, %[[IF_ELSE_I_I]] ], [ -48, %[[WHILE_BODY_I32_I]] ], [ -55, %[[IF_ELSE17_I_I]] ]
351 // AMDGCNSPIRV-NEXT: [[MUL24_I_I:%.*]] = shl i64 [[__R_0_I30_I7]], 4
352 // AMDGCNSPIRV-NEXT: [[CONV25_I_I:%.*]] = zext nneg i8 [[TMP3]] to i64
353 // AMDGCNSPIRV-NEXT: [[ADD26_I_I:%.*]] = add i64 [[MUL24_I_I]], [[DOTSINK]]
354 // AMDGCNSPIRV-NEXT: [[ADD28_I_I]] = add i64 [[ADD26_I_I]], [[CONV25_I_I]]
355 // AMDGCNSPIRV-NEXT: [[INCDEC_PTR_I36_I]] = getelementptr inbounds nuw i8, ptr addrspace(4) [[__TAGP_ADDR_0_I29_I6]], i64 1
356 // AMDGCNSPIRV-NEXT: [[TMP7]] = load i8, ptr addrspace(4) [[INCDEC_PTR_I36_I]], align 1, !tbaa [[CHAR_TBAA9]]
357 // AMDGCNSPIRV-NEXT: [[CMP_NOT_I31_I:%.*]] = icmp eq i8 [[TMP7]], 0
358 // AMDGCNSPIRV-NEXT: br i1 [[CMP_NOT_I31_I]], label %[[_ZL15__MAKE_MANTISSAPKC_EXIT]], label %[[WHILE_BODY_I32_I]], !llvm.loop [[LOOP14]]
359 // AMDGCNSPIRV: [[WHILE_COND_I_I]]:
360 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_0_I_I:%.*]] = phi ptr addrspace(4) [ [[__TAGP_ADDR_1_I_I:%.*]], %[[WHILE_BODY_I_I:.*]] ], [ [[INCDEC_PTR_I]], %[[IF_THEN_I]] ]
361 // AMDGCNSPIRV-NEXT: [[__R_0_I_I:%.*]] = phi i64 [ [[__R_1_I_I:%.*]], %[[WHILE_BODY_I_I]] ], [ 0, %[[IF_THEN_I]] ]
362 // AMDGCNSPIRV-NEXT: [[TMP8:%.*]] = load i8, ptr addrspace(4) [[__TAGP_ADDR_0_I_I]], align 1, !tbaa [[CHAR_TBAA9]]
363 // AMDGCNSPIRV-NEXT: [[CMP_NOT_I_I:%.*]] = icmp eq i8 [[TMP8]], 0
364 // AMDGCNSPIRV-NEXT: br i1 [[CMP_NOT_I_I]], label %[[_ZL15__MAKE_MANTISSAPKC_EXIT]], label %[[WHILE_BODY_I_I]]
365 // AMDGCNSPIRV: [[WHILE_BODY_I_I]]:
366 // AMDGCNSPIRV-NEXT: [[TMP9:%.*]] = and i8 [[TMP8]], -8
367 // AMDGCNSPIRV-NEXT: [[OR_COND_I_I:%.*]] = icmp eq i8 [[TMP9]], 48
368 // AMDGCNSPIRV-NEXT: [[MUL_I_I:%.*]] = shl i64 [[__R_0_I_I]], 3
369 // AMDGCNSPIRV-NEXT: [[CONV5_I_I:%.*]] = zext nneg i8 [[TMP8]] to i64
370 // AMDGCNSPIRV-NEXT: [[ADD_I_I:%.*]] = add i64 [[MUL_I_I]], -48
371 // AMDGCNSPIRV-NEXT: [[SUB_I_I:%.*]] = add i64 [[ADD_I_I]], [[CONV5_I_I]]
372 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_1_I_I_IDX:%.*]] = zext i1 [[OR_COND_I_I]] to i64
373 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_1_I_I]] = getelementptr inbounds nuw i8, ptr addrspace(4) [[__TAGP_ADDR_0_I_I]], i64 [[__TAGP_ADDR_1_I_I_IDX]]
374 // AMDGCNSPIRV-NEXT: [[__R_1_I_I]] = select i1 [[OR_COND_I_I]], i64 [[SUB_I_I]], i64 [[__R_0_I_I]]
375 // AMDGCNSPIRV-NEXT: br i1 [[OR_COND_I_I]], label %[[WHILE_COND_I_I]], label %[[_ZL15__MAKE_MANTISSAPKC_EXIT]], !llvm.loop [[LOOP10]]
376 // AMDGCNSPIRV: [[WHILE_COND_I14_I]]:
377 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_0_I15_I:%.*]] = phi ptr addrspace(4) [ [[__TAGP_ADDR_1_I25_I:%.*]], %[[WHILE_BODY_I18_I:.*]] ], [ [[P]], %[[ENTRY]] ]
378 // AMDGCNSPIRV-NEXT: [[__R_0_I16_I:%.*]] = phi i64 [ [[__R_1_I26_I:%.*]], %[[WHILE_BODY_I18_I]] ], [ 0, %[[ENTRY]] ]
379 // AMDGCNSPIRV-NEXT: [[TMP10:%.*]] = load i8, ptr addrspace(4) [[__TAGP_ADDR_0_I15_I]], align 1, !tbaa [[CHAR_TBAA9]]
380 // AMDGCNSPIRV-NEXT: [[CMP_NOT_I17_I:%.*]] = icmp eq i8 [[TMP10]], 0
381 // AMDGCNSPIRV-NEXT: br i1 [[CMP_NOT_I17_I]], label %[[_ZL15__MAKE_MANTISSAPKC_EXIT]], label %[[WHILE_BODY_I18_I]]
382 // AMDGCNSPIRV: [[WHILE_BODY_I18_I]]:
383 // AMDGCNSPIRV-NEXT: [[TMP11:%.*]] = add i8 [[TMP10]], -48
384 // AMDGCNSPIRV-NEXT: [[OR_COND_I19_I:%.*]] = icmp ult i8 [[TMP11]], 10
385 // AMDGCNSPIRV-NEXT: [[MUL_I20_I:%.*]] = mul i64 [[__R_0_I16_I]], 10
386 // AMDGCNSPIRV-NEXT: [[CONV5_I21_I:%.*]] = zext nneg i8 [[TMP10]] to i64
387 // AMDGCNSPIRV-NEXT: [[ADD_I22_I:%.*]] = add i64 [[MUL_I20_I]], -48
388 // AMDGCNSPIRV-NEXT: [[SUB_I23_I:%.*]] = add i64 [[ADD_I22_I]], [[CONV5_I21_I]]
389 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_1_I25_I_IDX:%.*]] = zext i1 [[OR_COND_I19_I]] to i64
390 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_1_I25_I]] = getelementptr inbounds nuw i8, ptr addrspace(4) [[__TAGP_ADDR_0_I15_I]], i64 [[__TAGP_ADDR_1_I25_I_IDX]]
391 // AMDGCNSPIRV-NEXT: [[__R_1_I26_I]] = select i1 [[OR_COND_I19_I]], i64 [[SUB_I23_I]], i64 [[__R_0_I16_I]]
392 // AMDGCNSPIRV-NEXT: br i1 [[OR_COND_I19_I]], label %[[WHILE_COND_I14_I]], label %[[_ZL15__MAKE_MANTISSAPKC_EXIT]], !llvm.loop [[LOOP13]]
393 // AMDGCNSPIRV: [[_ZL15__MAKE_MANTISSAPKC_EXIT]]:
394 // AMDGCNSPIRV-NEXT: [[RETVAL_0_I:%.*]] = phi i64 [ 0, %[[IF_THEN5_I]] ], [ [[ADD28_I_I]], %[[IF_END31_I_I]] ], [ [[__R_0_I_I]], %[[WHILE_COND_I_I]] ], [ 0, %[[WHILE_BODY_I_I]] ], [ 0, %[[IF_ELSE17_I_I]] ], [ 0, %[[WHILE_BODY_I18_I]] ], [ [[__R_0_I16_I]], %[[WHILE_COND_I14_I]] ]
395 // AMDGCNSPIRV-NEXT: ret i64 [[RETVAL_0_I]]
396 //
397 extern "C" __device__ uint64_t test___make_mantissa(const char *p) {
398 return __make_mantissa(p);
399 }
400
401 // CHECK-LABEL: define dso_local noundef range(i32 0, -2147483648) i32 @test_abs(
402 // CHECK-SAME: i32 noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3:[0-9]+]] {
403 // CHECK-NEXT: [[ENTRY:.*:]]
404 // CHECK-NEXT: [[TMP0:%.*]] = tail call noundef range(i32 0, -2147483648) i32 @llvm.abs.i32(i32 [[X]], i1 true)
405 // CHECK-NEXT: ret i32 [[TMP0]]
406 //
407 // AMDGCNSPIRV-LABEL: define spir_func noundef range(i32 0, -2147483648) i32 @test_abs(
408 // AMDGCNSPIRV-SAME: i32 noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3:[0-9]+]] {
409 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
410 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call noundef range(i32 0, -2147483648) addrspace(4) i32 @llvm.abs.i32(i32 [[X]], i1 true)
411 // AMDGCNSPIRV-NEXT: ret i32 [[TMP0]]
412 //
413 extern "C" __device__ int test_abs(int x) {
414 return abs(x);
415 }
416
417 // CHECK-LABEL: define dso_local noundef range(i64 0, -9223372036854775808) i64 @test_labs(
418 // CHECK-SAME: i64 noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
419 // CHECK-NEXT: [[ENTRY:.*:]]
420 // CHECK-NEXT: [[TMP0:%.*]] = tail call noundef range(i64 0, -9223372036854775808) i64 @llvm.abs.i64(i64 [[X]], i1 true)
421 // CHECK-NEXT: ret i64 [[TMP0]]
422 //
423 // AMDGCNSPIRV-LABEL: define spir_func noundef range(i64 0, -9223372036854775808) i64 @test_labs(
424 // AMDGCNSPIRV-SAME: i64 noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
425 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
426 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call noundef range(i64 0, -9223372036854775808) addrspace(4) i64 @llvm.abs.i64(i64 [[X]], i1 true)
427 // AMDGCNSPIRV-NEXT: ret i64 [[TMP0]]
428 //
429 extern "C" __device__ long test_labs(long x) {
430 return labs(x);
431 }
432
433 // CHECK-LABEL: define dso_local noundef range(i64 0, -9223372036854775808) i64 @test_llabs(
434 // CHECK-SAME: i64 noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
435 // CHECK-NEXT: [[ENTRY:.*:]]
436 // CHECK-NEXT: [[TMP0:%.*]] = tail call noundef range(i64 0, -9223372036854775808) i64 @llvm.abs.i64(i64 [[X]], i1 true)
437 // CHECK-NEXT: ret i64 [[TMP0]]
438 //
439 // AMDGCNSPIRV-LABEL: define spir_func noundef range(i64 0, -9223372036854775808) i64 @test_llabs(
440 // AMDGCNSPIRV-SAME: i64 noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
441 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
442 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call noundef range(i64 0, -9223372036854775808) addrspace(4) i64 @llvm.abs.i64(i64 [[X]], i1 true)
443 // AMDGCNSPIRV-NEXT: ret i64 [[TMP0]]
444 //
445 extern "C" __device__ long long test_llabs(long x) {
446 return llabs(x);
447 }
448
449 // DEFAULT-LABEL: define dso_local noundef float @test_acosf(
450 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4:[0-9]+]] {
451 // DEFAULT-NEXT: [[ENTRY:.*:]]
452 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_acos_f32(float noundef [[X]]) #[[ATTR13:[0-9]+]]
453 // DEFAULT-NEXT: ret float [[CALL_I]]
454 //
455 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_acosf(
456 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR4:[0-9]+]] {
457 // FINITEONLY-NEXT: [[ENTRY:.*:]]
458 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_acos_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR13:[0-9]+]]
459 // FINITEONLY-NEXT: ret float [[CALL_I]]
460 //
461 // APPROX-LABEL: define dso_local noundef float @test_acosf(
462 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4:[0-9]+]] {
463 // APPROX-NEXT: [[ENTRY:.*:]]
464 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_acos_f32(float noundef [[X]]) #[[ATTR13:[0-9]+]]
465 // APPROX-NEXT: ret float [[CALL_I]]
466 //
467 // NCRDIV-LABEL: define dso_local noundef float @test_acosf(
468 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4:[0-9]+]] {
469 // NCRDIV-NEXT: [[ENTRY:.*:]]
470 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_acos_f32(float noundef [[X]]) #[[ATTR13:[0-9]+]]
471 // NCRDIV-NEXT: ret float [[CALL_I]]
472 //
473 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_acosf(
474 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4:[0-9]+]] {
475 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
476 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_acos_f32(float noundef [[X]]) #[[ATTR13:[0-9]+]]
477 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
478 //
479 extern "C" __device__ float test_acosf(float x) {
480 return acosf(x);
481 }
482
483 // DEFAULT-LABEL: define dso_local noundef double @test_acos(
484 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
485 // DEFAULT-NEXT: [[ENTRY:.*:]]
486 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_acos_f64(double noundef [[X]]) #[[ATTR13]]
487 // DEFAULT-NEXT: ret double [[CALL_I]]
488 //
489 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_acos(
490 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
491 // FINITEONLY-NEXT: [[ENTRY:.*:]]
492 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_acos_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR13]]
493 // FINITEONLY-NEXT: ret double [[CALL_I]]
494 //
495 // APPROX-LABEL: define dso_local noundef double @test_acos(
496 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
497 // APPROX-NEXT: [[ENTRY:.*:]]
498 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_acos_f64(double noundef [[X]]) #[[ATTR13]]
499 // APPROX-NEXT: ret double [[CALL_I]]
500 //
501 // NCRDIV-LABEL: define dso_local noundef double @test_acos(
502 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
503 // NCRDIV-NEXT: [[ENTRY:.*:]]
504 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_acos_f64(double noundef [[X]]) #[[ATTR13]]
505 // NCRDIV-NEXT: ret double [[CALL_I]]
506 //
507 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_acos(
508 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
509 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
510 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_acos_f64(double noundef [[X]]) #[[ATTR13]]
511 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
512 //
513 extern "C" __device__ double test_acos(double x) {
514 return acos(x);
515 }
516
517 // DEFAULT-LABEL: define dso_local noundef float @test_acoshf(
518 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5:[0-9]+]] {
519 // DEFAULT-NEXT: [[ENTRY:.*:]]
520 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_acosh_f32(float noundef [[X]]) #[[ATTR14:[0-9]+]]
521 // DEFAULT-NEXT: ret float [[CALL_I]]
522 //
523 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_acoshf(
524 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5:[0-9]+]] {
525 // FINITEONLY-NEXT: [[ENTRY:.*:]]
526 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_acosh_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR14:[0-9]+]]
527 // FINITEONLY-NEXT: ret float [[CALL_I]]
528 //
529 // APPROX-LABEL: define dso_local noundef float @test_acoshf(
530 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5:[0-9]+]] {
531 // APPROX-NEXT: [[ENTRY:.*:]]
532 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_acosh_f32(float noundef [[X]]) #[[ATTR14:[0-9]+]]
533 // APPROX-NEXT: ret float [[CALL_I]]
534 //
535 // NCRDIV-LABEL: define dso_local noundef float @test_acoshf(
536 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5:[0-9]+]] {
537 // NCRDIV-NEXT: [[ENTRY:.*:]]
538 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_acosh_f32(float noundef [[X]]) #[[ATTR14:[0-9]+]]
539 // NCRDIV-NEXT: ret float [[CALL_I]]
540 //
541 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_acoshf(
542 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5:[0-9]+]] {
543 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
544 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_acosh_f32(float noundef [[X]]) #[[ATTR14:[0-9]+]]
545 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
546 //
547 extern "C" __device__ float test_acoshf(float x) {
548 return acoshf(x);
549 }
550
551 // DEFAULT-LABEL: define dso_local noundef double @test_acosh(
552 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
553 // DEFAULT-NEXT: [[ENTRY:.*:]]
554 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_acosh_f64(double noundef [[X]]) #[[ATTR14]]
555 // DEFAULT-NEXT: ret double [[CALL_I]]
556 //
557 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_acosh(
558 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
559 // FINITEONLY-NEXT: [[ENTRY:.*:]]
560 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_acosh_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
561 // FINITEONLY-NEXT: ret double [[CALL_I]]
562 //
563 // APPROX-LABEL: define dso_local noundef double @test_acosh(
564 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
565 // APPROX-NEXT: [[ENTRY:.*:]]
566 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_acosh_f64(double noundef [[X]]) #[[ATTR14]]
567 // APPROX-NEXT: ret double [[CALL_I]]
568 //
569 // NCRDIV-LABEL: define dso_local noundef double @test_acosh(
570 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
571 // NCRDIV-NEXT: [[ENTRY:.*:]]
572 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_acosh_f64(double noundef [[X]]) #[[ATTR14]]
573 // NCRDIV-NEXT: ret double [[CALL_I]]
574 //
575 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_acosh(
576 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
577 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
578 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_acosh_f64(double noundef [[X]]) #[[ATTR14]]
579 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
580 //
581 extern "C" __device__ double test_acosh(double x) {
582 return acosh(x);
583 }
584
585 // DEFAULT-LABEL: define dso_local noundef float @test_asinf(
586 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
587 // DEFAULT-NEXT: [[ENTRY:.*:]]
588 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_asin_f32(float noundef [[X]]) #[[ATTR13]]
589 // DEFAULT-NEXT: ret float [[CALL_I]]
590 //
591 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_asinf(
592 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
593 // FINITEONLY-NEXT: [[ENTRY:.*:]]
594 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_asin_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR13]]
595 // FINITEONLY-NEXT: ret float [[CALL_I]]
596 //
597 // APPROX-LABEL: define dso_local noundef float @test_asinf(
598 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
599 // APPROX-NEXT: [[ENTRY:.*:]]
600 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_asin_f32(float noundef [[X]]) #[[ATTR13]]
601 // APPROX-NEXT: ret float [[CALL_I]]
602 //
603 // NCRDIV-LABEL: define dso_local noundef float @test_asinf(
604 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
605 // NCRDIV-NEXT: [[ENTRY:.*:]]
606 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_asin_f32(float noundef [[X]]) #[[ATTR13]]
607 // NCRDIV-NEXT: ret float [[CALL_I]]
608 //
609 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_asinf(
610 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
611 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
612 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_asin_f32(float noundef [[X]]) #[[ATTR13]]
613 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
614 //
615 extern "C" __device__ float test_asinf(float x) {
616 return asinf(x);
617 }
618
619 // DEFAULT-LABEL: define dso_local noundef double @test_asin(
620 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
621 // DEFAULT-NEXT: [[ENTRY:.*:]]
622 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_asin_f64(double noundef [[X]]) #[[ATTR13]]
623 // DEFAULT-NEXT: ret double [[CALL_I]]
624 //
625 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_asin(
626 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
627 // FINITEONLY-NEXT: [[ENTRY:.*:]]
628 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_asin_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR13]]
629 // FINITEONLY-NEXT: ret double [[CALL_I]]
630 //
631 // APPROX-LABEL: define dso_local noundef double @test_asin(
632 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
633 // APPROX-NEXT: [[ENTRY:.*:]]
634 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_asin_f64(double noundef [[X]]) #[[ATTR13]]
635 // APPROX-NEXT: ret double [[CALL_I]]
636 //
637 // NCRDIV-LABEL: define dso_local noundef double @test_asin(
638 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
639 // NCRDIV-NEXT: [[ENTRY:.*:]]
640 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_asin_f64(double noundef [[X]]) #[[ATTR13]]
641 // NCRDIV-NEXT: ret double [[CALL_I]]
642 //
643 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_asin(
644 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
645 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
646 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_asin_f64(double noundef [[X]]) #[[ATTR13]]
647 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
648 //
649 extern "C" __device__ double test_asin(double x) {
650
651 return asin(x);
652 }
653
654 // DEFAULT-LABEL: define dso_local noundef float @test_asinhf(
655 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
656 // DEFAULT-NEXT: [[ENTRY:.*:]]
657 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_asinh_f32(float noundef [[X]]) #[[ATTR14]]
658 // DEFAULT-NEXT: ret float [[CALL_I]]
659 //
660 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_asinhf(
661 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
662 // FINITEONLY-NEXT: [[ENTRY:.*:]]
663 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_asinh_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
664 // FINITEONLY-NEXT: ret float [[CALL_I]]
665 //
666 // APPROX-LABEL: define dso_local noundef float @test_asinhf(
667 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
668 // APPROX-NEXT: [[ENTRY:.*:]]
669 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_asinh_f32(float noundef [[X]]) #[[ATTR14]]
670 // APPROX-NEXT: ret float [[CALL_I]]
671 //
672 // NCRDIV-LABEL: define dso_local noundef float @test_asinhf(
673 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
674 // NCRDIV-NEXT: [[ENTRY:.*:]]
675 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_asinh_f32(float noundef [[X]]) #[[ATTR14]]
676 // NCRDIV-NEXT: ret float [[CALL_I]]
677 //
678 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_asinhf(
679 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
680 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
681 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_asinh_f32(float noundef [[X]]) #[[ATTR14]]
682 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
683 //
684 extern "C" __device__ float test_asinhf(float x) {
685 return asinhf(x);
686 }
687
688 // DEFAULT-LABEL: define dso_local noundef double @test_asinh(
689 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
690 // DEFAULT-NEXT: [[ENTRY:.*:]]
691 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_asinh_f64(double noundef [[X]]) #[[ATTR14]]
692 // DEFAULT-NEXT: ret double [[CALL_I]]
693 //
694 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_asinh(
695 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
696 // FINITEONLY-NEXT: [[ENTRY:.*:]]
697 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_asinh_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
698 // FINITEONLY-NEXT: ret double [[CALL_I]]
699 //
700 // APPROX-LABEL: define dso_local noundef double @test_asinh(
701 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
702 // APPROX-NEXT: [[ENTRY:.*:]]
703 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_asinh_f64(double noundef [[X]]) #[[ATTR14]]
704 // APPROX-NEXT: ret double [[CALL_I]]
705 //
706 // NCRDIV-LABEL: define dso_local noundef double @test_asinh(
707 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
708 // NCRDIV-NEXT: [[ENTRY:.*:]]
709 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_asinh_f64(double noundef [[X]]) #[[ATTR14]]
710 // NCRDIV-NEXT: ret double [[CALL_I]]
711 //
712 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_asinh(
713 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
714 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
715 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_asinh_f64(double noundef [[X]]) #[[ATTR14]]
716 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
717 //
718 extern "C" __device__ double test_asinh(double x) {
719 return asinh(x);
720 }
721
722 // DEFAULT-LABEL: define dso_local noundef float @test_atan2f(
723 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
724 // DEFAULT-NEXT: [[ENTRY:.*:]]
725 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_atan2_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
726 // DEFAULT-NEXT: ret float [[CALL_I]]
727 //
728 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_atan2f(
729 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
730 // FINITEONLY-NEXT: [[ENTRY:.*:]]
731 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_atan2_f32(float noundef nofpclass(nan inf) [[X]], float noundef nofpclass(nan inf) [[Y]]) #[[ATTR13]]
732 // FINITEONLY-NEXT: ret float [[CALL_I]]
733 //
734 // APPROX-LABEL: define dso_local noundef float @test_atan2f(
735 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
736 // APPROX-NEXT: [[ENTRY:.*:]]
737 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_atan2_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
738 // APPROX-NEXT: ret float [[CALL_I]]
739 //
740 // NCRDIV-LABEL: define dso_local noundef float @test_atan2f(
741 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
742 // NCRDIV-NEXT: [[ENTRY:.*:]]
743 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_atan2_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
744 // NCRDIV-NEXT: ret float [[CALL_I]]
745 //
746 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_atan2f(
747 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
748 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
749 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_atan2_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
750 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
751 //
752 extern "C" __device__ float test_atan2f(float x, float y) {
753 return atan2f(x, y);
754 }
755
756 // DEFAULT-LABEL: define dso_local noundef double @test_atan2(
757 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
758 // DEFAULT-NEXT: [[ENTRY:.*:]]
759 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_atan2_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
760 // DEFAULT-NEXT: ret double [[CALL_I]]
761 //
762 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_atan2(
763 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
764 // FINITEONLY-NEXT: [[ENTRY:.*:]]
765 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_atan2_f64(double noundef nofpclass(nan inf) [[X]], double noundef nofpclass(nan inf) [[Y]]) #[[ATTR13]]
766 // FINITEONLY-NEXT: ret double [[CALL_I]]
767 //
768 // APPROX-LABEL: define dso_local noundef double @test_atan2(
769 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
770 // APPROX-NEXT: [[ENTRY:.*:]]
771 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_atan2_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
772 // APPROX-NEXT: ret double [[CALL_I]]
773 //
774 // NCRDIV-LABEL: define dso_local noundef double @test_atan2(
775 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
776 // NCRDIV-NEXT: [[ENTRY:.*:]]
777 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_atan2_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
778 // NCRDIV-NEXT: ret double [[CALL_I]]
779 //
780 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_atan2(
781 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
782 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
783 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_atan2_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
784 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
785 //
786 extern "C" __device__ double test_atan2(double x, double y) {
787 return atan2(x, y);
788 }
789
790 // DEFAULT-LABEL: define dso_local noundef float @test_atanf(
791 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
792 // DEFAULT-NEXT: [[ENTRY:.*:]]
793 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_atan_f32(float noundef [[X]]) #[[ATTR13]]
794 // DEFAULT-NEXT: ret float [[CALL_I]]
795 //
796 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_atanf(
797 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
798 // FINITEONLY-NEXT: [[ENTRY:.*:]]
799 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_atan_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR13]]
800 // FINITEONLY-NEXT: ret float [[CALL_I]]
801 //
802 // APPROX-LABEL: define dso_local noundef float @test_atanf(
803 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
804 // APPROX-NEXT: [[ENTRY:.*:]]
805 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_atan_f32(float noundef [[X]]) #[[ATTR13]]
806 // APPROX-NEXT: ret float [[CALL_I]]
807 //
808 // NCRDIV-LABEL: define dso_local noundef float @test_atanf(
809 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
810 // NCRDIV-NEXT: [[ENTRY:.*:]]
811 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_atan_f32(float noundef [[X]]) #[[ATTR13]]
812 // NCRDIV-NEXT: ret float [[CALL_I]]
813 //
814 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_atanf(
815 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
816 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
817 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_atan_f32(float noundef [[X]]) #[[ATTR13]]
818 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
819 //
820 extern "C" __device__ float test_atanf(float x) {
821 return atanf(x);
822 }
823
824 // DEFAULT-LABEL: define dso_local noundef double @test_atan(
825 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
826 // DEFAULT-NEXT: [[ENTRY:.*:]]
827 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_atan_f64(double noundef [[X]]) #[[ATTR13]]
828 // DEFAULT-NEXT: ret double [[CALL_I]]
829 //
830 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_atan(
831 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
832 // FINITEONLY-NEXT: [[ENTRY:.*:]]
833 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_atan_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR13]]
834 // FINITEONLY-NEXT: ret double [[CALL_I]]
835 //
836 // APPROX-LABEL: define dso_local noundef double @test_atan(
837 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
838 // APPROX-NEXT: [[ENTRY:.*:]]
839 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_atan_f64(double noundef [[X]]) #[[ATTR13]]
840 // APPROX-NEXT: ret double [[CALL_I]]
841 //
842 // NCRDIV-LABEL: define dso_local noundef double @test_atan(
843 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
844 // NCRDIV-NEXT: [[ENTRY:.*:]]
845 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_atan_f64(double noundef [[X]]) #[[ATTR13]]
846 // NCRDIV-NEXT: ret double [[CALL_I]]
847 //
848 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_atan(
849 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
850 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
851 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_atan_f64(double noundef [[X]]) #[[ATTR13]]
852 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
853 //
854 extern "C" __device__ double test_atan(double x) {
855 return atan(x);
856 }
857
858 // DEFAULT-LABEL: define dso_local noundef float @test_atanhf(
859 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
860 // DEFAULT-NEXT: [[ENTRY:.*:]]
861 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_atanh_f32(float noundef [[X]]) #[[ATTR14]]
862 // DEFAULT-NEXT: ret float [[CALL_I]]
863 //
864 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_atanhf(
865 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
866 // FINITEONLY-NEXT: [[ENTRY:.*:]]
867 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_atanh_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
868 // FINITEONLY-NEXT: ret float [[CALL_I]]
869 //
870 // APPROX-LABEL: define dso_local noundef float @test_atanhf(
871 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
872 // APPROX-NEXT: [[ENTRY:.*:]]
873 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_atanh_f32(float noundef [[X]]) #[[ATTR14]]
874 // APPROX-NEXT: ret float [[CALL_I]]
875 //
876 // NCRDIV-LABEL: define dso_local noundef float @test_atanhf(
877 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
878 // NCRDIV-NEXT: [[ENTRY:.*:]]
879 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_atanh_f32(float noundef [[X]]) #[[ATTR14]]
880 // NCRDIV-NEXT: ret float [[CALL_I]]
881 //
882 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_atanhf(
883 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
884 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
885 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_atanh_f32(float noundef [[X]]) #[[ATTR14]]
886 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
887 //
888 extern "C" __device__ float test_atanhf(float x) {
889 return atanhf(x);
890 }
891
892 // DEFAULT-LABEL: define dso_local noundef double @test_atanh(
893 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
894 // DEFAULT-NEXT: [[ENTRY:.*:]]
895 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_atanh_f64(double noundef [[X]]) #[[ATTR14]]
896 // DEFAULT-NEXT: ret double [[CALL_I]]
897 //
898 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_atanh(
899 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
900 // FINITEONLY-NEXT: [[ENTRY:.*:]]
901 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_atanh_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
902 // FINITEONLY-NEXT: ret double [[CALL_I]]
903 //
904 // APPROX-LABEL: define dso_local noundef double @test_atanh(
905 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
906 // APPROX-NEXT: [[ENTRY:.*:]]
907 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_atanh_f64(double noundef [[X]]) #[[ATTR14]]
908 // APPROX-NEXT: ret double [[CALL_I]]
909 //
910 // NCRDIV-LABEL: define dso_local noundef double @test_atanh(
911 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
912 // NCRDIV-NEXT: [[ENTRY:.*:]]
913 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_atanh_f64(double noundef [[X]]) #[[ATTR14]]
914 // NCRDIV-NEXT: ret double [[CALL_I]]
915 //
916 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_atanh(
917 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
918 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
919 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_atanh_f64(double noundef [[X]]) #[[ATTR14]]
920 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
921 //
922 extern "C" __device__ double test_atanh(double x) {
923 return atanh(x);
924 }
925
926 // DEFAULT-LABEL: define dso_local noundef float @test_cbrtf(
927 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
928 // DEFAULT-NEXT: [[ENTRY:.*:]]
929 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_cbrt_f32(float noundef [[X]]) #[[ATTR14]]
930 // DEFAULT-NEXT: ret float [[CALL_I]]
931 //
932 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_cbrtf(
933 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
934 // FINITEONLY-NEXT: [[ENTRY:.*:]]
935 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_cbrt_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
936 // FINITEONLY-NEXT: ret float [[CALL_I]]
937 //
938 // APPROX-LABEL: define dso_local noundef float @test_cbrtf(
939 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
940 // APPROX-NEXT: [[ENTRY:.*:]]
941 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_cbrt_f32(float noundef [[X]]) #[[ATTR14]]
942 // APPROX-NEXT: ret float [[CALL_I]]
943 //
944 // NCRDIV-LABEL: define dso_local noundef float @test_cbrtf(
945 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
946 // NCRDIV-NEXT: [[ENTRY:.*:]]
947 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_cbrt_f32(float noundef [[X]]) #[[ATTR14]]
948 // NCRDIV-NEXT: ret float [[CALL_I]]
949 //
950 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_cbrtf(
951 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
952 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
953 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_cbrt_f32(float noundef [[X]]) #[[ATTR14]]
954 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
955 //
956 extern "C" __device__ float test_cbrtf(float x) {
957 return cbrtf(x);
958 }
959
960 // DEFAULT-LABEL: define dso_local noundef double @test_cbrt(
961 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
962 // DEFAULT-NEXT: [[ENTRY:.*:]]
963 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_cbrt_f64(double noundef [[X]]) #[[ATTR14]]
964 // DEFAULT-NEXT: ret double [[CALL_I]]
965 //
966 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_cbrt(
967 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
968 // FINITEONLY-NEXT: [[ENTRY:.*:]]
969 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_cbrt_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
970 // FINITEONLY-NEXT: ret double [[CALL_I]]
971 //
972 // APPROX-LABEL: define dso_local noundef double @test_cbrt(
973 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
974 // APPROX-NEXT: [[ENTRY:.*:]]
975 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_cbrt_f64(double noundef [[X]]) #[[ATTR14]]
976 // APPROX-NEXT: ret double [[CALL_I]]
977 //
978 // NCRDIV-LABEL: define dso_local noundef double @test_cbrt(
979 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
980 // NCRDIV-NEXT: [[ENTRY:.*:]]
981 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_cbrt_f64(double noundef [[X]]) #[[ATTR14]]
982 // NCRDIV-NEXT: ret double [[CALL_I]]
983 //
984 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_cbrt(
985 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
986 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
987 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_cbrt_f64(double noundef [[X]]) #[[ATTR14]]
988 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
989 //
990 extern "C" __device__ double test_cbrt(double x) {
991 return cbrt(x);
992 }
993
994 // DEFAULT-LABEL: define dso_local noundef float @test_ceilf(
995 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
996 // DEFAULT-NEXT: [[ENTRY:.*:]]
997 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.ceil.f32(float [[X]])
998 // DEFAULT-NEXT: ret float [[TMP0]]
999 //
1000 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_ceilf(
1001 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1002 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1003 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.ceil.f32(float nofpclass(nan inf) [[X]])
1004 // FINITEONLY-NEXT: ret float [[TMP0]]
1005 //
1006 // APPROX-LABEL: define dso_local noundef float @test_ceilf(
1007 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1008 // APPROX-NEXT: [[ENTRY:.*:]]
1009 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.ceil.f32(float [[X]])
1010 // APPROX-NEXT: ret float [[TMP0]]
1011 //
1012 // NCRDIV-LABEL: define dso_local noundef float @test_ceilf(
1013 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1014 // NCRDIV-NEXT: [[ENTRY:.*:]]
1015 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.ceil.f32(float [[X]])
1016 // NCRDIV-NEXT: ret float [[TMP0]]
1017 //
1018 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_ceilf(
1019 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
1020 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1021 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.ceil.f32(float [[X]])
1022 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
1023 //
1024 extern "C" __device__ float test_ceilf(float x) {
1025 return ceilf(x);
1026 }
1027
1028 // DEFAULT-LABEL: define dso_local noundef double @test_ceil(
1029 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1030 // DEFAULT-NEXT: [[ENTRY:.*:]]
1031 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.ceil.f64(double [[X]])
1032 // DEFAULT-NEXT: ret double [[TMP0]]
1033 //
1034 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_ceil(
1035 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1036 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1037 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef double @llvm.ceil.f64(double nofpclass(nan inf) [[X]])
1038 // FINITEONLY-NEXT: ret double [[TMP0]]
1039 //
1040 // APPROX-LABEL: define dso_local noundef double @test_ceil(
1041 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1042 // APPROX-NEXT: [[ENTRY:.*:]]
1043 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.ceil.f64(double [[X]])
1044 // APPROX-NEXT: ret double [[TMP0]]
1045 //
1046 // NCRDIV-LABEL: define dso_local noundef double @test_ceil(
1047 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1048 // NCRDIV-NEXT: [[ENTRY:.*:]]
1049 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.ceil.f64(double [[X]])
1050 // NCRDIV-NEXT: ret double [[TMP0]]
1051 //
1052 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_ceil(
1053 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
1054 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1055 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) double @llvm.ceil.f64(double [[X]])
1056 // AMDGCNSPIRV-NEXT: ret double [[TMP0]]
1057 //
1058 extern "C" __device__ double test_ceil(double x) {
1059 return ceil(x);
1060 }
1061
1062 // DEFAULT-LABEL: define dso_local noundef float @test_copysignf(
1063 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
1064 // DEFAULT-NEXT: [[ENTRY:.*:]]
1065 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.copysign.f32(float [[X]], float [[Y]])
1066 // DEFAULT-NEXT: ret float [[TMP0]]
1067 //
1068 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_copysignf(
1069 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
1070 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1071 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.copysign.f32(float nofpclass(nan inf) [[X]], float nofpclass(nan inf) [[Y]])
1072 // FINITEONLY-NEXT: ret float [[TMP0]]
1073 //
1074 // APPROX-LABEL: define dso_local noundef float @test_copysignf(
1075 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
1076 // APPROX-NEXT: [[ENTRY:.*:]]
1077 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.copysign.f32(float [[X]], float [[Y]])
1078 // APPROX-NEXT: ret float [[TMP0]]
1079 //
1080 // NCRDIV-LABEL: define dso_local noundef float @test_copysignf(
1081 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
1082 // NCRDIV-NEXT: [[ENTRY:.*:]]
1083 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.copysign.f32(float [[X]], float [[Y]])
1084 // NCRDIV-NEXT: ret float [[TMP0]]
1085 //
1086 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_copysignf(
1087 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
1088 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1089 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.copysign.f32(float [[X]], float [[Y]])
1090 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
1091 //
1092 extern "C" __device__ float test_copysignf(float x, float y) {
1093 return copysignf(x, y);
1094 }
1095
1096 // DEFAULT-LABEL: define dso_local noundef double @test_copysign(
1097 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
1098 // DEFAULT-NEXT: [[ENTRY:.*:]]
1099 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.copysign.f64(double [[X]], double [[Y]])
1100 // DEFAULT-NEXT: ret double [[TMP0]]
1101 //
1102 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_copysign(
1103 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
1104 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1105 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef double @llvm.copysign.f64(double nofpclass(nan inf) [[X]], double nofpclass(nan inf) [[Y]])
1106 // FINITEONLY-NEXT: ret double [[TMP0]]
1107 //
1108 // APPROX-LABEL: define dso_local noundef double @test_copysign(
1109 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
1110 // APPROX-NEXT: [[ENTRY:.*:]]
1111 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.copysign.f64(double [[X]], double [[Y]])
1112 // APPROX-NEXT: ret double [[TMP0]]
1113 //
1114 // NCRDIV-LABEL: define dso_local noundef double @test_copysign(
1115 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
1116 // NCRDIV-NEXT: [[ENTRY:.*:]]
1117 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.copysign.f64(double [[X]], double [[Y]])
1118 // NCRDIV-NEXT: ret double [[TMP0]]
1119 //
1120 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_copysign(
1121 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
1122 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1123 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) double @llvm.copysign.f64(double [[X]], double [[Y]])
1124 // AMDGCNSPIRV-NEXT: ret double [[TMP0]]
1125 //
1126 extern "C" __device__ double test_copysign(double x, double y) {
1127 return copysign(x, y);
1128 }
1129
1130 // DEFAULT-LABEL: define dso_local noundef float @test_cosf(
1131 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6:[0-9]+]] {
1132 // DEFAULT-NEXT: [[ENTRY:.*:]]
1133 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_cos_f32(float noundef [[X]]) #[[ATTR15:[0-9]+]]
1134 // DEFAULT-NEXT: ret float [[CALL_I]]
1135 //
1136 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_cosf(
1137 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6:[0-9]+]] {
1138 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1139 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_cos_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR15:[0-9]+]]
1140 // FINITEONLY-NEXT: ret float [[CALL_I]]
1141 //
1142 // APPROX-LABEL: define dso_local noundef float @test_cosf(
1143 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6:[0-9]+]] {
1144 // APPROX-NEXT: [[ENTRY:.*:]]
1145 // APPROX-NEXT: [[CALL_I1:%.*]] = tail call contract noundef float @__ocml_native_cos_f32(float noundef [[X]]) #[[ATTR15:[0-9]+]]
1146 // APPROX-NEXT: ret float [[CALL_I1]]
1147 //
1148 // NCRDIV-LABEL: define dso_local noundef float @test_cosf(
1149 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6:[0-9]+]] {
1150 // NCRDIV-NEXT: [[ENTRY:.*:]]
1151 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_cos_f32(float noundef [[X]]) #[[ATTR15:[0-9]+]]
1152 // NCRDIV-NEXT: ret float [[CALL_I]]
1153 //
1154 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_cosf(
1155 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6:[0-9]+]] {
1156 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1157 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_cos_f32(float noundef [[X]]) #[[ATTR15:[0-9]+]]
1158 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
1159 //
1160 extern "C" __device__ float test_cosf(float x) {
1161 return cosf(x);
1162 }
1163
1164 // DEFAULT-LABEL: define dso_local noundef double @test_cos(
1165 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1166 // DEFAULT-NEXT: [[ENTRY:.*:]]
1167 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_cos_f64(double noundef [[X]]) #[[ATTR15]]
1168 // DEFAULT-NEXT: ret double [[CALL_I]]
1169 //
1170 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_cos(
1171 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1172 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1173 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_cos_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
1174 // FINITEONLY-NEXT: ret double [[CALL_I]]
1175 //
1176 // APPROX-LABEL: define dso_local noundef double @test_cos(
1177 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1178 // APPROX-NEXT: [[ENTRY:.*:]]
1179 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_cos_f64(double noundef [[X]]) #[[ATTR15]]
1180 // APPROX-NEXT: ret double [[CALL_I]]
1181 //
1182 // NCRDIV-LABEL: define dso_local noundef double @test_cos(
1183 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1184 // NCRDIV-NEXT: [[ENTRY:.*:]]
1185 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_cos_f64(double noundef [[X]]) #[[ATTR15]]
1186 // NCRDIV-NEXT: ret double [[CALL_I]]
1187 //
1188 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_cos(
1189 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
1190 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1191 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_cos_f64(double noundef [[X]]) #[[ATTR15]]
1192 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
1193 //
1194 extern "C" __device__ double test_cos(double x) {
1195 return cos(x);
1196 }
1197
1198 // DEFAULT-LABEL: define dso_local noundef float @test_coshf(
1199 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1200 // DEFAULT-NEXT: [[ENTRY:.*:]]
1201 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_cosh_f32(float noundef [[X]]) #[[ATTR14]]
1202 // DEFAULT-NEXT: ret float [[CALL_I]]
1203 //
1204 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_coshf(
1205 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1206 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1207 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_cosh_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
1208 // FINITEONLY-NEXT: ret float [[CALL_I]]
1209 //
1210 // APPROX-LABEL: define dso_local noundef float @test_coshf(
1211 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1212 // APPROX-NEXT: [[ENTRY:.*:]]
1213 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_cosh_f32(float noundef [[X]]) #[[ATTR14]]
1214 // APPROX-NEXT: ret float [[CALL_I]]
1215 //
1216 // NCRDIV-LABEL: define dso_local noundef float @test_coshf(
1217 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1218 // NCRDIV-NEXT: [[ENTRY:.*:]]
1219 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_cosh_f32(float noundef [[X]]) #[[ATTR14]]
1220 // NCRDIV-NEXT: ret float [[CALL_I]]
1221 //
1222 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_coshf(
1223 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
1224 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1225 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_cosh_f32(float noundef [[X]]) #[[ATTR14]]
1226 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
1227 //
1228 extern "C" __device__ float test_coshf(float x) {
1229 return coshf(x);
1230 }
1231
1232 // DEFAULT-LABEL: define dso_local noundef double @test_cosh(
1233 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1234 // DEFAULT-NEXT: [[ENTRY:.*:]]
1235 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_cosh_f64(double noundef [[X]]) #[[ATTR14]]
1236 // DEFAULT-NEXT: ret double [[CALL_I]]
1237 //
1238 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_cosh(
1239 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1240 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1241 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_cosh_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
1242 // FINITEONLY-NEXT: ret double [[CALL_I]]
1243 //
1244 // APPROX-LABEL: define dso_local noundef double @test_cosh(
1245 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1246 // APPROX-NEXT: [[ENTRY:.*:]]
1247 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_cosh_f64(double noundef [[X]]) #[[ATTR14]]
1248 // APPROX-NEXT: ret double [[CALL_I]]
1249 //
1250 // NCRDIV-LABEL: define dso_local noundef double @test_cosh(
1251 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1252 // NCRDIV-NEXT: [[ENTRY:.*:]]
1253 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_cosh_f64(double noundef [[X]]) #[[ATTR14]]
1254 // NCRDIV-NEXT: ret double [[CALL_I]]
1255 //
1256 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_cosh(
1257 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
1258 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1259 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_cosh_f64(double noundef [[X]]) #[[ATTR14]]
1260 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
1261 //
1262 extern "C" __device__ double test_cosh(double x) {
1263 return cosh(x);
1264 }
1265
1266 // DEFAULT-LABEL: define dso_local noundef float @test_cospif(
1267 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1268 // DEFAULT-NEXT: [[ENTRY:.*:]]
1269 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_cospi_f32(float noundef [[X]]) #[[ATTR15]]
1270 // DEFAULT-NEXT: ret float [[CALL_I]]
1271 //
1272 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_cospif(
1273 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1274 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1275 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_cospi_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
1276 // FINITEONLY-NEXT: ret float [[CALL_I]]
1277 //
1278 // APPROX-LABEL: define dso_local noundef float @test_cospif(
1279 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1280 // APPROX-NEXT: [[ENTRY:.*:]]
1281 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_cospi_f32(float noundef [[X]]) #[[ATTR15]]
1282 // APPROX-NEXT: ret float [[CALL_I]]
1283 //
1284 // NCRDIV-LABEL: define dso_local noundef float @test_cospif(
1285 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1286 // NCRDIV-NEXT: [[ENTRY:.*:]]
1287 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_cospi_f32(float noundef [[X]]) #[[ATTR15]]
1288 // NCRDIV-NEXT: ret float [[CALL_I]]
1289 //
1290 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_cospif(
1291 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
1292 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1293 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_cospi_f32(float noundef [[X]]) #[[ATTR15]]
1294 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
1295 //
1296 extern "C" __device__ float test_cospif(float x) {
1297 return cospif(x);
1298 }
1299
1300 // DEFAULT-LABEL: define dso_local noundef double @test_cospi(
1301 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1302 // DEFAULT-NEXT: [[ENTRY:.*:]]
1303 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_cospi_f64(double noundef [[X]]) #[[ATTR15]]
1304 // DEFAULT-NEXT: ret double [[CALL_I]]
1305 //
1306 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_cospi(
1307 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1308 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1309 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_cospi_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
1310 // FINITEONLY-NEXT: ret double [[CALL_I]]
1311 //
1312 // APPROX-LABEL: define dso_local noundef double @test_cospi(
1313 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1314 // APPROX-NEXT: [[ENTRY:.*:]]
1315 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_cospi_f64(double noundef [[X]]) #[[ATTR15]]
1316 // APPROX-NEXT: ret double [[CALL_I]]
1317 //
1318 // NCRDIV-LABEL: define dso_local noundef double @test_cospi(
1319 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1320 // NCRDIV-NEXT: [[ENTRY:.*:]]
1321 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_cospi_f64(double noundef [[X]]) #[[ATTR15]]
1322 // NCRDIV-NEXT: ret double [[CALL_I]]
1323 //
1324 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_cospi(
1325 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
1326 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1327 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_cospi_f64(double noundef [[X]]) #[[ATTR15]]
1328 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
1329 //
1330 extern "C" __device__ double test_cospi(double x) {
1331 return cospi(x);
1332 }
1333
1334 // DEFAULT-LABEL: define dso_local noundef float @test_cyl_bessel_i0f(
1335 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1336 // DEFAULT-NEXT: [[ENTRY:.*:]]
1337 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_i0_f32(float noundef [[X]]) #[[ATTR15]]
1338 // DEFAULT-NEXT: ret float [[CALL_I]]
1339 //
1340 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_cyl_bessel_i0f(
1341 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1342 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1343 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_i0_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
1344 // FINITEONLY-NEXT: ret float [[CALL_I]]
1345 //
1346 // APPROX-LABEL: define dso_local noundef float @test_cyl_bessel_i0f(
1347 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1348 // APPROX-NEXT: [[ENTRY:.*:]]
1349 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_i0_f32(float noundef [[X]]) #[[ATTR15]]
1350 // APPROX-NEXT: ret float [[CALL_I]]
1351 //
1352 // NCRDIV-LABEL: define dso_local noundef float @test_cyl_bessel_i0f(
1353 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1354 // NCRDIV-NEXT: [[ENTRY:.*:]]
1355 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_i0_f32(float noundef [[X]]) #[[ATTR15]]
1356 // NCRDIV-NEXT: ret float [[CALL_I]]
1357 //
1358 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_cyl_bessel_i0f(
1359 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
1360 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1361 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_i0_f32(float noundef [[X]]) #[[ATTR15]]
1362 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
1363 //
1364 extern "C" __device__ float test_cyl_bessel_i0f(float x) {
1365 return cyl_bessel_i0f(x);
1366 }
1367
1368 // DEFAULT-LABEL: define dso_local noundef double @test_cyl_bessel_i0(
1369 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1370 // DEFAULT-NEXT: [[ENTRY:.*:]]
1371 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_i0_f64(double noundef [[X]]) #[[ATTR15]]
1372 // DEFAULT-NEXT: ret double [[CALL_I]]
1373 //
1374 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_cyl_bessel_i0(
1375 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1376 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1377 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_i0_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
1378 // FINITEONLY-NEXT: ret double [[CALL_I]]
1379 //
1380 // APPROX-LABEL: define dso_local noundef double @test_cyl_bessel_i0(
1381 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1382 // APPROX-NEXT: [[ENTRY:.*:]]
1383 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_i0_f64(double noundef [[X]]) #[[ATTR15]]
1384 // APPROX-NEXT: ret double [[CALL_I]]
1385 //
1386 // NCRDIV-LABEL: define dso_local noundef double @test_cyl_bessel_i0(
1387 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1388 // NCRDIV-NEXT: [[ENTRY:.*:]]
1389 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_i0_f64(double noundef [[X]]) #[[ATTR15]]
1390 // NCRDIV-NEXT: ret double [[CALL_I]]
1391 //
1392 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_cyl_bessel_i0(
1393 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
1394 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1395 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_i0_f64(double noundef [[X]]) #[[ATTR15]]
1396 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
1397 //
1398 extern "C" __device__ double test_cyl_bessel_i0(double x) {
1399 return cyl_bessel_i0(x);
1400 }
1401
1402 // DEFAULT-LABEL: define dso_local noundef float @test_cyl_bessel_i1f(
1403 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1404 // DEFAULT-NEXT: [[ENTRY:.*:]]
1405 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_i1_f32(float noundef [[X]]) #[[ATTR15]]
1406 // DEFAULT-NEXT: ret float [[CALL_I]]
1407 //
1408 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_cyl_bessel_i1f(
1409 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1410 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1411 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_i1_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
1412 // FINITEONLY-NEXT: ret float [[CALL_I]]
1413 //
1414 // APPROX-LABEL: define dso_local noundef float @test_cyl_bessel_i1f(
1415 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1416 // APPROX-NEXT: [[ENTRY:.*:]]
1417 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_i1_f32(float noundef [[X]]) #[[ATTR15]]
1418 // APPROX-NEXT: ret float [[CALL_I]]
1419 //
1420 // NCRDIV-LABEL: define dso_local noundef float @test_cyl_bessel_i1f(
1421 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1422 // NCRDIV-NEXT: [[ENTRY:.*:]]
1423 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_i1_f32(float noundef [[X]]) #[[ATTR15]]
1424 // NCRDIV-NEXT: ret float [[CALL_I]]
1425 //
1426 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_cyl_bessel_i1f(
1427 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
1428 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1429 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_i1_f32(float noundef [[X]]) #[[ATTR15]]
1430 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
1431 //
1432 extern "C" __device__ float test_cyl_bessel_i1f(float x) {
1433 return cyl_bessel_i1f(x);
1434 }
1435
1436 // DEFAULT-LABEL: define dso_local noundef double @test_cyl_bessel_i1(
1437 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1438 // DEFAULT-NEXT: [[ENTRY:.*:]]
1439 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_i1_f64(double noundef [[X]]) #[[ATTR15]]
1440 // DEFAULT-NEXT: ret double [[CALL_I]]
1441 //
1442 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_cyl_bessel_i1(
1443 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1444 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1445 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_i1_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
1446 // FINITEONLY-NEXT: ret double [[CALL_I]]
1447 //
1448 // APPROX-LABEL: define dso_local noundef double @test_cyl_bessel_i1(
1449 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1450 // APPROX-NEXT: [[ENTRY:.*:]]
1451 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_i1_f64(double noundef [[X]]) #[[ATTR15]]
1452 // APPROX-NEXT: ret double [[CALL_I]]
1453 //
1454 // NCRDIV-LABEL: define dso_local noundef double @test_cyl_bessel_i1(
1455 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
1456 // NCRDIV-NEXT: [[ENTRY:.*:]]
1457 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_i1_f64(double noundef [[X]]) #[[ATTR15]]
1458 // NCRDIV-NEXT: ret double [[CALL_I]]
1459 //
1460 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_cyl_bessel_i1(
1461 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
1462 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1463 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_i1_f64(double noundef [[X]]) #[[ATTR15]]
1464 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
1465 //
1466 extern "C" __device__ double test_cyl_bessel_i1(double x) {
1467 return cyl_bessel_i1(x);
1468 }
1469
1470 // DEFAULT-LABEL: define dso_local noundef float @test_erfcf(
1471 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1472 // DEFAULT-NEXT: [[ENTRY:.*:]]
1473 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_erfc_f32(float noundef [[X]]) #[[ATTR14]]
1474 // DEFAULT-NEXT: ret float [[CALL_I]]
1475 //
1476 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_erfcf(
1477 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1478 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1479 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_erfc_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
1480 // FINITEONLY-NEXT: ret float [[CALL_I]]
1481 //
1482 // APPROX-LABEL: define dso_local noundef float @test_erfcf(
1483 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1484 // APPROX-NEXT: [[ENTRY:.*:]]
1485 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_erfc_f32(float noundef [[X]]) #[[ATTR14]]
1486 // APPROX-NEXT: ret float [[CALL_I]]
1487 //
1488 // NCRDIV-LABEL: define dso_local noundef float @test_erfcf(
1489 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1490 // NCRDIV-NEXT: [[ENTRY:.*:]]
1491 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_erfc_f32(float noundef [[X]]) #[[ATTR14]]
1492 // NCRDIV-NEXT: ret float [[CALL_I]]
1493 //
1494 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_erfcf(
1495 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
1496 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1497 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_erfc_f32(float noundef [[X]]) #[[ATTR14]]
1498 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
1499 //
1500 extern "C" __device__ float test_erfcf(float x) {
1501 return erfcf(x);
1502 }
1503
1504 // DEFAULT-LABEL: define dso_local noundef double @test_erfc(
1505 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1506 // DEFAULT-NEXT: [[ENTRY:.*:]]
1507 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_erfc_f64(double noundef [[X]]) #[[ATTR14]]
1508 // DEFAULT-NEXT: ret double [[CALL_I]]
1509 //
1510 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_erfc(
1511 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1512 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1513 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_erfc_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
1514 // FINITEONLY-NEXT: ret double [[CALL_I]]
1515 //
1516 // APPROX-LABEL: define dso_local noundef double @test_erfc(
1517 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1518 // APPROX-NEXT: [[ENTRY:.*:]]
1519 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_erfc_f64(double noundef [[X]]) #[[ATTR14]]
1520 // APPROX-NEXT: ret double [[CALL_I]]
1521 //
1522 // NCRDIV-LABEL: define dso_local noundef double @test_erfc(
1523 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1524 // NCRDIV-NEXT: [[ENTRY:.*:]]
1525 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_erfc_f64(double noundef [[X]]) #[[ATTR14]]
1526 // NCRDIV-NEXT: ret double [[CALL_I]]
1527 //
1528 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_erfc(
1529 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
1530 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1531 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_erfc_f64(double noundef [[X]]) #[[ATTR14]]
1532 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
1533 //
1534 extern "C" __device__ double test_erfc(double x) {
1535 return erfc(x);
1536 }
1537
1538 // DEFAULT-LABEL: define dso_local noundef float @test_erfinvf(
1539 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1540 // DEFAULT-NEXT: [[ENTRY:.*:]]
1541 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_erfinv_f32(float noundef [[X]]) #[[ATTR14]]
1542 // DEFAULT-NEXT: ret float [[CALL_I]]
1543 //
1544 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_erfinvf(
1545 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1546 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1547 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_erfinv_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
1548 // FINITEONLY-NEXT: ret float [[CALL_I]]
1549 //
1550 // APPROX-LABEL: define dso_local noundef float @test_erfinvf(
1551 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1552 // APPROX-NEXT: [[ENTRY:.*:]]
1553 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_erfinv_f32(float noundef [[X]]) #[[ATTR14]]
1554 // APPROX-NEXT: ret float [[CALL_I]]
1555 //
1556 // NCRDIV-LABEL: define dso_local noundef float @test_erfinvf(
1557 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1558 // NCRDIV-NEXT: [[ENTRY:.*:]]
1559 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_erfinv_f32(float noundef [[X]]) #[[ATTR14]]
1560 // NCRDIV-NEXT: ret float [[CALL_I]]
1561 //
1562 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_erfinvf(
1563 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
1564 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1565 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_erfinv_f32(float noundef [[X]]) #[[ATTR14]]
1566 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
1567 //
1568 extern "C" __device__ float test_erfinvf(float x) {
1569 return erfinvf(x);
1570 }
1571
1572 // DEFAULT-LABEL: define dso_local noundef double @test_erfinv(
1573 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1574 // DEFAULT-NEXT: [[ENTRY:.*:]]
1575 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_erfinv_f64(double noundef [[X]]) #[[ATTR14]]
1576 // DEFAULT-NEXT: ret double [[CALL_I]]
1577 //
1578 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_erfinv(
1579 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1580 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1581 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_erfinv_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
1582 // FINITEONLY-NEXT: ret double [[CALL_I]]
1583 //
1584 // APPROX-LABEL: define dso_local noundef double @test_erfinv(
1585 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1586 // APPROX-NEXT: [[ENTRY:.*:]]
1587 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_erfinv_f64(double noundef [[X]]) #[[ATTR14]]
1588 // APPROX-NEXT: ret double [[CALL_I]]
1589 //
1590 // NCRDIV-LABEL: define dso_local noundef double @test_erfinv(
1591 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1592 // NCRDIV-NEXT: [[ENTRY:.*:]]
1593 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_erfinv_f64(double noundef [[X]]) #[[ATTR14]]
1594 // NCRDIV-NEXT: ret double [[CALL_I]]
1595 //
1596 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_erfinv(
1597 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
1598 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1599 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_erfinv_f64(double noundef [[X]]) #[[ATTR14]]
1600 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
1601 //
1602 extern "C" __device__ double test_erfinv(double x) {
1603 return erfinv(x);
1604 }
1605
1606 // DEFAULT-LABEL: define dso_local noundef float @test_exp10f(
1607 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1608 // DEFAULT-NEXT: [[ENTRY:.*:]]
1609 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.exp10.f32(float [[X]])
1610 // DEFAULT-NEXT: ret float [[TMP0]]
1611 //
1612 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_exp10f(
1613 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1614 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1615 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.exp10.f32(float nofpclass(nan inf) [[X]])
1616 // FINITEONLY-NEXT: ret float [[TMP0]]
1617 //
1618 // APPROX-LABEL: define dso_local noundef float @test_exp10f(
1619 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1620 // APPROX-NEXT: [[ENTRY:.*:]]
1621 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.exp10.f32(float [[X]])
1622 // APPROX-NEXT: ret float [[TMP0]]
1623 //
1624 // NCRDIV-LABEL: define dso_local noundef float @test_exp10f(
1625 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1626 // NCRDIV-NEXT: [[ENTRY:.*:]]
1627 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.exp10.f32(float [[X]])
1628 // NCRDIV-NEXT: ret float [[TMP0]]
1629 //
1630 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_exp10f(
1631 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
1632 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1633 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.exp10.f32(float [[X]])
1634 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
1635 //
1636 extern "C" __device__ float test_exp10f(float x) {
1637 return exp10f(x);
1638 }
1639
1640 // DEFAULT-LABEL: define dso_local noundef double @test_exp10(
1641 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1642 // DEFAULT-NEXT: [[ENTRY:.*:]]
1643 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_exp10_f64(double noundef [[X]]) #[[ATTR14]]
1644 // DEFAULT-NEXT: ret double [[CALL_I]]
1645 //
1646 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_exp10(
1647 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1648 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1649 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_exp10_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
1650 // FINITEONLY-NEXT: ret double [[CALL_I]]
1651 //
1652 // APPROX-LABEL: define dso_local noundef double @test_exp10(
1653 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1654 // APPROX-NEXT: [[ENTRY:.*:]]
1655 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_exp10_f64(double noundef [[X]]) #[[ATTR14]]
1656 // APPROX-NEXT: ret double [[CALL_I]]
1657 //
1658 // NCRDIV-LABEL: define dso_local noundef double @test_exp10(
1659 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1660 // NCRDIV-NEXT: [[ENTRY:.*:]]
1661 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_exp10_f64(double noundef [[X]]) #[[ATTR14]]
1662 // NCRDIV-NEXT: ret double [[CALL_I]]
1663 //
1664 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_exp10(
1665 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
1666 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1667 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_exp10_f64(double noundef [[X]]) #[[ATTR14]]
1668 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
1669 //
1670 extern "C" __device__ double test_exp10(double x) {
1671 return exp10(x);
1672 }
1673
1674 // DEFAULT-LABEL: define dso_local noundef float @test_exp2f(
1675 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1676 // DEFAULT-NEXT: [[ENTRY:.*:]]
1677 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.exp2.f32(float [[X]])
1678 // DEFAULT-NEXT: ret float [[TMP0]]
1679 //
1680 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_exp2f(
1681 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1682 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1683 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.exp2.f32(float nofpclass(nan inf) [[X]])
1684 // FINITEONLY-NEXT: ret float [[TMP0]]
1685 //
1686 // APPROX-LABEL: define dso_local noundef float @test_exp2f(
1687 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1688 // APPROX-NEXT: [[ENTRY:.*:]]
1689 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.exp2.f32(float [[X]])
1690 // APPROX-NEXT: ret float [[TMP0]]
1691 //
1692 // NCRDIV-LABEL: define dso_local noundef float @test_exp2f(
1693 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1694 // NCRDIV-NEXT: [[ENTRY:.*:]]
1695 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.exp2.f32(float [[X]])
1696 // NCRDIV-NEXT: ret float [[TMP0]]
1697 //
1698 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_exp2f(
1699 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
1700 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1701 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.exp2.f32(float [[X]])
1702 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
1703 //
1704 extern "C" __device__ float test_exp2f(float x) {
1705 return exp2f(x);
1706 }
1707
1708 // DEFAULT-LABEL: define dso_local noundef double @test_exp2(
1709 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1710 // DEFAULT-NEXT: [[ENTRY:.*:]]
1711 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_exp2_f64(double noundef [[X]]) #[[ATTR14]]
1712 // DEFAULT-NEXT: ret double [[CALL_I]]
1713 //
1714 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_exp2(
1715 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1716 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1717 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_exp2_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
1718 // FINITEONLY-NEXT: ret double [[CALL_I]]
1719 //
1720 // APPROX-LABEL: define dso_local noundef double @test_exp2(
1721 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1722 // APPROX-NEXT: [[ENTRY:.*:]]
1723 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_exp2_f64(double noundef [[X]]) #[[ATTR14]]
1724 // APPROX-NEXT: ret double [[CALL_I]]
1725 //
1726 // NCRDIV-LABEL: define dso_local noundef double @test_exp2(
1727 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1728 // NCRDIV-NEXT: [[ENTRY:.*:]]
1729 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_exp2_f64(double noundef [[X]]) #[[ATTR14]]
1730 // NCRDIV-NEXT: ret double [[CALL_I]]
1731 //
1732 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_exp2(
1733 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
1734 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1735 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_exp2_f64(double noundef [[X]]) #[[ATTR14]]
1736 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
1737 //
1738 extern "C" __device__ double test_exp2(double x) {
1739 return exp2(x);
1740 }
1741
1742 // DEFAULT-LABEL: define dso_local noundef float @test_expf(
1743 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1744 // DEFAULT-NEXT: [[ENTRY:.*:]]
1745 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.exp.f32(float [[X]])
1746 // DEFAULT-NEXT: ret float [[TMP0]]
1747 //
1748 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_expf(
1749 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1750 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1751 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.exp.f32(float nofpclass(nan inf) [[X]])
1752 // FINITEONLY-NEXT: ret float [[TMP0]]
1753 //
1754 // APPROX-LABEL: define dso_local noundef float @test_expf(
1755 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1756 // APPROX-NEXT: [[ENTRY:.*:]]
1757 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.exp.f32(float [[X]])
1758 // APPROX-NEXT: ret float [[TMP0]]
1759 //
1760 // NCRDIV-LABEL: define dso_local noundef float @test_expf(
1761 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1762 // NCRDIV-NEXT: [[ENTRY:.*:]]
1763 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.exp.f32(float [[X]])
1764 // NCRDIV-NEXT: ret float [[TMP0]]
1765 //
1766 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_expf(
1767 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
1768 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1769 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.exp.f32(float [[X]])
1770 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
1771 //
1772 extern "C" __device__ float test_expf(float x) {
1773 return expf(x);
1774 }
1775
1776 // DEFAULT-LABEL: define dso_local noundef double @test_exp(
1777 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1778 // DEFAULT-NEXT: [[ENTRY:.*:]]
1779 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_exp_f64(double noundef [[X]]) #[[ATTR14]]
1780 // DEFAULT-NEXT: ret double [[CALL_I]]
1781 //
1782 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_exp(
1783 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1784 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1785 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_exp_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
1786 // FINITEONLY-NEXT: ret double [[CALL_I]]
1787 //
1788 // APPROX-LABEL: define dso_local noundef double @test_exp(
1789 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1790 // APPROX-NEXT: [[ENTRY:.*:]]
1791 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_exp_f64(double noundef [[X]]) #[[ATTR14]]
1792 // APPROX-NEXT: ret double [[CALL_I]]
1793 //
1794 // NCRDIV-LABEL: define dso_local noundef double @test_exp(
1795 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1796 // NCRDIV-NEXT: [[ENTRY:.*:]]
1797 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_exp_f64(double noundef [[X]]) #[[ATTR14]]
1798 // NCRDIV-NEXT: ret double [[CALL_I]]
1799 //
1800 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_exp(
1801 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
1802 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1803 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_exp_f64(double noundef [[X]]) #[[ATTR14]]
1804 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
1805 //
1806 extern "C" __device__ double test_exp(double x) {
1807 return exp(x);
1808 }
1809
1810 // DEFAULT-LABEL: define dso_local noundef float @test_expm1f(
1811 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1812 // DEFAULT-NEXT: [[ENTRY:.*:]]
1813 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_expm1_f32(float noundef [[X]]) #[[ATTR14]]
1814 // DEFAULT-NEXT: ret float [[CALL_I]]
1815 //
1816 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_expm1f(
1817 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1818 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1819 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_expm1_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
1820 // FINITEONLY-NEXT: ret float [[CALL_I]]
1821 //
1822 // APPROX-LABEL: define dso_local noundef float @test_expm1f(
1823 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1824 // APPROX-NEXT: [[ENTRY:.*:]]
1825 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_expm1_f32(float noundef [[X]]) #[[ATTR14]]
1826 // APPROX-NEXT: ret float [[CALL_I]]
1827 //
1828 // NCRDIV-LABEL: define dso_local noundef float @test_expm1f(
1829 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1830 // NCRDIV-NEXT: [[ENTRY:.*:]]
1831 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_expm1_f32(float noundef [[X]]) #[[ATTR14]]
1832 // NCRDIV-NEXT: ret float [[CALL_I]]
1833 //
1834 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_expm1f(
1835 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
1836 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1837 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_expm1_f32(float noundef [[X]]) #[[ATTR14]]
1838 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
1839 //
1840 extern "C" __device__ float test_expm1f(float x) {
1841 return expm1f(x);
1842 }
1843
1844 // DEFAULT-LABEL: define dso_local noundef double @test_expm1(
1845 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1846 // DEFAULT-NEXT: [[ENTRY:.*:]]
1847 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_expm1_f64(double noundef [[X]]) #[[ATTR14]]
1848 // DEFAULT-NEXT: ret double [[CALL_I]]
1849 //
1850 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_expm1(
1851 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1852 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1853 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_expm1_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
1854 // FINITEONLY-NEXT: ret double [[CALL_I]]
1855 //
1856 // APPROX-LABEL: define dso_local noundef double @test_expm1(
1857 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1858 // APPROX-NEXT: [[ENTRY:.*:]]
1859 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_expm1_f64(double noundef [[X]]) #[[ATTR14]]
1860 // APPROX-NEXT: ret double [[CALL_I]]
1861 //
1862 // NCRDIV-LABEL: define dso_local noundef double @test_expm1(
1863 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
1864 // NCRDIV-NEXT: [[ENTRY:.*:]]
1865 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_expm1_f64(double noundef [[X]]) #[[ATTR14]]
1866 // NCRDIV-NEXT: ret double [[CALL_I]]
1867 //
1868 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_expm1(
1869 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
1870 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1871 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_expm1_f64(double noundef [[X]]) #[[ATTR14]]
1872 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
1873 //
1874 extern "C" __device__ double test_expm1(double x) {
1875 return expm1(x);
1876 }
1877
1878 // DEFAULT-LABEL: define dso_local noundef float @test_fabsf(
1879 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1880 // DEFAULT-NEXT: [[ENTRY:.*:]]
1881 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.fabs.f32(float [[X]])
1882 // DEFAULT-NEXT: ret float [[TMP0]]
1883 //
1884 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_fabsf(
1885 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1886 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1887 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.fabs.f32(float nofpclass(nan inf) [[X]])
1888 // FINITEONLY-NEXT: ret float [[TMP0]]
1889 //
1890 // APPROX-LABEL: define dso_local noundef float @test_fabsf(
1891 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1892 // APPROX-NEXT: [[ENTRY:.*:]]
1893 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.fabs.f32(float [[X]])
1894 // APPROX-NEXT: ret float [[TMP0]]
1895 //
1896 // NCRDIV-LABEL: define dso_local noundef float @test_fabsf(
1897 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1898 // NCRDIV-NEXT: [[ENTRY:.*:]]
1899 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.fabs.f32(float [[X]])
1900 // NCRDIV-NEXT: ret float [[TMP0]]
1901 //
1902 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_fabsf(
1903 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
1904 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1905 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.fabs.f32(float [[X]])
1906 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
1907 //
1908 extern "C" __device__ float test_fabsf(float x) {
1909 return fabsf(x);
1910 }
1911
1912 // DEFAULT-LABEL: define dso_local noundef double @test_fabs(
1913 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1914 // DEFAULT-NEXT: [[ENTRY:.*:]]
1915 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.fabs.f64(double [[X]])
1916 // DEFAULT-NEXT: ret double [[TMP0]]
1917 //
1918 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_fabs(
1919 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1920 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1921 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef double @llvm.fabs.f64(double nofpclass(nan inf) [[X]])
1922 // FINITEONLY-NEXT: ret double [[TMP0]]
1923 //
1924 // APPROX-LABEL: define dso_local noundef double @test_fabs(
1925 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1926 // APPROX-NEXT: [[ENTRY:.*:]]
1927 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.fabs.f64(double [[X]])
1928 // APPROX-NEXT: ret double [[TMP0]]
1929 //
1930 // NCRDIV-LABEL: define dso_local noundef double @test_fabs(
1931 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
1932 // NCRDIV-NEXT: [[ENTRY:.*:]]
1933 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.fabs.f64(double [[X]])
1934 // NCRDIV-NEXT: ret double [[TMP0]]
1935 //
1936 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_fabs(
1937 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
1938 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1939 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) double @llvm.fabs.f64(double [[X]])
1940 // AMDGCNSPIRV-NEXT: ret double [[TMP0]]
1941 //
1942 extern "C" __device__ double test_fabs(double x) {
1943 return fabs(x);
1944 }
1945
1946 // DEFAULT-LABEL: define dso_local noundef float @test_fdimf(
1947 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
1948 // DEFAULT-NEXT: [[ENTRY:.*:]]
1949 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_fdim_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
1950 // DEFAULT-NEXT: ret float [[CALL_I]]
1951 //
1952 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_fdimf(
1953 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
1954 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1955 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_fdim_f32(float noundef nofpclass(nan inf) [[X]], float noundef nofpclass(nan inf) [[Y]]) #[[ATTR13]]
1956 // FINITEONLY-NEXT: ret float [[CALL_I]]
1957 //
1958 // APPROX-LABEL: define dso_local noundef float @test_fdimf(
1959 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
1960 // APPROX-NEXT: [[ENTRY:.*:]]
1961 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_fdim_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
1962 // APPROX-NEXT: ret float [[CALL_I]]
1963 //
1964 // NCRDIV-LABEL: define dso_local noundef float @test_fdimf(
1965 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
1966 // NCRDIV-NEXT: [[ENTRY:.*:]]
1967 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_fdim_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
1968 // NCRDIV-NEXT: ret float [[CALL_I]]
1969 //
1970 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_fdimf(
1971 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
1972 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
1973 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_fdim_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
1974 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
1975 //
1976 extern "C" __device__ float test_fdimf(float x, float y) {
1977 return fdimf(x, y);
1978 }
1979
1980 // DEFAULT-LABEL: define dso_local noundef double @test_fdim(
1981 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
1982 // DEFAULT-NEXT: [[ENTRY:.*:]]
1983 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_fdim_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
1984 // DEFAULT-NEXT: ret double [[CALL_I]]
1985 //
1986 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_fdim(
1987 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
1988 // FINITEONLY-NEXT: [[ENTRY:.*:]]
1989 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_fdim_f64(double noundef nofpclass(nan inf) [[X]], double noundef nofpclass(nan inf) [[Y]]) #[[ATTR13]]
1990 // FINITEONLY-NEXT: ret double [[CALL_I]]
1991 //
1992 // APPROX-LABEL: define dso_local noundef double @test_fdim(
1993 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
1994 // APPROX-NEXT: [[ENTRY:.*:]]
1995 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_fdim_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
1996 // APPROX-NEXT: ret double [[CALL_I]]
1997 //
1998 // NCRDIV-LABEL: define dso_local noundef double @test_fdim(
1999 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
2000 // NCRDIV-NEXT: [[ENTRY:.*:]]
2001 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_fdim_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
2002 // NCRDIV-NEXT: ret double [[CALL_I]]
2003 //
2004 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_fdim(
2005 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
2006 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2007 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_fdim_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
2008 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
2009 //
2010 extern "C" __device__ double test_fdim(double x, double y) {
2011 return fdim(x, y);
2012 }
2013
2014 // DEFAULT-LABEL: define dso_local noundef float @test_fdividef(
2015 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
2016 // DEFAULT-NEXT: [[ENTRY:.*:]]
2017 // DEFAULT-NEXT: [[DIV_I:%.*]] = fdiv contract float [[X]], [[Y]]
2018 // DEFAULT-NEXT: ret float [[DIV_I]]
2019 //
2020 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) float @test_fdividef(
2021 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
2022 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2023 // FINITEONLY-NEXT: [[DIV_I:%.*]] = fdiv nnan ninf contract float [[X]], [[Y]]
2024 // FINITEONLY-NEXT: ret float [[DIV_I]]
2025 //
2026 // APPROX-LABEL: define dso_local noundef float @test_fdividef(
2027 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
2028 // APPROX-NEXT: [[ENTRY:.*:]]
2029 // APPROX-NEXT: [[DIV_I:%.*]] = fdiv contract float [[X]], [[Y]]
2030 // APPROX-NEXT: ret float [[DIV_I]]
2031 //
2032 // NCRDIV-LABEL: define dso_local noundef float @test_fdividef(
2033 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
2034 // NCRDIV-NEXT: [[ENTRY:.*:]]
2035 // NCRDIV-NEXT: [[DIV_I:%.*]] = fdiv contract float [[X]], [[Y]], !fpmath [[META14:![0-9]+]]
2036 // NCRDIV-NEXT: ret float [[DIV_I]]
2037 //
2038 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_fdividef(
2039 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
2040 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2041 // AMDGCNSPIRV-NEXT: [[DIV_I:%.*]] = fdiv contract float [[X]], [[Y]]
2042 // AMDGCNSPIRV-NEXT: ret float [[DIV_I]]
2043 //
2044 extern "C" __device__ float test_fdividef(float x, float y) {
2045 return fdividef(x, y);
2046 }
2047
2048 // DEFAULT-LABEL: define dso_local noundef float @test_floorf(
2049 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2050 // DEFAULT-NEXT: [[ENTRY:.*:]]
2051 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.floor.f32(float [[X]])
2052 // DEFAULT-NEXT: ret float [[TMP0]]
2053 //
2054 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_floorf(
2055 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2056 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2057 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.floor.f32(float nofpclass(nan inf) [[X]])
2058 // FINITEONLY-NEXT: ret float [[TMP0]]
2059 //
2060 // APPROX-LABEL: define dso_local noundef float @test_floorf(
2061 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2062 // APPROX-NEXT: [[ENTRY:.*:]]
2063 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.floor.f32(float [[X]])
2064 // APPROX-NEXT: ret float [[TMP0]]
2065 //
2066 // NCRDIV-LABEL: define dso_local noundef float @test_floorf(
2067 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2068 // NCRDIV-NEXT: [[ENTRY:.*:]]
2069 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.floor.f32(float [[X]])
2070 // NCRDIV-NEXT: ret float [[TMP0]]
2071 //
2072 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_floorf(
2073 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
2074 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2075 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.floor.f32(float [[X]])
2076 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
2077 //
2078 extern "C" __device__ float test_floorf(float x) {
2079 return floorf(x);
2080 }
2081
2082 // DEFAULT-LABEL: define dso_local noundef double @test_floor(
2083 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2084 // DEFAULT-NEXT: [[ENTRY:.*:]]
2085 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.floor.f64(double [[X]])
2086 // DEFAULT-NEXT: ret double [[TMP0]]
2087 //
2088 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_floor(
2089 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2090 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2091 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef double @llvm.floor.f64(double nofpclass(nan inf) [[X]])
2092 // FINITEONLY-NEXT: ret double [[TMP0]]
2093 //
2094 // APPROX-LABEL: define dso_local noundef double @test_floor(
2095 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2096 // APPROX-NEXT: [[ENTRY:.*:]]
2097 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.floor.f64(double [[X]])
2098 // APPROX-NEXT: ret double [[TMP0]]
2099 //
2100 // NCRDIV-LABEL: define dso_local noundef double @test_floor(
2101 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2102 // NCRDIV-NEXT: [[ENTRY:.*:]]
2103 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.floor.f64(double [[X]])
2104 // NCRDIV-NEXT: ret double [[TMP0]]
2105 //
2106 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_floor(
2107 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
2108 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2109 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) double @llvm.floor.f64(double [[X]])
2110 // AMDGCNSPIRV-NEXT: ret double [[TMP0]]
2111 //
2112 extern "C" __device__ double test_floor(double x) {
2113 return floor(x);
2114 }
2115
2116 // DEFAULT-LABEL: define dso_local noundef float @test_fmaf(
2117 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR3]] {
2118 // DEFAULT-NEXT: [[ENTRY:.*:]]
2119 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.fma.f32(float [[X]], float [[Y]], float [[Z]])
2120 // DEFAULT-NEXT: ret float [[TMP0]]
2121 //
2122 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_fmaf(
2123 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]], float noundef nofpclass(nan inf) [[Z:%.*]]) local_unnamed_addr #[[ATTR3]] {
2124 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2125 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.fma.f32(float nofpclass(nan inf) [[X]], float nofpclass(nan inf) [[Y]], float nofpclass(nan inf) [[Z]])
2126 // FINITEONLY-NEXT: ret float [[TMP0]]
2127 //
2128 // APPROX-LABEL: define dso_local noundef float @test_fmaf(
2129 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR3]] {
2130 // APPROX-NEXT: [[ENTRY:.*:]]
2131 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.fma.f32(float [[X]], float [[Y]], float [[Z]])
2132 // APPROX-NEXT: ret float [[TMP0]]
2133 //
2134 // NCRDIV-LABEL: define dso_local noundef float @test_fmaf(
2135 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR3]] {
2136 // NCRDIV-NEXT: [[ENTRY:.*:]]
2137 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.fma.f32(float [[X]], float [[Y]], float [[Z]])
2138 // NCRDIV-NEXT: ret float [[TMP0]]
2139 //
2140 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_fmaf(
2141 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
2142 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2143 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.fma.f32(float [[X]], float [[Y]], float [[Z]])
2144 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
2145 //
2146 extern "C" __device__ float test_fmaf(float x, float y, float z) {
2147 return fmaf(x, y, z);
2148 }
2149
2150 // DEFAULT-LABEL: define dso_local noundef double @test_fma(
2151 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR3]] {
2152 // DEFAULT-NEXT: [[ENTRY:.*:]]
2153 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.fma.f64(double [[X]], double [[Y]], double [[Z]])
2154 // DEFAULT-NEXT: ret double [[TMP0]]
2155 //
2156 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_fma(
2157 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]], double noundef nofpclass(nan inf) [[Z:%.*]]) local_unnamed_addr #[[ATTR3]] {
2158 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2159 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef double @llvm.fma.f64(double nofpclass(nan inf) [[X]], double nofpclass(nan inf) [[Y]], double nofpclass(nan inf) [[Z]])
2160 // FINITEONLY-NEXT: ret double [[TMP0]]
2161 //
2162 // APPROX-LABEL: define dso_local noundef double @test_fma(
2163 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR3]] {
2164 // APPROX-NEXT: [[ENTRY:.*:]]
2165 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.fma.f64(double [[X]], double [[Y]], double [[Z]])
2166 // APPROX-NEXT: ret double [[TMP0]]
2167 //
2168 // NCRDIV-LABEL: define dso_local noundef double @test_fma(
2169 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR3]] {
2170 // NCRDIV-NEXT: [[ENTRY:.*:]]
2171 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.fma.f64(double [[X]], double [[Y]], double [[Z]])
2172 // NCRDIV-NEXT: ret double [[TMP0]]
2173 //
2174 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_fma(
2175 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
2176 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2177 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) double @llvm.fma.f64(double [[X]], double [[Y]], double [[Z]])
2178 // AMDGCNSPIRV-NEXT: ret double [[TMP0]]
2179 //
2180 extern "C" __device__ double test_fma(double x, double y, double z) {
2181 return fma(x, y, z);
2182 }
2183
2184 // DEFAULT-LABEL: define dso_local noundef double @test_fma_rn(
2185 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR3]] {
2186 // DEFAULT-NEXT: [[ENTRY:.*:]]
2187 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.fma.f64(double [[X]], double [[Y]], double [[Z]])
2188 // DEFAULT-NEXT: ret double [[TMP0]]
2189 //
2190 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_fma_rn(
2191 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]], double noundef nofpclass(nan inf) [[Z:%.*]]) local_unnamed_addr #[[ATTR3]] {
2192 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2193 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef double @llvm.fma.f64(double nofpclass(nan inf) [[X]], double nofpclass(nan inf) [[Y]], double nofpclass(nan inf) [[Z]])
2194 // FINITEONLY-NEXT: ret double [[TMP0]]
2195 //
2196 // APPROX-LABEL: define dso_local noundef double @test_fma_rn(
2197 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR3]] {
2198 // APPROX-NEXT: [[ENTRY:.*:]]
2199 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.fma.f64(double [[X]], double [[Y]], double [[Z]])
2200 // APPROX-NEXT: ret double [[TMP0]]
2201 //
2202 // NCRDIV-LABEL: define dso_local noundef double @test_fma_rn(
2203 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR3]] {
2204 // NCRDIV-NEXT: [[ENTRY:.*:]]
2205 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.fma.f64(double [[X]], double [[Y]], double [[Z]])
2206 // NCRDIV-NEXT: ret double [[TMP0]]
2207 //
2208 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_fma_rn(
2209 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
2210 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2211 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) double @llvm.fma.f64(double [[X]], double [[Y]], double [[Z]])
2212 // AMDGCNSPIRV-NEXT: ret double [[TMP0]]
2213 //
2214 extern "C" __device__ double test_fma_rn(double x, double y, double z) {
2215 return __fma_rn(x, y, z);
2216 }
2217
2218 // DEFAULT-LABEL: define dso_local noundef float @test_fmaxf(
2219 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
2220 // DEFAULT-NEXT: [[ENTRY:.*:]]
2221 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.maxnum.f32(float [[X]], float [[Y]])
2222 // DEFAULT-NEXT: ret float [[TMP0]]
2223 //
2224 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_fmaxf(
2225 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
2226 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2227 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.maxnum.f32(float nofpclass(nan inf) [[X]], float nofpclass(nan inf) [[Y]])
2228 // FINITEONLY-NEXT: ret float [[TMP0]]
2229 //
2230 // APPROX-LABEL: define dso_local noundef float @test_fmaxf(
2231 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
2232 // APPROX-NEXT: [[ENTRY:.*:]]
2233 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.maxnum.f32(float [[X]], float [[Y]])
2234 // APPROX-NEXT: ret float [[TMP0]]
2235 //
2236 // NCRDIV-LABEL: define dso_local noundef float @test_fmaxf(
2237 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
2238 // NCRDIV-NEXT: [[ENTRY:.*:]]
2239 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.maxnum.f32(float [[X]], float [[Y]])
2240 // NCRDIV-NEXT: ret float [[TMP0]]
2241 //
2242 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_fmaxf(
2243 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
2244 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2245 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.maxnum.f32(float [[X]], float [[Y]])
2246 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
2247 //
2248 extern "C" __device__ float test_fmaxf(float x, float y) {
2249 return fmaxf(x, y);
2250 }
2251
2252 // DEFAULT-LABEL: define dso_local noundef double @test_fmax(
2253 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
2254 // DEFAULT-NEXT: [[ENTRY:.*:]]
2255 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.maxnum.f64(double [[X]], double [[Y]])
2256 // DEFAULT-NEXT: ret double [[TMP0]]
2257 //
2258 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_fmax(
2259 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
2260 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2261 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef double @llvm.maxnum.f64(double nofpclass(nan inf) [[X]], double nofpclass(nan inf) [[Y]])
2262 // FINITEONLY-NEXT: ret double [[TMP0]]
2263 //
2264 // APPROX-LABEL: define dso_local noundef double @test_fmax(
2265 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
2266 // APPROX-NEXT: [[ENTRY:.*:]]
2267 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.maxnum.f64(double [[X]], double [[Y]])
2268 // APPROX-NEXT: ret double [[TMP0]]
2269 //
2270 // NCRDIV-LABEL: define dso_local noundef double @test_fmax(
2271 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
2272 // NCRDIV-NEXT: [[ENTRY:.*:]]
2273 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.maxnum.f64(double [[X]], double [[Y]])
2274 // NCRDIV-NEXT: ret double [[TMP0]]
2275 //
2276 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_fmax(
2277 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
2278 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2279 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) double @llvm.maxnum.f64(double [[X]], double [[Y]])
2280 // AMDGCNSPIRV-NEXT: ret double [[TMP0]]
2281 //
2282 extern "C" __device__ double test_fmax(double x, double y) {
2283 return fmax(x, y);
2284 }
2285
2286 // DEFAULT-LABEL: define dso_local noundef float @test_fminf(
2287 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
2288 // DEFAULT-NEXT: [[ENTRY:.*:]]
2289 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.minnum.f32(float [[X]], float [[Y]])
2290 // DEFAULT-NEXT: ret float [[TMP0]]
2291 //
2292 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_fminf(
2293 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
2294 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2295 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.minnum.f32(float nofpclass(nan inf) [[X]], float nofpclass(nan inf) [[Y]])
2296 // FINITEONLY-NEXT: ret float [[TMP0]]
2297 //
2298 // APPROX-LABEL: define dso_local noundef float @test_fminf(
2299 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
2300 // APPROX-NEXT: [[ENTRY:.*:]]
2301 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.minnum.f32(float [[X]], float [[Y]])
2302 // APPROX-NEXT: ret float [[TMP0]]
2303 //
2304 // NCRDIV-LABEL: define dso_local noundef float @test_fminf(
2305 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
2306 // NCRDIV-NEXT: [[ENTRY:.*:]]
2307 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.minnum.f32(float [[X]], float [[Y]])
2308 // NCRDIV-NEXT: ret float [[TMP0]]
2309 //
2310 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_fminf(
2311 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
2312 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2313 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.minnum.f32(float [[X]], float [[Y]])
2314 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
2315 //
2316 extern "C" __device__ float test_fminf(float x, float y) {
2317 return fminf(x, y);
2318 }
2319
2320 // DEFAULT-LABEL: define dso_local noundef double @test_fmin(
2321 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
2322 // DEFAULT-NEXT: [[ENTRY:.*:]]
2323 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.minnum.f64(double [[X]], double [[Y]])
2324 // DEFAULT-NEXT: ret double [[TMP0]]
2325 //
2326 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_fmin(
2327 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
2328 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2329 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef double @llvm.minnum.f64(double nofpclass(nan inf) [[X]], double nofpclass(nan inf) [[Y]])
2330 // FINITEONLY-NEXT: ret double [[TMP0]]
2331 //
2332 // APPROX-LABEL: define dso_local noundef double @test_fmin(
2333 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
2334 // APPROX-NEXT: [[ENTRY:.*:]]
2335 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.minnum.f64(double [[X]], double [[Y]])
2336 // APPROX-NEXT: ret double [[TMP0]]
2337 //
2338 // NCRDIV-LABEL: define dso_local noundef double @test_fmin(
2339 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
2340 // NCRDIV-NEXT: [[ENTRY:.*:]]
2341 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.minnum.f64(double [[X]], double [[Y]])
2342 // NCRDIV-NEXT: ret double [[TMP0]]
2343 //
2344 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_fmin(
2345 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
2346 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2347 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) double @llvm.minnum.f64(double [[X]], double [[Y]])
2348 // AMDGCNSPIRV-NEXT: ret double [[TMP0]]
2349 //
2350 extern "C" __device__ double test_fmin(double x, double y) {
2351 return fmin(x, y);
2352 }
2353
2354 // DEFAULT-LABEL: define dso_local noundef float @test_fmodf(
2355 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
2356 // DEFAULT-NEXT: [[ENTRY:.*:]]
2357 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_fmod_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
2358 // DEFAULT-NEXT: ret float [[CALL_I]]
2359 //
2360 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_fmodf(
2361 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
2362 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2363 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_fmod_f32(float noundef nofpclass(nan inf) [[X]], float noundef nofpclass(nan inf) [[Y]]) #[[ATTR13]]
2364 // FINITEONLY-NEXT: ret float [[CALL_I]]
2365 //
2366 // APPROX-LABEL: define dso_local noundef float @test_fmodf(
2367 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
2368 // APPROX-NEXT: [[ENTRY:.*:]]
2369 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_fmod_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
2370 // APPROX-NEXT: ret float [[CALL_I]]
2371 //
2372 // NCRDIV-LABEL: define dso_local noundef float @test_fmodf(
2373 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
2374 // NCRDIV-NEXT: [[ENTRY:.*:]]
2375 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_fmod_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
2376 // NCRDIV-NEXT: ret float [[CALL_I]]
2377 //
2378 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_fmodf(
2379 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
2380 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2381 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_fmod_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
2382 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
2383 //
2384 extern "C" __device__ float test_fmodf(float x, float y) {
2385 return fmodf(x, y);
2386 }
2387
2388 // DEFAULT-LABEL: define dso_local noundef double @test_fmod(
2389 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
2390 // DEFAULT-NEXT: [[ENTRY:.*:]]
2391 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_fmod_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
2392 // DEFAULT-NEXT: ret double [[CALL_I]]
2393 //
2394 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_fmod(
2395 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
2396 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2397 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_fmod_f64(double noundef nofpclass(nan inf) [[X]], double noundef nofpclass(nan inf) [[Y]]) #[[ATTR13]]
2398 // FINITEONLY-NEXT: ret double [[CALL_I]]
2399 //
2400 // APPROX-LABEL: define dso_local noundef double @test_fmod(
2401 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
2402 // APPROX-NEXT: [[ENTRY:.*:]]
2403 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_fmod_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
2404 // APPROX-NEXT: ret double [[CALL_I]]
2405 //
2406 // NCRDIV-LABEL: define dso_local noundef double @test_fmod(
2407 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
2408 // NCRDIV-NEXT: [[ENTRY:.*:]]
2409 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_fmod_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
2410 // NCRDIV-NEXT: ret double [[CALL_I]]
2411 //
2412 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_fmod(
2413 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
2414 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2415 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_fmod_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
2416 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
2417 //
2418 extern "C" __device__ double test_fmod(double x, double y) {
2419 return fmod(x, y);
2420 }
2421
2422 // DEFAULT-LABEL: define dso_local noundef float @test_frexpf(
2423 // DEFAULT-SAME: float noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]]) local_unnamed_addr #[[ATTR7:[0-9]+]] {
2424 // DEFAULT-NEXT: [[ENTRY:.*:]]
2425 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
2426 // DEFAULT-NEXT: [[TMP1:%.*]] = extractvalue { float, i32 } [[TMP0]], 1
2427 // DEFAULT-NEXT: store i32 [[TMP1]], ptr [[Y]], align 4, !tbaa [[INT_TBAA4:![0-9]+]]
2428 // DEFAULT-NEXT: [[TMP2:%.*]] = extractvalue { float, i32 } [[TMP0]], 0
2429 // DEFAULT-NEXT: ret float [[TMP2]]
2430 //
2431 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_frexpf(
2432 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]]) local_unnamed_addr #[[ATTR7:[0-9]+]] {
2433 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2434 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call { float, i32 } @llvm.frexp.f32.i32(float nofpclass(nan inf) [[X]])
2435 // FINITEONLY-NEXT: [[TMP1:%.*]] = extractvalue { float, i32 } [[TMP0]], 1
2436 // FINITEONLY-NEXT: store i32 [[TMP1]], ptr [[Y]], align 4, !tbaa [[INT_TBAA4:![0-9]+]]
2437 // FINITEONLY-NEXT: [[TMP2:%.*]] = extractvalue { float, i32 } [[TMP0]], 0
2438 // FINITEONLY-NEXT: ret float [[TMP2]]
2439 //
2440 // APPROX-LABEL: define dso_local noundef float @test_frexpf(
2441 // APPROX-SAME: float noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]]) local_unnamed_addr #[[ATTR7:[0-9]+]] {
2442 // APPROX-NEXT: [[ENTRY:.*:]]
2443 // APPROX-NEXT: [[TMP0:%.*]] = tail call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
2444 // APPROX-NEXT: [[TMP1:%.*]] = extractvalue { float, i32 } [[TMP0]], 1
2445 // APPROX-NEXT: store i32 [[TMP1]], ptr [[Y]], align 4, !tbaa [[INT_TBAA4:![0-9]+]]
2446 // APPROX-NEXT: [[TMP2:%.*]] = extractvalue { float, i32 } [[TMP0]], 0
2447 // APPROX-NEXT: ret float [[TMP2]]
2448 //
2449 // NCRDIV-LABEL: define dso_local noundef float @test_frexpf(
2450 // NCRDIV-SAME: float noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]]) local_unnamed_addr #[[ATTR7:[0-9]+]] {
2451 // NCRDIV-NEXT: [[ENTRY:.*:]]
2452 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
2453 // NCRDIV-NEXT: [[TMP1:%.*]] = extractvalue { float, i32 } [[TMP0]], 1
2454 // NCRDIV-NEXT: store i32 [[TMP1]], ptr [[Y]], align 4, !tbaa [[INT_TBAA4:![0-9]+]]
2455 // NCRDIV-NEXT: [[TMP2:%.*]] = extractvalue { float, i32 } [[TMP0]], 0
2456 // NCRDIV-NEXT: ret float [[TMP2]]
2457 //
2458 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_frexpf(
2459 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], ptr addrspace(4) noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR7:[0-9]+]] {
2460 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2461 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call addrspace(4) { float, i32 } @llvm.frexp.f32.i32(float [[X]])
2462 // AMDGCNSPIRV-NEXT: [[TMP1:%.*]] = extractvalue { float, i32 } [[TMP0]], 1
2463 // AMDGCNSPIRV-NEXT: store i32 [[TMP1]], ptr addrspace(4) [[Y]], align 4, !tbaa [[INT_TBAA5:![0-9]+]]
2464 // AMDGCNSPIRV-NEXT: [[TMP2:%.*]] = extractvalue { float, i32 } [[TMP0]], 0
2465 // AMDGCNSPIRV-NEXT: ret float [[TMP2]]
2466 //
2467 extern "C" __device__ float test_frexpf(float x, int* y) {
2468 return frexpf(x, y);
2469 }
2470
2471 // DEFAULT-LABEL: define dso_local noundef double @test_frexp(
2472 // DEFAULT-SAME: double noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]]) local_unnamed_addr #[[ATTR7]] {
2473 // DEFAULT-NEXT: [[ENTRY:.*:]]
2474 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call { double, i32 } @llvm.frexp.f64.i32(double [[X]])
2475 // DEFAULT-NEXT: [[TMP1:%.*]] = extractvalue { double, i32 } [[TMP0]], 1
2476 // DEFAULT-NEXT: store i32 [[TMP1]], ptr [[Y]], align 4, !tbaa [[INT_TBAA4]]
2477 // DEFAULT-NEXT: [[TMP2:%.*]] = extractvalue { double, i32 } [[TMP0]], 0
2478 // DEFAULT-NEXT: ret double [[TMP2]]
2479 //
2480 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_frexp(
2481 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]]) local_unnamed_addr #[[ATTR7]] {
2482 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2483 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call { double, i32 } @llvm.frexp.f64.i32(double nofpclass(nan inf) [[X]])
2484 // FINITEONLY-NEXT: [[TMP1:%.*]] = extractvalue { double, i32 } [[TMP0]], 1
2485 // FINITEONLY-NEXT: store i32 [[TMP1]], ptr [[Y]], align 4, !tbaa [[INT_TBAA4]]
2486 // FINITEONLY-NEXT: [[TMP2:%.*]] = extractvalue { double, i32 } [[TMP0]], 0
2487 // FINITEONLY-NEXT: ret double [[TMP2]]
2488 //
2489 // APPROX-LABEL: define dso_local noundef double @test_frexp(
2490 // APPROX-SAME: double noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]]) local_unnamed_addr #[[ATTR7]] {
2491 // APPROX-NEXT: [[ENTRY:.*:]]
2492 // APPROX-NEXT: [[TMP0:%.*]] = tail call { double, i32 } @llvm.frexp.f64.i32(double [[X]])
2493 // APPROX-NEXT: [[TMP1:%.*]] = extractvalue { double, i32 } [[TMP0]], 1
2494 // APPROX-NEXT: store i32 [[TMP1]], ptr [[Y]], align 4, !tbaa [[INT_TBAA4]]
2495 // APPROX-NEXT: [[TMP2:%.*]] = extractvalue { double, i32 } [[TMP0]], 0
2496 // APPROX-NEXT: ret double [[TMP2]]
2497 //
2498 // NCRDIV-LABEL: define dso_local noundef double @test_frexp(
2499 // NCRDIV-SAME: double noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]]) local_unnamed_addr #[[ATTR7]] {
2500 // NCRDIV-NEXT: [[ENTRY:.*:]]
2501 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call { double, i32 } @llvm.frexp.f64.i32(double [[X]])
2502 // NCRDIV-NEXT: [[TMP1:%.*]] = extractvalue { double, i32 } [[TMP0]], 1
2503 // NCRDIV-NEXT: store i32 [[TMP1]], ptr [[Y]], align 4, !tbaa [[INT_TBAA4]]
2504 // NCRDIV-NEXT: [[TMP2:%.*]] = extractvalue { double, i32 } [[TMP0]], 0
2505 // NCRDIV-NEXT: ret double [[TMP2]]
2506 //
2507 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_frexp(
2508 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], ptr addrspace(4) noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR7]] {
2509 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2510 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call addrspace(4) { double, i32 } @llvm.frexp.f64.i32(double [[X]])
2511 // AMDGCNSPIRV-NEXT: [[TMP1:%.*]] = extractvalue { double, i32 } [[TMP0]], 1
2512 // AMDGCNSPIRV-NEXT: store i32 [[TMP1]], ptr addrspace(4) [[Y]], align 4, !tbaa [[INT_TBAA5]]
2513 // AMDGCNSPIRV-NEXT: [[TMP2:%.*]] = extractvalue { double, i32 } [[TMP0]], 0
2514 // AMDGCNSPIRV-NEXT: ret double [[TMP2]]
2515 //
2516 extern "C" __device__ double test_frexp(double x, int* y) {
2517 return frexp(x, y);
2518 }
2519
2520 // DEFAULT-LABEL: define dso_local noundef float @test_hypotf(
2521 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
2522 // DEFAULT-NEXT: [[ENTRY:.*:]]
2523 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_hypot_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
2524 // DEFAULT-NEXT: ret float [[CALL_I]]
2525 //
2526 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_hypotf(
2527 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
2528 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2529 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_hypot_f32(float noundef nofpclass(nan inf) [[X]], float noundef nofpclass(nan inf) [[Y]]) #[[ATTR13]]
2530 // FINITEONLY-NEXT: ret float [[CALL_I]]
2531 //
2532 // APPROX-LABEL: define dso_local noundef float @test_hypotf(
2533 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
2534 // APPROX-NEXT: [[ENTRY:.*:]]
2535 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_hypot_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
2536 // APPROX-NEXT: ret float [[CALL_I]]
2537 //
2538 // NCRDIV-LABEL: define dso_local noundef float @test_hypotf(
2539 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
2540 // NCRDIV-NEXT: [[ENTRY:.*:]]
2541 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_hypot_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
2542 // NCRDIV-NEXT: ret float [[CALL_I]]
2543 //
2544 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_hypotf(
2545 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
2546 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2547 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_hypot_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
2548 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
2549 //
2550 extern "C" __device__ float test_hypotf(float x, float y) {
2551 return hypotf(x, y);
2552 }
2553
2554 // DEFAULT-LABEL: define dso_local noundef double @test_hypot(
2555 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
2556 // DEFAULT-NEXT: [[ENTRY:.*:]]
2557 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_hypot_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
2558 // DEFAULT-NEXT: ret double [[CALL_I]]
2559 //
2560 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_hypot(
2561 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
2562 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2563 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_hypot_f64(double noundef nofpclass(nan inf) [[X]], double noundef nofpclass(nan inf) [[Y]]) #[[ATTR13]]
2564 // FINITEONLY-NEXT: ret double [[CALL_I]]
2565 //
2566 // APPROX-LABEL: define dso_local noundef double @test_hypot(
2567 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
2568 // APPROX-NEXT: [[ENTRY:.*:]]
2569 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_hypot_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
2570 // APPROX-NEXT: ret double [[CALL_I]]
2571 //
2572 // NCRDIV-LABEL: define dso_local noundef double @test_hypot(
2573 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
2574 // NCRDIV-NEXT: [[ENTRY:.*:]]
2575 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_hypot_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
2576 // NCRDIV-NEXT: ret double [[CALL_I]]
2577 //
2578 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_hypot(
2579 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
2580 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2581 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_hypot_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
2582 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
2583 //
2584 extern "C" __device__ double test_hypot(double x, double y) {
2585 return hypot(x, y);
2586 }
2587
2588 // DEFAULT-LABEL: define dso_local noundef i32 @test_ilogbf(
2589 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
2590 // DEFAULT-NEXT: [[ENTRY:.*:]]
2591 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call noundef i32 @__ocml_ilogb_f32(float noundef [[X]]) #[[ATTR13]]
2592 // DEFAULT-NEXT: ret i32 [[CALL_I]]
2593 //
2594 // FINITEONLY-LABEL: define dso_local noundef i32 @test_ilogbf(
2595 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
2596 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2597 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call noundef i32 @__ocml_ilogb_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR13]]
2598 // FINITEONLY-NEXT: ret i32 [[CALL_I]]
2599 //
2600 // APPROX-LABEL: define dso_local noundef i32 @test_ilogbf(
2601 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
2602 // APPROX-NEXT: [[ENTRY:.*:]]
2603 // APPROX-NEXT: [[CALL_I:%.*]] = tail call noundef i32 @__ocml_ilogb_f32(float noundef [[X]]) #[[ATTR13]]
2604 // APPROX-NEXT: ret i32 [[CALL_I]]
2605 //
2606 // NCRDIV-LABEL: define dso_local noundef i32 @test_ilogbf(
2607 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
2608 // NCRDIV-NEXT: [[ENTRY:.*:]]
2609 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call noundef i32 @__ocml_ilogb_f32(float noundef [[X]]) #[[ATTR13]]
2610 // NCRDIV-NEXT: ret i32 [[CALL_I]]
2611 //
2612 // AMDGCNSPIRV-LABEL: define spir_func noundef i32 @test_ilogbf(
2613 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
2614 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2615 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call spir_func noundef addrspace(4) i32 @__ocml_ilogb_f32(float noundef [[X]]) #[[ATTR13]]
2616 // AMDGCNSPIRV-NEXT: ret i32 [[CALL_I]]
2617 //
2618 extern "C" __device__ int test_ilogbf(float x) {
2619 return ilogbf(x);
2620 }
2621
2622 // DEFAULT-LABEL: define dso_local noundef i32 @test_ilogb(
2623 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
2624 // DEFAULT-NEXT: [[ENTRY:.*:]]
2625 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call noundef i32 @__ocml_ilogb_f64(double noundef [[X]]) #[[ATTR13]]
2626 // DEFAULT-NEXT: ret i32 [[CALL_I]]
2627 //
2628 // FINITEONLY-LABEL: define dso_local noundef i32 @test_ilogb(
2629 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
2630 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2631 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call noundef i32 @__ocml_ilogb_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR13]]
2632 // FINITEONLY-NEXT: ret i32 [[CALL_I]]
2633 //
2634 // APPROX-LABEL: define dso_local noundef i32 @test_ilogb(
2635 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
2636 // APPROX-NEXT: [[ENTRY:.*:]]
2637 // APPROX-NEXT: [[CALL_I:%.*]] = tail call noundef i32 @__ocml_ilogb_f64(double noundef [[X]]) #[[ATTR13]]
2638 // APPROX-NEXT: ret i32 [[CALL_I]]
2639 //
2640 // NCRDIV-LABEL: define dso_local noundef i32 @test_ilogb(
2641 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
2642 // NCRDIV-NEXT: [[ENTRY:.*:]]
2643 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call noundef i32 @__ocml_ilogb_f64(double noundef [[X]]) #[[ATTR13]]
2644 // NCRDIV-NEXT: ret i32 [[CALL_I]]
2645 //
2646 // AMDGCNSPIRV-LABEL: define spir_func noundef i32 @test_ilogb(
2647 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
2648 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2649 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call spir_func noundef addrspace(4) i32 @__ocml_ilogb_f64(double noundef [[X]]) #[[ATTR13]]
2650 // AMDGCNSPIRV-NEXT: ret i32 [[CALL_I]]
2651 //
2652 extern "C" __device__ int test_ilogb(double x) {
2653 return ilogb(x);
2654 }
2655
2656 // DEFAULT-LABEL: define dso_local range(i32 0, 2) i32 @test___finitef(
2657 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2658 // DEFAULT-NEXT: [[ENTRY:.*:]]
2659 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call float @llvm.fabs.f32(float [[X]])
2660 // DEFAULT-NEXT: [[TMP1:%.*]] = fcmp one float [[TMP0]], 0x7FF0000000000000
2661 // DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
2662 // DEFAULT-NEXT: ret i32 [[CONV]]
2663 //
2664 // FINITEONLY-LABEL: define dso_local noundef range(i32 0, 2) i32 @test___finitef(
2665 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2666 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2667 // FINITEONLY-NEXT: ret i32 1
2668 //
2669 // APPROX-LABEL: define dso_local range(i32 0, 2) i32 @test___finitef(
2670 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2671 // APPROX-NEXT: [[ENTRY:.*:]]
2672 // APPROX-NEXT: [[TMP0:%.*]] = tail call float @llvm.fabs.f32(float [[X]])
2673 // APPROX-NEXT: [[TMP1:%.*]] = fcmp one float [[TMP0]], 0x7FF0000000000000
2674 // APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
2675 // APPROX-NEXT: ret i32 [[CONV]]
2676 //
2677 // NCRDIV-LABEL: define dso_local range(i32 0, 2) i32 @test___finitef(
2678 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2679 // NCRDIV-NEXT: [[ENTRY:.*:]]
2680 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call float @llvm.fabs.f32(float [[X]])
2681 // NCRDIV-NEXT: [[TMP1:%.*]] = fcmp one float [[TMP0]], 0x7FF0000000000000
2682 // NCRDIV-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
2683 // NCRDIV-NEXT: ret i32 [[CONV]]
2684 //
2685 // AMDGCNSPIRV-LABEL: define spir_func range(i32 0, 2) i32 @test___finitef(
2686 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
2687 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2688 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call addrspace(4) float @llvm.fabs.f32(float [[X]])
2689 // AMDGCNSPIRV-NEXT: [[TMP1:%.*]] = fcmp one float [[TMP0]], 0x7FF0000000000000
2690 // AMDGCNSPIRV-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
2691 // AMDGCNSPIRV-NEXT: ret i32 [[CONV]]
2692 //
2693 extern "C" __device__ BOOL_TYPE test___finitef(float x) {
2694 return __finitef(x);
2695 }
2696
2697 // DEFAULT-LABEL: define dso_local range(i32 0, 2) i32 @test___finite(
2698 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2699 // DEFAULT-NEXT: [[ENTRY:.*:]]
2700 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call double @llvm.fabs.f64(double [[X]])
2701 // DEFAULT-NEXT: [[TMP1:%.*]] = fcmp one double [[TMP0]], 0x7FF0000000000000
2702 // DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
2703 // DEFAULT-NEXT: ret i32 [[CONV]]
2704 //
2705 // FINITEONLY-LABEL: define dso_local noundef range(i32 0, 2) i32 @test___finite(
2706 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2707 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2708 // FINITEONLY-NEXT: ret i32 1
2709 //
2710 // APPROX-LABEL: define dso_local range(i32 0, 2) i32 @test___finite(
2711 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2712 // APPROX-NEXT: [[ENTRY:.*:]]
2713 // APPROX-NEXT: [[TMP0:%.*]] = tail call double @llvm.fabs.f64(double [[X]])
2714 // APPROX-NEXT: [[TMP1:%.*]] = fcmp one double [[TMP0]], 0x7FF0000000000000
2715 // APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
2716 // APPROX-NEXT: ret i32 [[CONV]]
2717 //
2718 // NCRDIV-LABEL: define dso_local range(i32 0, 2) i32 @test___finite(
2719 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2720 // NCRDIV-NEXT: [[ENTRY:.*:]]
2721 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call double @llvm.fabs.f64(double [[X]])
2722 // NCRDIV-NEXT: [[TMP1:%.*]] = fcmp one double [[TMP0]], 0x7FF0000000000000
2723 // NCRDIV-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
2724 // NCRDIV-NEXT: ret i32 [[CONV]]
2725 //
2726 // AMDGCNSPIRV-LABEL: define spir_func range(i32 0, 2) i32 @test___finite(
2727 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
2728 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2729 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call addrspace(4) double @llvm.fabs.f64(double [[X]])
2730 // AMDGCNSPIRV-NEXT: [[TMP1:%.*]] = fcmp one double [[TMP0]], 0x7FF0000000000000
2731 // AMDGCNSPIRV-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
2732 // AMDGCNSPIRV-NEXT: ret i32 [[CONV]]
2733 //
2734 extern "C" __device__ BOOL_TYPE test___finite(double x) {
2735 return __finite(x);
2736 }
2737
2738 // DEFAULT-LABEL: define dso_local range(i32 0, 2) i32 @test___isinff(
2739 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2740 // DEFAULT-NEXT: [[ENTRY:.*:]]
2741 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call float @llvm.fabs.f32(float [[X]])
2742 // DEFAULT-NEXT: [[TMP1:%.*]] = fcmp oeq float [[TMP0]], 0x7FF0000000000000
2743 // DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
2744 // DEFAULT-NEXT: ret i32 [[CONV]]
2745 //
2746 // FINITEONLY-LABEL: define dso_local noundef range(i32 0, 2) i32 @test___isinff(
2747 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2748 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2749 // FINITEONLY-NEXT: ret i32 0
2750 //
2751 // APPROX-LABEL: define dso_local range(i32 0, 2) i32 @test___isinff(
2752 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2753 // APPROX-NEXT: [[ENTRY:.*:]]
2754 // APPROX-NEXT: [[TMP0:%.*]] = tail call float @llvm.fabs.f32(float [[X]])
2755 // APPROX-NEXT: [[TMP1:%.*]] = fcmp oeq float [[TMP0]], 0x7FF0000000000000
2756 // APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
2757 // APPROX-NEXT: ret i32 [[CONV]]
2758 //
2759 // NCRDIV-LABEL: define dso_local range(i32 0, 2) i32 @test___isinff(
2760 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2761 // NCRDIV-NEXT: [[ENTRY:.*:]]
2762 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call float @llvm.fabs.f32(float [[X]])
2763 // NCRDIV-NEXT: [[TMP1:%.*]] = fcmp oeq float [[TMP0]], 0x7FF0000000000000
2764 // NCRDIV-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
2765 // NCRDIV-NEXT: ret i32 [[CONV]]
2766 //
2767 // AMDGCNSPIRV-LABEL: define spir_func range(i32 0, 2) i32 @test___isinff(
2768 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
2769 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2770 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call addrspace(4) float @llvm.fabs.f32(float [[X]])
2771 // AMDGCNSPIRV-NEXT: [[TMP1:%.*]] = fcmp oeq float [[TMP0]], 0x7FF0000000000000
2772 // AMDGCNSPIRV-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
2773 // AMDGCNSPIRV-NEXT: ret i32 [[CONV]]
2774 //
2775 extern "C" __device__ BOOL_TYPE test___isinff(float x) {
2776 return __isinff(x);
2777 }
2778
2779 // DEFAULT-LABEL: define dso_local range(i32 0, 2) i32 @test___isinf(
2780 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2781 // DEFAULT-NEXT: [[ENTRY:.*:]]
2782 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call double @llvm.fabs.f64(double [[X]])
2783 // DEFAULT-NEXT: [[TMP1:%.*]] = fcmp oeq double [[TMP0]], 0x7FF0000000000000
2784 // DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
2785 // DEFAULT-NEXT: ret i32 [[CONV]]
2786 //
2787 // FINITEONLY-LABEL: define dso_local noundef range(i32 0, 2) i32 @test___isinf(
2788 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2789 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2790 // FINITEONLY-NEXT: ret i32 0
2791 //
2792 // APPROX-LABEL: define dso_local range(i32 0, 2) i32 @test___isinf(
2793 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2794 // APPROX-NEXT: [[ENTRY:.*:]]
2795 // APPROX-NEXT: [[TMP0:%.*]] = tail call double @llvm.fabs.f64(double [[X]])
2796 // APPROX-NEXT: [[TMP1:%.*]] = fcmp oeq double [[TMP0]], 0x7FF0000000000000
2797 // APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
2798 // APPROX-NEXT: ret i32 [[CONV]]
2799 //
2800 // NCRDIV-LABEL: define dso_local range(i32 0, 2) i32 @test___isinf(
2801 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2802 // NCRDIV-NEXT: [[ENTRY:.*:]]
2803 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call double @llvm.fabs.f64(double [[X]])
2804 // NCRDIV-NEXT: [[TMP1:%.*]] = fcmp oeq double [[TMP0]], 0x7FF0000000000000
2805 // NCRDIV-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
2806 // NCRDIV-NEXT: ret i32 [[CONV]]
2807 //
2808 // AMDGCNSPIRV-LABEL: define spir_func range(i32 0, 2) i32 @test___isinf(
2809 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
2810 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2811 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call addrspace(4) double @llvm.fabs.f64(double [[X]])
2812 // AMDGCNSPIRV-NEXT: [[TMP1:%.*]] = fcmp oeq double [[TMP0]], 0x7FF0000000000000
2813 // AMDGCNSPIRV-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
2814 // AMDGCNSPIRV-NEXT: ret i32 [[CONV]]
2815 //
2816 extern "C" __device__ BOOL_TYPE test___isinf(double x) {
2817 return __isinf(x);
2818 }
2819
2820 // DEFAULT-LABEL: define dso_local range(i32 0, 2) i32 @test___isnanf(
2821 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2822 // DEFAULT-NEXT: [[ENTRY:.*:]]
2823 // DEFAULT-NEXT: [[TMP0:%.*]] = fcmp uno float [[X]], 0.000000e+00
2824 // DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
2825 // DEFAULT-NEXT: ret i32 [[CONV]]
2826 //
2827 // FINITEONLY-LABEL: define dso_local noundef range(i32 0, 2) i32 @test___isnanf(
2828 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2829 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2830 // FINITEONLY-NEXT: ret i32 0
2831 //
2832 // APPROX-LABEL: define dso_local range(i32 0, 2) i32 @test___isnanf(
2833 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2834 // APPROX-NEXT: [[ENTRY:.*:]]
2835 // APPROX-NEXT: [[TMP0:%.*]] = fcmp uno float [[X]], 0.000000e+00
2836 // APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
2837 // APPROX-NEXT: ret i32 [[CONV]]
2838 //
2839 // NCRDIV-LABEL: define dso_local range(i32 0, 2) i32 @test___isnanf(
2840 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2841 // NCRDIV-NEXT: [[ENTRY:.*:]]
2842 // NCRDIV-NEXT: [[TMP0:%.*]] = fcmp uno float [[X]], 0.000000e+00
2843 // NCRDIV-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
2844 // NCRDIV-NEXT: ret i32 [[CONV]]
2845 //
2846 // AMDGCNSPIRV-LABEL: define spir_func range(i32 0, 2) i32 @test___isnanf(
2847 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
2848 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2849 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = fcmp uno float [[X]], 0.000000e+00
2850 // AMDGCNSPIRV-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
2851 // AMDGCNSPIRV-NEXT: ret i32 [[CONV]]
2852 //
2853 extern "C" __device__ BOOL_TYPE test___isnanf(float x) {
2854 return __isnanf(x);
2855 }
2856
2857 // DEFAULT-LABEL: define dso_local range(i32 0, 2) i32 @test___isnan(
2858 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2859 // DEFAULT-NEXT: [[ENTRY:.*:]]
2860 // DEFAULT-NEXT: [[TMP0:%.*]] = fcmp uno double [[X]], 0.000000e+00
2861 // DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
2862 // DEFAULT-NEXT: ret i32 [[CONV]]
2863 //
2864 // FINITEONLY-LABEL: define dso_local noundef range(i32 0, 2) i32 @test___isnan(
2865 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2866 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2867 // FINITEONLY-NEXT: ret i32 0
2868 //
2869 // APPROX-LABEL: define dso_local range(i32 0, 2) i32 @test___isnan(
2870 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2871 // APPROX-NEXT: [[ENTRY:.*:]]
2872 // APPROX-NEXT: [[TMP0:%.*]] = fcmp uno double [[X]], 0.000000e+00
2873 // APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
2874 // APPROX-NEXT: ret i32 [[CONV]]
2875 //
2876 // NCRDIV-LABEL: define dso_local range(i32 0, 2) i32 @test___isnan(
2877 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
2878 // NCRDIV-NEXT: [[ENTRY:.*:]]
2879 // NCRDIV-NEXT: [[TMP0:%.*]] = fcmp uno double [[X]], 0.000000e+00
2880 // NCRDIV-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
2881 // NCRDIV-NEXT: ret i32 [[CONV]]
2882 //
2883 // AMDGCNSPIRV-LABEL: define spir_func range(i32 0, 2) i32 @test___isnan(
2884 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
2885 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2886 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = fcmp uno double [[X]], 0.000000e+00
2887 // AMDGCNSPIRV-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
2888 // AMDGCNSPIRV-NEXT: ret i32 [[CONV]]
2889 //
2890 extern "C" __device__ BOOL_TYPE test___isnan(double x) {
2891 return __isnan(x);
2892 }
2893
2894 // DEFAULT-LABEL: define dso_local noundef float @test_j0f(
2895 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
2896 // DEFAULT-NEXT: [[ENTRY:.*:]]
2897 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_j0_f32(float noundef [[X]]) #[[ATTR15]]
2898 // DEFAULT-NEXT: ret float [[CALL_I]]
2899 //
2900 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_j0f(
2901 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
2902 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2903 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_j0_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
2904 // FINITEONLY-NEXT: ret float [[CALL_I]]
2905 //
2906 // APPROX-LABEL: define dso_local noundef float @test_j0f(
2907 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
2908 // APPROX-NEXT: [[ENTRY:.*:]]
2909 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_j0_f32(float noundef [[X]]) #[[ATTR15]]
2910 // APPROX-NEXT: ret float [[CALL_I]]
2911 //
2912 // NCRDIV-LABEL: define dso_local noundef float @test_j0f(
2913 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
2914 // NCRDIV-NEXT: [[ENTRY:.*:]]
2915 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_j0_f32(float noundef [[X]]) #[[ATTR15]]
2916 // NCRDIV-NEXT: ret float [[CALL_I]]
2917 //
2918 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_j0f(
2919 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
2920 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2921 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_j0_f32(float noundef [[X]]) #[[ATTR15]]
2922 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
2923 //
2924 extern "C" __device__ float test_j0f(float x) {
2925 return j0f(x);
2926 }
2927
2928 // DEFAULT-LABEL: define dso_local noundef double @test_j0(
2929 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
2930 // DEFAULT-NEXT: [[ENTRY:.*:]]
2931 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_j0_f64(double noundef [[X]]) #[[ATTR15]]
2932 // DEFAULT-NEXT: ret double [[CALL_I]]
2933 //
2934 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_j0(
2935 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
2936 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2937 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_j0_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
2938 // FINITEONLY-NEXT: ret double [[CALL_I]]
2939 //
2940 // APPROX-LABEL: define dso_local noundef double @test_j0(
2941 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
2942 // APPROX-NEXT: [[ENTRY:.*:]]
2943 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_j0_f64(double noundef [[X]]) #[[ATTR15]]
2944 // APPROX-NEXT: ret double [[CALL_I]]
2945 //
2946 // NCRDIV-LABEL: define dso_local noundef double @test_j0(
2947 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
2948 // NCRDIV-NEXT: [[ENTRY:.*:]]
2949 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_j0_f64(double noundef [[X]]) #[[ATTR15]]
2950 // NCRDIV-NEXT: ret double [[CALL_I]]
2951 //
2952 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_j0(
2953 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
2954 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2955 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_j0_f64(double noundef [[X]]) #[[ATTR15]]
2956 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
2957 //
2958 extern "C" __device__ double test_j0(double x) {
2959 return j0(x);
2960 }
2961
2962 // DEFAULT-LABEL: define dso_local noundef float @test_j1f(
2963 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
2964 // DEFAULT-NEXT: [[ENTRY:.*:]]
2965 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_j1_f32(float noundef [[X]]) #[[ATTR15]]
2966 // DEFAULT-NEXT: ret float [[CALL_I]]
2967 //
2968 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_j1f(
2969 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
2970 // FINITEONLY-NEXT: [[ENTRY:.*:]]
2971 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_j1_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
2972 // FINITEONLY-NEXT: ret float [[CALL_I]]
2973 //
2974 // APPROX-LABEL: define dso_local noundef float @test_j1f(
2975 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
2976 // APPROX-NEXT: [[ENTRY:.*:]]
2977 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_j1_f32(float noundef [[X]]) #[[ATTR15]]
2978 // APPROX-NEXT: ret float [[CALL_I]]
2979 //
2980 // NCRDIV-LABEL: define dso_local noundef float @test_j1f(
2981 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
2982 // NCRDIV-NEXT: [[ENTRY:.*:]]
2983 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_j1_f32(float noundef [[X]]) #[[ATTR15]]
2984 // NCRDIV-NEXT: ret float [[CALL_I]]
2985 //
2986 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_j1f(
2987 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
2988 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
2989 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_j1_f32(float noundef [[X]]) #[[ATTR15]]
2990 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
2991 //
2992 extern "C" __device__ float test_j1f(float x) {
2993 return j1f(x);
2994 }
2995
2996 // DEFAULT-LABEL: define dso_local noundef double @test_j1(
2997 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
2998 // DEFAULT-NEXT: [[ENTRY:.*:]]
2999 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_j1_f64(double noundef [[X]]) #[[ATTR15]]
3000 // DEFAULT-NEXT: ret double [[CALL_I]]
3001 //
3002 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_j1(
3003 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
3004 // FINITEONLY-NEXT: [[ENTRY:.*:]]
3005 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_j1_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
3006 // FINITEONLY-NEXT: ret double [[CALL_I]]
3007 //
3008 // APPROX-LABEL: define dso_local noundef double @test_j1(
3009 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
3010 // APPROX-NEXT: [[ENTRY:.*:]]
3011 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_j1_f64(double noundef [[X]]) #[[ATTR15]]
3012 // APPROX-NEXT: ret double [[CALL_I]]
3013 //
3014 // NCRDIV-LABEL: define dso_local noundef double @test_j1(
3015 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
3016 // NCRDIV-NEXT: [[ENTRY:.*:]]
3017 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_j1_f64(double noundef [[X]]) #[[ATTR15]]
3018 // NCRDIV-NEXT: ret double [[CALL_I]]
3019 //
3020 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_j1(
3021 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
3022 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
3023 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_j1_f64(double noundef [[X]]) #[[ATTR15]]
3024 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
3025 //
3026 extern "C" __device__ double test_j1(double x) {
3027 return j1(x);
3028 }
3029
3030 // DEFAULT-LABEL: define dso_local float @test_jnf(
3031 // DEFAULT-SAME: i32 noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
3032 // DEFAULT-NEXT: [[ENTRY:.*:]]
3033 // DEFAULT-NEXT: switch i32 [[X]], label %[[IF_END4_I:.*]] [
3034 // DEFAULT-NEXT: i32 0, label %[[IF_THEN_I:.*]]
3035 // DEFAULT-NEXT: i32 1, label %[[IF_THEN2_I:.*]]
3036 // DEFAULT-NEXT: ]
3037 // DEFAULT: [[IF_THEN_I]]:
3038 // DEFAULT-NEXT: [[CALL_I20_I:%.*]] = tail call contract noundef float @__ocml_j0_f32(float noundef [[Y]]) #[[ATTR15]]
3039 // DEFAULT-NEXT: br label %[[_ZL3JNFIF_EXIT:.*]]
3040 // DEFAULT: [[IF_THEN2_I]]:
3041 // DEFAULT-NEXT: [[CALL_I22_I:%.*]] = tail call contract noundef float @__ocml_j1_f32(float noundef [[Y]]) #[[ATTR15]]
3042 // DEFAULT-NEXT: br label %[[_ZL3JNFIF_EXIT]]
3043 // DEFAULT: [[IF_END4_I]]:
3044 // DEFAULT-NEXT: [[CALL_I_I:%.*]] = tail call contract noundef float @__ocml_j0_f32(float noundef [[Y]]) #[[ATTR15]]
3045 // DEFAULT-NEXT: [[CALL_I21_I:%.*]] = tail call contract noundef float @__ocml_j1_f32(float noundef [[Y]]) #[[ATTR15]]
3046 // DEFAULT-NEXT: [[CMP7_I1:%.*]] = icmp sgt i32 [[X]], 1
3047 // DEFAULT-NEXT: br i1 [[CMP7_I1]], label %[[FOR_BODY_I:.*]], label %[[_ZL3JNFIF_EXIT]]
3048 // DEFAULT: [[FOR_BODY_I]]:
3049 // DEFAULT-NEXT: [[__I_0_I4:%.*]] = phi i32 [ [[INC_I:%.*]], %[[FOR_BODY_I]] ], [ 1, %[[IF_END4_I]] ]
3050 // DEFAULT-NEXT: [[__X1_0_I3:%.*]] = phi float [ [[SUB_I:%.*]], %[[FOR_BODY_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ]
3051 // DEFAULT-NEXT: [[__X0_0_I2:%.*]] = phi float [ [[__X1_0_I3]], %[[FOR_BODY_I]] ], [ [[CALL_I_I]], %[[IF_END4_I]] ]
3052 // DEFAULT-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
3053 // DEFAULT-NEXT: [[CONV_I:%.*]] = uitofp nneg i32 [[MUL_I]] to float
3054 // DEFAULT-NEXT: [[DIV_I:%.*]] = fdiv contract float [[CONV_I]], [[Y]]
3055 // DEFAULT-NEXT: [[MUL8_I:%.*]] = fmul contract float [[__X1_0_I3]], [[DIV_I]]
3056 // DEFAULT-NEXT: [[SUB_I]] = fsub contract float [[MUL8_I]], [[__X0_0_I2]]
3057 // DEFAULT-NEXT: [[INC_I]] = add nuw nsw i32 [[__I_0_I4]], 1
3058 // DEFAULT-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC_I]], [[X]]
3059 // DEFAULT-NEXT: br i1 [[EXITCOND_NOT]], label %[[_ZL3JNFIF_EXIT]], label %[[FOR_BODY_I]], !llvm.loop [[LOOP14:![0-9]+]]
3060 // DEFAULT: [[_ZL3JNFIF_EXIT]]:
3061 // DEFAULT-NEXT: [[RETVAL_0_I:%.*]] = phi float [ [[CALL_I20_I]], %[[IF_THEN_I]] ], [ [[CALL_I22_I]], %[[IF_THEN2_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ], [ [[SUB_I]], %[[FOR_BODY_I]] ]
3062 // DEFAULT-NEXT: ret float [[RETVAL_0_I]]
3063 //
3064 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) float @test_jnf(
3065 // FINITEONLY-SAME: i32 noundef [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
3066 // FINITEONLY-NEXT: [[ENTRY:.*:]]
3067 // FINITEONLY-NEXT: switch i32 [[X]], label %[[IF_END4_I:.*]] [
3068 // FINITEONLY-NEXT: i32 0, label %[[IF_THEN_I:.*]]
3069 // FINITEONLY-NEXT: i32 1, label %[[IF_THEN2_I:.*]]
3070 // FINITEONLY-NEXT: ]
3071 // FINITEONLY: [[IF_THEN_I]]:
3072 // FINITEONLY-NEXT: [[CALL_I20_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_j0_f32(float noundef nofpclass(nan inf) [[Y]]) #[[ATTR15]]
3073 // FINITEONLY-NEXT: br label %[[_ZL3JNFIF_EXIT:.*]]
3074 // FINITEONLY: [[IF_THEN2_I]]:
3075 // FINITEONLY-NEXT: [[CALL_I22_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_j1_f32(float noundef nofpclass(nan inf) [[Y]]) #[[ATTR15]]
3076 // FINITEONLY-NEXT: br label %[[_ZL3JNFIF_EXIT]]
3077 // FINITEONLY: [[IF_END4_I]]:
3078 // FINITEONLY-NEXT: [[CALL_I_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_j0_f32(float noundef nofpclass(nan inf) [[Y]]) #[[ATTR15]]
3079 // FINITEONLY-NEXT: [[CALL_I21_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_j1_f32(float noundef nofpclass(nan inf) [[Y]]) #[[ATTR15]]
3080 // FINITEONLY-NEXT: [[CMP7_I1:%.*]] = icmp sgt i32 [[X]], 1
3081 // FINITEONLY-NEXT: br i1 [[CMP7_I1]], label %[[FOR_BODY_I:.*]], label %[[_ZL3JNFIF_EXIT]]
3082 // FINITEONLY: [[FOR_BODY_I]]:
3083 // FINITEONLY-NEXT: [[__I_0_I4:%.*]] = phi i32 [ [[INC_I:%.*]], %[[FOR_BODY_I]] ], [ 1, %[[IF_END4_I]] ]
3084 // FINITEONLY-NEXT: [[__X1_0_I3:%.*]] = phi float [ [[SUB_I:%.*]], %[[FOR_BODY_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ]
3085 // FINITEONLY-NEXT: [[__X0_0_I2:%.*]] = phi float [ [[__X1_0_I3]], %[[FOR_BODY_I]] ], [ [[CALL_I_I]], %[[IF_END4_I]] ]
3086 // FINITEONLY-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
3087 // FINITEONLY-NEXT: [[CONV_I:%.*]] = uitofp nneg i32 [[MUL_I]] to float
3088 // FINITEONLY-NEXT: [[DIV_I:%.*]] = fdiv nnan ninf contract float [[CONV_I]], [[Y]]
3089 // FINITEONLY-NEXT: [[MUL8_I:%.*]] = fmul nnan ninf contract float [[__X1_0_I3]], [[DIV_I]]
3090 // FINITEONLY-NEXT: [[SUB_I]] = fsub nnan ninf contract float [[MUL8_I]], [[__X0_0_I2]]
3091 // FINITEONLY-NEXT: [[INC_I]] = add nuw nsw i32 [[__I_0_I4]], 1
3092 // FINITEONLY-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC_I]], [[X]]
3093 // FINITEONLY-NEXT: br i1 [[EXITCOND_NOT]], label %[[_ZL3JNFIF_EXIT]], label %[[FOR_BODY_I]], !llvm.loop [[LOOP14:![0-9]+]]
3094 // FINITEONLY: [[_ZL3JNFIF_EXIT]]:
3095 // FINITEONLY-NEXT: [[RETVAL_0_I:%.*]] = phi float [ [[CALL_I20_I]], %[[IF_THEN_I]] ], [ [[CALL_I22_I]], %[[IF_THEN2_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ], [ [[SUB_I]], %[[FOR_BODY_I]] ]
3096 // FINITEONLY-NEXT: ret float [[RETVAL_0_I]]
3097 //
3098 // APPROX-LABEL: define dso_local float @test_jnf(
3099 // APPROX-SAME: i32 noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
3100 // APPROX-NEXT: [[ENTRY:.*:]]
3101 // APPROX-NEXT: switch i32 [[X]], label %[[IF_END4_I:.*]] [
3102 // APPROX-NEXT: i32 0, label %[[IF_THEN_I:.*]]
3103 // APPROX-NEXT: i32 1, label %[[IF_THEN2_I:.*]]
3104 // APPROX-NEXT: ]
3105 // APPROX: [[IF_THEN_I]]:
3106 // APPROX-NEXT: [[CALL_I20_I:%.*]] = tail call contract noundef float @__ocml_j0_f32(float noundef [[Y]]) #[[ATTR15]]
3107 // APPROX-NEXT: br label %[[_ZL3JNFIF_EXIT:.*]]
3108 // APPROX: [[IF_THEN2_I]]:
3109 // APPROX-NEXT: [[CALL_I22_I:%.*]] = tail call contract noundef float @__ocml_j1_f32(float noundef [[Y]]) #[[ATTR15]]
3110 // APPROX-NEXT: br label %[[_ZL3JNFIF_EXIT]]
3111 // APPROX: [[IF_END4_I]]:
3112 // APPROX-NEXT: [[CALL_I_I:%.*]] = tail call contract noundef float @__ocml_j0_f32(float noundef [[Y]]) #[[ATTR15]]
3113 // APPROX-NEXT: [[CALL_I21_I:%.*]] = tail call contract noundef float @__ocml_j1_f32(float noundef [[Y]]) #[[ATTR15]]
3114 // APPROX-NEXT: [[CMP7_I1:%.*]] = icmp sgt i32 [[X]], 1
3115 // APPROX-NEXT: br i1 [[CMP7_I1]], label %[[FOR_BODY_I:.*]], label %[[_ZL3JNFIF_EXIT]]
3116 // APPROX: [[FOR_BODY_I]]:
3117 // APPROX-NEXT: [[__I_0_I4:%.*]] = phi i32 [ [[INC_I:%.*]], %[[FOR_BODY_I]] ], [ 1, %[[IF_END4_I]] ]
3118 // APPROX-NEXT: [[__X1_0_I3:%.*]] = phi float [ [[SUB_I:%.*]], %[[FOR_BODY_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ]
3119 // APPROX-NEXT: [[__X0_0_I2:%.*]] = phi float [ [[__X1_0_I3]], %[[FOR_BODY_I]] ], [ [[CALL_I_I]], %[[IF_END4_I]] ]
3120 // APPROX-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
3121 // APPROX-NEXT: [[CONV_I:%.*]] = uitofp nneg i32 [[MUL_I]] to float
3122 // APPROX-NEXT: [[DIV_I:%.*]] = fdiv contract float [[CONV_I]], [[Y]]
3123 // APPROX-NEXT: [[MUL8_I:%.*]] = fmul contract float [[__X1_0_I3]], [[DIV_I]]
3124 // APPROX-NEXT: [[SUB_I]] = fsub contract float [[MUL8_I]], [[__X0_0_I2]]
3125 // APPROX-NEXT: [[INC_I]] = add nuw nsw i32 [[__I_0_I4]], 1
3126 // APPROX-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC_I]], [[X]]
3127 // APPROX-NEXT: br i1 [[EXITCOND_NOT]], label %[[_ZL3JNFIF_EXIT]], label %[[FOR_BODY_I]], !llvm.loop [[LOOP14:![0-9]+]]
3128 // APPROX: [[_ZL3JNFIF_EXIT]]:
3129 // APPROX-NEXT: [[RETVAL_0_I:%.*]] = phi float [ [[CALL_I20_I]], %[[IF_THEN_I]] ], [ [[CALL_I22_I]], %[[IF_THEN2_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ], [ [[SUB_I]], %[[FOR_BODY_I]] ]
3130 // APPROX-NEXT: ret float [[RETVAL_0_I]]
3131 //
3132 // NCRDIV-LABEL: define dso_local float @test_jnf(
3133 // NCRDIV-SAME: i32 noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
3134 // NCRDIV-NEXT: [[ENTRY:.*:]]
3135 // NCRDIV-NEXT: switch i32 [[X]], label %[[IF_END4_I:.*]] [
3136 // NCRDIV-NEXT: i32 0, label %[[IF_THEN_I:.*]]
3137 // NCRDIV-NEXT: i32 1, label %[[IF_THEN2_I:.*]]
3138 // NCRDIV-NEXT: ]
3139 // NCRDIV: [[IF_THEN_I]]:
3140 // NCRDIV-NEXT: [[CALL_I20_I:%.*]] = tail call contract noundef float @__ocml_j0_f32(float noundef [[Y]]) #[[ATTR15]]
3141 // NCRDIV-NEXT: br label %[[_ZL3JNFIF_EXIT:.*]]
3142 // NCRDIV: [[IF_THEN2_I]]:
3143 // NCRDIV-NEXT: [[CALL_I22_I:%.*]] = tail call contract noundef float @__ocml_j1_f32(float noundef [[Y]]) #[[ATTR15]]
3144 // NCRDIV-NEXT: br label %[[_ZL3JNFIF_EXIT]]
3145 // NCRDIV: [[IF_END4_I]]:
3146 // NCRDIV-NEXT: [[CALL_I_I:%.*]] = tail call contract noundef float @__ocml_j0_f32(float noundef [[Y]]) #[[ATTR15]]
3147 // NCRDIV-NEXT: [[CALL_I21_I:%.*]] = tail call contract noundef float @__ocml_j1_f32(float noundef [[Y]]) #[[ATTR15]]
3148 // NCRDIV-NEXT: [[CMP7_I1:%.*]] = icmp sgt i32 [[X]], 1
3149 // NCRDIV-NEXT: br i1 [[CMP7_I1]], label %[[FOR_BODY_I:.*]], label %[[_ZL3JNFIF_EXIT]]
3150 // NCRDIV: [[FOR_BODY_I]]:
3151 // NCRDIV-NEXT: [[__I_0_I4:%.*]] = phi i32 [ [[INC_I:%.*]], %[[FOR_BODY_I]] ], [ 1, %[[IF_END4_I]] ]
3152 // NCRDIV-NEXT: [[__X1_0_I3:%.*]] = phi float [ [[SUB_I:%.*]], %[[FOR_BODY_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ]
3153 // NCRDIV-NEXT: [[__X0_0_I2:%.*]] = phi float [ [[__X1_0_I3]], %[[FOR_BODY_I]] ], [ [[CALL_I_I]], %[[IF_END4_I]] ]
3154 // NCRDIV-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
3155 // NCRDIV-NEXT: [[CONV_I:%.*]] = uitofp nneg i32 [[MUL_I]] to float
3156 // NCRDIV-NEXT: [[DIV_I:%.*]] = fdiv contract float [[CONV_I]], [[Y]], !fpmath [[META14]]
3157 // NCRDIV-NEXT: [[MUL8_I:%.*]] = fmul contract float [[__X1_0_I3]], [[DIV_I]]
3158 // NCRDIV-NEXT: [[SUB_I]] = fsub contract float [[MUL8_I]], [[__X0_0_I2]]
3159 // NCRDIV-NEXT: [[INC_I]] = add nuw nsw i32 [[__I_0_I4]], 1
3160 // NCRDIV-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC_I]], [[X]]
3161 // NCRDIV-NEXT: br i1 [[EXITCOND_NOT]], label %[[_ZL3JNFIF_EXIT]], label %[[FOR_BODY_I]], !llvm.loop [[LOOP15:![0-9]+]]
3162 // NCRDIV: [[_ZL3JNFIF_EXIT]]:
3163 // NCRDIV-NEXT: [[RETVAL_0_I:%.*]] = phi float [ [[CALL_I20_I]], %[[IF_THEN_I]] ], [ [[CALL_I22_I]], %[[IF_THEN2_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ], [ [[SUB_I]], %[[FOR_BODY_I]] ]
3164 // NCRDIV-NEXT: ret float [[RETVAL_0_I]]
3165 //
3166 // AMDGCNSPIRV-LABEL: define spir_func float @test_jnf(
3167 // AMDGCNSPIRV-SAME: i32 noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
3168 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
3169 // AMDGCNSPIRV-NEXT: switch i32 [[X]], label %[[IF_END4_I:.*]] [
3170 // AMDGCNSPIRV-NEXT: i32 0, label %[[IF_THEN_I:.*]]
3171 // AMDGCNSPIRV-NEXT: i32 1, label %[[IF_THEN2_I:.*]]
3172 // AMDGCNSPIRV-NEXT: ]
3173 // AMDGCNSPIRV: [[IF_THEN_I]]:
3174 // AMDGCNSPIRV-NEXT: [[CALL_I20_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_j0_f32(float noundef [[Y]]) #[[ATTR15]]
3175 // AMDGCNSPIRV-NEXT: br label %[[_ZL3JNFIF_EXIT:.*]]
3176 // AMDGCNSPIRV: [[IF_THEN2_I]]:
3177 // AMDGCNSPIRV-NEXT: [[CALL_I22_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_j1_f32(float noundef [[Y]]) #[[ATTR15]]
3178 // AMDGCNSPIRV-NEXT: br label %[[_ZL3JNFIF_EXIT]]
3179 // AMDGCNSPIRV: [[IF_END4_I]]:
3180 // AMDGCNSPIRV-NEXT: [[CALL_I_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_j0_f32(float noundef [[Y]]) #[[ATTR15]]
3181 // AMDGCNSPIRV-NEXT: [[CALL_I21_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_j1_f32(float noundef [[Y]]) #[[ATTR15]]
3182 // AMDGCNSPIRV-NEXT: [[CMP7_I1:%.*]] = icmp sgt i32 [[X]], 1
3183 // AMDGCNSPIRV-NEXT: br i1 [[CMP7_I1]], label %[[FOR_BODY_I:.*]], label %[[_ZL3JNFIF_EXIT]]
3184 // AMDGCNSPIRV: [[FOR_BODY_I]]:
3185 // AMDGCNSPIRV-NEXT: [[__I_0_I4:%.*]] = phi i32 [ [[INC_I:%.*]], %[[FOR_BODY_I]] ], [ 1, %[[IF_END4_I]] ]
3186 // AMDGCNSPIRV-NEXT: [[__X1_0_I3:%.*]] = phi float [ [[SUB_I:%.*]], %[[FOR_BODY_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ]
3187 // AMDGCNSPIRV-NEXT: [[__X0_0_I2:%.*]] = phi float [ [[__X1_0_I3]], %[[FOR_BODY_I]] ], [ [[CALL_I_I]], %[[IF_END4_I]] ]
3188 // AMDGCNSPIRV-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
3189 // AMDGCNSPIRV-NEXT: [[CONV_I:%.*]] = uitofp nneg i32 [[MUL_I]] to float
3190 // AMDGCNSPIRV-NEXT: [[DIV_I:%.*]] = fdiv contract float [[CONV_I]], [[Y]]
3191 // AMDGCNSPIRV-NEXT: [[MUL8_I:%.*]] = fmul contract float [[__X1_0_I3]], [[DIV_I]]
3192 // AMDGCNSPIRV-NEXT: [[SUB_I]] = fsub contract float [[MUL8_I]], [[__X0_0_I2]]
3193 // AMDGCNSPIRV-NEXT: [[INC_I]] = add nuw nsw i32 [[__I_0_I4]], 1
3194 // AMDGCNSPIRV-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC_I]], [[X]]
3195 // AMDGCNSPIRV-NEXT: br i1 [[EXITCOND_NOT]], label %[[_ZL3JNFIF_EXIT]], label %[[FOR_BODY_I]], !llvm.loop [[LOOP15:![0-9]+]]
3196 // AMDGCNSPIRV: [[_ZL3JNFIF_EXIT]]:
3197 // AMDGCNSPIRV-NEXT: [[RETVAL_0_I:%.*]] = phi float [ [[CALL_I20_I]], %[[IF_THEN_I]] ], [ [[CALL_I22_I]], %[[IF_THEN2_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ], [ [[SUB_I]], %[[FOR_BODY_I]] ]
3198 // AMDGCNSPIRV-NEXT: ret float [[RETVAL_0_I]]
3199 //
3200 extern "C" __device__ float test_jnf(int x, float y) {
3201 return jnf(x, y);
3202 }
3203
3204 // DEFAULT-LABEL: define dso_local double @test_jn(
3205 // DEFAULT-SAME: i32 noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
3206 // DEFAULT-NEXT: [[ENTRY:.*:]]
3207 // DEFAULT-NEXT: switch i32 [[X]], label %[[IF_END4_I:.*]] [
3208 // DEFAULT-NEXT: i32 0, label %[[IF_THEN_I:.*]]
3209 // DEFAULT-NEXT: i32 1, label %[[IF_THEN2_I:.*]]
3210 // DEFAULT-NEXT: ]
3211 // DEFAULT: [[IF_THEN_I]]:
3212 // DEFAULT-NEXT: [[CALL_I20_I:%.*]] = tail call contract noundef double @__ocml_j0_f64(double noundef [[Y]]) #[[ATTR15]]
3213 // DEFAULT-NEXT: br label %[[_ZL2JNID_EXIT:.*]]
3214 // DEFAULT: [[IF_THEN2_I]]:
3215 // DEFAULT-NEXT: [[CALL_I22_I:%.*]] = tail call contract noundef double @__ocml_j1_f64(double noundef [[Y]]) #[[ATTR15]]
3216 // DEFAULT-NEXT: br label %[[_ZL2JNID_EXIT]]
3217 // DEFAULT: [[IF_END4_I]]:
3218 // DEFAULT-NEXT: [[CALL_I_I:%.*]] = tail call contract noundef double @__ocml_j0_f64(double noundef [[Y]]) #[[ATTR15]]
3219 // DEFAULT-NEXT: [[CALL_I21_I:%.*]] = tail call contract noundef double @__ocml_j1_f64(double noundef [[Y]]) #[[ATTR15]]
3220 // DEFAULT-NEXT: [[CMP7_I1:%.*]] = icmp sgt i32 [[X]], 1
3221 // DEFAULT-NEXT: br i1 [[CMP7_I1]], label %[[FOR_BODY_I:.*]], label %[[_ZL2JNID_EXIT]]
3222 // DEFAULT: [[FOR_BODY_I]]:
3223 // DEFAULT-NEXT: [[__I_0_I4:%.*]] = phi i32 [ [[INC_I:%.*]], %[[FOR_BODY_I]] ], [ 1, %[[IF_END4_I]] ]
3224 // DEFAULT-NEXT: [[__X1_0_I3:%.*]] = phi double [ [[SUB_I:%.*]], %[[FOR_BODY_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ]
3225 // DEFAULT-NEXT: [[__X0_0_I2:%.*]] = phi double [ [[__X1_0_I3]], %[[FOR_BODY_I]] ], [ [[CALL_I_I]], %[[IF_END4_I]] ]
3226 // DEFAULT-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
3227 // DEFAULT-NEXT: [[CONV_I:%.*]] = uitofp nneg i32 [[MUL_I]] to double
3228 // DEFAULT-NEXT: [[DIV_I:%.*]] = fdiv contract double [[CONV_I]], [[Y]]
3229 // DEFAULT-NEXT: [[MUL8_I:%.*]] = fmul contract double [[__X1_0_I3]], [[DIV_I]]
3230 // DEFAULT-NEXT: [[SUB_I]] = fsub contract double [[MUL8_I]], [[__X0_0_I2]]
3231 // DEFAULT-NEXT: [[INC_I]] = add nuw nsw i32 [[__I_0_I4]], 1
3232 // DEFAULT-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC_I]], [[X]]
3233 // DEFAULT-NEXT: br i1 [[EXITCOND_NOT]], label %[[_ZL2JNID_EXIT]], label %[[FOR_BODY_I]], !llvm.loop [[LOOP15:![0-9]+]]
3234 // DEFAULT: [[_ZL2JNID_EXIT]]:
3235 // DEFAULT-NEXT: [[RETVAL_0_I:%.*]] = phi double [ [[CALL_I20_I]], %[[IF_THEN_I]] ], [ [[CALL_I22_I]], %[[IF_THEN2_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ], [ [[SUB_I]], %[[FOR_BODY_I]] ]
3236 // DEFAULT-NEXT: ret double [[RETVAL_0_I]]
3237 //
3238 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) double @test_jn(
3239 // FINITEONLY-SAME: i32 noundef [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
3240 // FINITEONLY-NEXT: [[ENTRY:.*:]]
3241 // FINITEONLY-NEXT: switch i32 [[X]], label %[[IF_END4_I:.*]] [
3242 // FINITEONLY-NEXT: i32 0, label %[[IF_THEN_I:.*]]
3243 // FINITEONLY-NEXT: i32 1, label %[[IF_THEN2_I:.*]]
3244 // FINITEONLY-NEXT: ]
3245 // FINITEONLY: [[IF_THEN_I]]:
3246 // FINITEONLY-NEXT: [[CALL_I20_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_j0_f64(double noundef nofpclass(nan inf) [[Y]]) #[[ATTR15]]
3247 // FINITEONLY-NEXT: br label %[[_ZL2JNID_EXIT:.*]]
3248 // FINITEONLY: [[IF_THEN2_I]]:
3249 // FINITEONLY-NEXT: [[CALL_I22_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_j1_f64(double noundef nofpclass(nan inf) [[Y]]) #[[ATTR15]]
3250 // FINITEONLY-NEXT: br label %[[_ZL2JNID_EXIT]]
3251 // FINITEONLY: [[IF_END4_I]]:
3252 // FINITEONLY-NEXT: [[CALL_I_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_j0_f64(double noundef nofpclass(nan inf) [[Y]]) #[[ATTR15]]
3253 // FINITEONLY-NEXT: [[CALL_I21_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_j1_f64(double noundef nofpclass(nan inf) [[Y]]) #[[ATTR15]]
3254 // FINITEONLY-NEXT: [[CMP7_I1:%.*]] = icmp sgt i32 [[X]], 1
3255 // FINITEONLY-NEXT: br i1 [[CMP7_I1]], label %[[FOR_BODY_I:.*]], label %[[_ZL2JNID_EXIT]]
3256 // FINITEONLY: [[FOR_BODY_I]]:
3257 // FINITEONLY-NEXT: [[__I_0_I4:%.*]] = phi i32 [ [[INC_I:%.*]], %[[FOR_BODY_I]] ], [ 1, %[[IF_END4_I]] ]
3258 // FINITEONLY-NEXT: [[__X1_0_I3:%.*]] = phi double [ [[SUB_I:%.*]], %[[FOR_BODY_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ]
3259 // FINITEONLY-NEXT: [[__X0_0_I2:%.*]] = phi double [ [[__X1_0_I3]], %[[FOR_BODY_I]] ], [ [[CALL_I_I]], %[[IF_END4_I]] ]
3260 // FINITEONLY-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
3261 // FINITEONLY-NEXT: [[CONV_I:%.*]] = uitofp nneg i32 [[MUL_I]] to double
3262 // FINITEONLY-NEXT: [[DIV_I:%.*]] = fdiv nnan ninf contract double [[CONV_I]], [[Y]]
3263 // FINITEONLY-NEXT: [[MUL8_I:%.*]] = fmul nnan ninf contract double [[__X1_0_I3]], [[DIV_I]]
3264 // FINITEONLY-NEXT: [[SUB_I]] = fsub nnan ninf contract double [[MUL8_I]], [[__X0_0_I2]]
3265 // FINITEONLY-NEXT: [[INC_I]] = add nuw nsw i32 [[__I_0_I4]], 1
3266 // FINITEONLY-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC_I]], [[X]]
3267 // FINITEONLY-NEXT: br i1 [[EXITCOND_NOT]], label %[[_ZL2JNID_EXIT]], label %[[FOR_BODY_I]], !llvm.loop [[LOOP15:![0-9]+]]
3268 // FINITEONLY: [[_ZL2JNID_EXIT]]:
3269 // FINITEONLY-NEXT: [[RETVAL_0_I:%.*]] = phi double [ [[CALL_I20_I]], %[[IF_THEN_I]] ], [ [[CALL_I22_I]], %[[IF_THEN2_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ], [ [[SUB_I]], %[[FOR_BODY_I]] ]
3270 // FINITEONLY-NEXT: ret double [[RETVAL_0_I]]
3271 //
3272 // APPROX-LABEL: define dso_local double @test_jn(
3273 // APPROX-SAME: i32 noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
3274 // APPROX-NEXT: [[ENTRY:.*:]]
3275 // APPROX-NEXT: switch i32 [[X]], label %[[IF_END4_I:.*]] [
3276 // APPROX-NEXT: i32 0, label %[[IF_THEN_I:.*]]
3277 // APPROX-NEXT: i32 1, label %[[IF_THEN2_I:.*]]
3278 // APPROX-NEXT: ]
3279 // APPROX: [[IF_THEN_I]]:
3280 // APPROX-NEXT: [[CALL_I20_I:%.*]] = tail call contract noundef double @__ocml_j0_f64(double noundef [[Y]]) #[[ATTR15]]
3281 // APPROX-NEXT: br label %[[_ZL2JNID_EXIT:.*]]
3282 // APPROX: [[IF_THEN2_I]]:
3283 // APPROX-NEXT: [[CALL_I22_I:%.*]] = tail call contract noundef double @__ocml_j1_f64(double noundef [[Y]]) #[[ATTR15]]
3284 // APPROX-NEXT: br label %[[_ZL2JNID_EXIT]]
3285 // APPROX: [[IF_END4_I]]:
3286 // APPROX-NEXT: [[CALL_I_I:%.*]] = tail call contract noundef double @__ocml_j0_f64(double noundef [[Y]]) #[[ATTR15]]
3287 // APPROX-NEXT: [[CALL_I21_I:%.*]] = tail call contract noundef double @__ocml_j1_f64(double noundef [[Y]]) #[[ATTR15]]
3288 // APPROX-NEXT: [[CMP7_I1:%.*]] = icmp sgt i32 [[X]], 1
3289 // APPROX-NEXT: br i1 [[CMP7_I1]], label %[[FOR_BODY_I:.*]], label %[[_ZL2JNID_EXIT]]
3290 // APPROX: [[FOR_BODY_I]]:
3291 // APPROX-NEXT: [[__I_0_I4:%.*]] = phi i32 [ [[INC_I:%.*]], %[[FOR_BODY_I]] ], [ 1, %[[IF_END4_I]] ]
3292 // APPROX-NEXT: [[__X1_0_I3:%.*]] = phi double [ [[SUB_I:%.*]], %[[FOR_BODY_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ]
3293 // APPROX-NEXT: [[__X0_0_I2:%.*]] = phi double [ [[__X1_0_I3]], %[[FOR_BODY_I]] ], [ [[CALL_I_I]], %[[IF_END4_I]] ]
3294 // APPROX-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
3295 // APPROX-NEXT: [[CONV_I:%.*]] = uitofp nneg i32 [[MUL_I]] to double
3296 // APPROX-NEXT: [[DIV_I:%.*]] = fdiv contract double [[CONV_I]], [[Y]]
3297 // APPROX-NEXT: [[MUL8_I:%.*]] = fmul contract double [[__X1_0_I3]], [[DIV_I]]
3298 // APPROX-NEXT: [[SUB_I]] = fsub contract double [[MUL8_I]], [[__X0_0_I2]]
3299 // APPROX-NEXT: [[INC_I]] = add nuw nsw i32 [[__I_0_I4]], 1
3300 // APPROX-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC_I]], [[X]]
3301 // APPROX-NEXT: br i1 [[EXITCOND_NOT]], label %[[_ZL2JNID_EXIT]], label %[[FOR_BODY_I]], !llvm.loop [[LOOP15:![0-9]+]]
3302 // APPROX: [[_ZL2JNID_EXIT]]:
3303 // APPROX-NEXT: [[RETVAL_0_I:%.*]] = phi double [ [[CALL_I20_I]], %[[IF_THEN_I]] ], [ [[CALL_I22_I]], %[[IF_THEN2_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ], [ [[SUB_I]], %[[FOR_BODY_I]] ]
3304 // APPROX-NEXT: ret double [[RETVAL_0_I]]
3305 //
3306 // NCRDIV-LABEL: define dso_local double @test_jn(
3307 // NCRDIV-SAME: i32 noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
3308 // NCRDIV-NEXT: [[ENTRY:.*:]]
3309 // NCRDIV-NEXT: switch i32 [[X]], label %[[IF_END4_I:.*]] [
3310 // NCRDIV-NEXT: i32 0, label %[[IF_THEN_I:.*]]
3311 // NCRDIV-NEXT: i32 1, label %[[IF_THEN2_I:.*]]
3312 // NCRDIV-NEXT: ]
3313 // NCRDIV: [[IF_THEN_I]]:
3314 // NCRDIV-NEXT: [[CALL_I20_I:%.*]] = tail call contract noundef double @__ocml_j0_f64(double noundef [[Y]]) #[[ATTR15]]
3315 // NCRDIV-NEXT: br label %[[_ZL2JNID_EXIT:.*]]
3316 // NCRDIV: [[IF_THEN2_I]]:
3317 // NCRDIV-NEXT: [[CALL_I22_I:%.*]] = tail call contract noundef double @__ocml_j1_f64(double noundef [[Y]]) #[[ATTR15]]
3318 // NCRDIV-NEXT: br label %[[_ZL2JNID_EXIT]]
3319 // NCRDIV: [[IF_END4_I]]:
3320 // NCRDIV-NEXT: [[CALL_I_I:%.*]] = tail call contract noundef double @__ocml_j0_f64(double noundef [[Y]]) #[[ATTR15]]
3321 // NCRDIV-NEXT: [[CALL_I21_I:%.*]] = tail call contract noundef double @__ocml_j1_f64(double noundef [[Y]]) #[[ATTR15]]
3322 // NCRDIV-NEXT: [[CMP7_I1:%.*]] = icmp sgt i32 [[X]], 1
3323 // NCRDIV-NEXT: br i1 [[CMP7_I1]], label %[[FOR_BODY_I:.*]], label %[[_ZL2JNID_EXIT]]
3324 // NCRDIV: [[FOR_BODY_I]]:
3325 // NCRDIV-NEXT: [[__I_0_I4:%.*]] = phi i32 [ [[INC_I:%.*]], %[[FOR_BODY_I]] ], [ 1, %[[IF_END4_I]] ]
3326 // NCRDIV-NEXT: [[__X1_0_I3:%.*]] = phi double [ [[SUB_I:%.*]], %[[FOR_BODY_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ]
3327 // NCRDIV-NEXT: [[__X0_0_I2:%.*]] = phi double [ [[__X1_0_I3]], %[[FOR_BODY_I]] ], [ [[CALL_I_I]], %[[IF_END4_I]] ]
3328 // NCRDIV-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
3329 // NCRDIV-NEXT: [[CONV_I:%.*]] = uitofp nneg i32 [[MUL_I]] to double
3330 // NCRDIV-NEXT: [[DIV_I:%.*]] = fdiv contract double [[CONV_I]], [[Y]]
3331 // NCRDIV-NEXT: [[MUL8_I:%.*]] = fmul contract double [[__X1_0_I3]], [[DIV_I]]
3332 // NCRDIV-NEXT: [[SUB_I]] = fsub contract double [[MUL8_I]], [[__X0_0_I2]]
3333 // NCRDIV-NEXT: [[INC_I]] = add nuw nsw i32 [[__I_0_I4]], 1
3334 // NCRDIV-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC_I]], [[X]]
3335 // NCRDIV-NEXT: br i1 [[EXITCOND_NOT]], label %[[_ZL2JNID_EXIT]], label %[[FOR_BODY_I]], !llvm.loop [[LOOP16:![0-9]+]]
3336 // NCRDIV: [[_ZL2JNID_EXIT]]:
3337 // NCRDIV-NEXT: [[RETVAL_0_I:%.*]] = phi double [ [[CALL_I20_I]], %[[IF_THEN_I]] ], [ [[CALL_I22_I]], %[[IF_THEN2_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ], [ [[SUB_I]], %[[FOR_BODY_I]] ]
3338 // NCRDIV-NEXT: ret double [[RETVAL_0_I]]
3339 //
3340 // AMDGCNSPIRV-LABEL: define spir_func double @test_jn(
3341 // AMDGCNSPIRV-SAME: i32 noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
3342 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
3343 // AMDGCNSPIRV-NEXT: switch i32 [[X]], label %[[IF_END4_I:.*]] [
3344 // AMDGCNSPIRV-NEXT: i32 0, label %[[IF_THEN_I:.*]]
3345 // AMDGCNSPIRV-NEXT: i32 1, label %[[IF_THEN2_I:.*]]
3346 // AMDGCNSPIRV-NEXT: ]
3347 // AMDGCNSPIRV: [[IF_THEN_I]]:
3348 // AMDGCNSPIRV-NEXT: [[CALL_I20_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_j0_f64(double noundef [[Y]]) #[[ATTR15]]
3349 // AMDGCNSPIRV-NEXT: br label %[[_ZL2JNID_EXIT:.*]]
3350 // AMDGCNSPIRV: [[IF_THEN2_I]]:
3351 // AMDGCNSPIRV-NEXT: [[CALL_I22_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_j1_f64(double noundef [[Y]]) #[[ATTR15]]
3352 // AMDGCNSPIRV-NEXT: br label %[[_ZL2JNID_EXIT]]
3353 // AMDGCNSPIRV: [[IF_END4_I]]:
3354 // AMDGCNSPIRV-NEXT: [[CALL_I_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_j0_f64(double noundef [[Y]]) #[[ATTR15]]
3355 // AMDGCNSPIRV-NEXT: [[CALL_I21_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_j1_f64(double noundef [[Y]]) #[[ATTR15]]
3356 // AMDGCNSPIRV-NEXT: [[CMP7_I1:%.*]] = icmp sgt i32 [[X]], 1
3357 // AMDGCNSPIRV-NEXT: br i1 [[CMP7_I1]], label %[[FOR_BODY_I:.*]], label %[[_ZL2JNID_EXIT]]
3358 // AMDGCNSPIRV: [[FOR_BODY_I]]:
3359 // AMDGCNSPIRV-NEXT: [[__I_0_I4:%.*]] = phi i32 [ [[INC_I:%.*]], %[[FOR_BODY_I]] ], [ 1, %[[IF_END4_I]] ]
3360 // AMDGCNSPIRV-NEXT: [[__X1_0_I3:%.*]] = phi double [ [[SUB_I:%.*]], %[[FOR_BODY_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ]
3361 // AMDGCNSPIRV-NEXT: [[__X0_0_I2:%.*]] = phi double [ [[__X1_0_I3]], %[[FOR_BODY_I]] ], [ [[CALL_I_I]], %[[IF_END4_I]] ]
3362 // AMDGCNSPIRV-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
3363 // AMDGCNSPIRV-NEXT: [[CONV_I:%.*]] = uitofp nneg i32 [[MUL_I]] to double
3364 // AMDGCNSPIRV-NEXT: [[DIV_I:%.*]] = fdiv contract double [[CONV_I]], [[Y]]
3365 // AMDGCNSPIRV-NEXT: [[MUL8_I:%.*]] = fmul contract double [[__X1_0_I3]], [[DIV_I]]
3366 // AMDGCNSPIRV-NEXT: [[SUB_I]] = fsub contract double [[MUL8_I]], [[__X0_0_I2]]
3367 // AMDGCNSPIRV-NEXT: [[INC_I]] = add nuw nsw i32 [[__I_0_I4]], 1
3368 // AMDGCNSPIRV-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC_I]], [[X]]
3369 // AMDGCNSPIRV-NEXT: br i1 [[EXITCOND_NOT]], label %[[_ZL2JNID_EXIT]], label %[[FOR_BODY_I]], !llvm.loop [[LOOP16:![0-9]+]]
3370 // AMDGCNSPIRV: [[_ZL2JNID_EXIT]]:
3371 // AMDGCNSPIRV-NEXT: [[RETVAL_0_I:%.*]] = phi double [ [[CALL_I20_I]], %[[IF_THEN_I]] ], [ [[CALL_I22_I]], %[[IF_THEN2_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ], [ [[SUB_I]], %[[FOR_BODY_I]] ]
3372 // AMDGCNSPIRV-NEXT: ret double [[RETVAL_0_I]]
3373 //
3374 extern "C" __device__ double test_jn(int x, double y) {
3375 return jn(x, y);
3376 }
3377
3378 // DEFAULT-LABEL: define dso_local noundef float @test_ldexpf(
3379 // DEFAULT-SAME: float noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
3380 // DEFAULT-NEXT: [[ENTRY:.*:]]
3381 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.ldexp.f32.i32(float [[X]], i32 [[Y]])
3382 // DEFAULT-NEXT: ret float [[TMP0]]
3383 //
3384 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_ldexpf(
3385 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
3386 // FINITEONLY-NEXT: [[ENTRY:.*:]]
3387 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.ldexp.f32.i32(float nofpclass(nan inf) [[X]], i32 [[Y]])
3388 // FINITEONLY-NEXT: ret float [[TMP0]]
3389 //
3390 // APPROX-LABEL: define dso_local noundef float @test_ldexpf(
3391 // APPROX-SAME: float noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
3392 // APPROX-NEXT: [[ENTRY:.*:]]
3393 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.ldexp.f32.i32(float [[X]], i32 [[Y]])
3394 // APPROX-NEXT: ret float [[TMP0]]
3395 //
3396 // NCRDIV-LABEL: define dso_local noundef float @test_ldexpf(
3397 // NCRDIV-SAME: float noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
3398 // NCRDIV-NEXT: [[ENTRY:.*:]]
3399 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.ldexp.f32.i32(float [[X]], i32 [[Y]])
3400 // NCRDIV-NEXT: ret float [[TMP0]]
3401 //
3402 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_ldexpf(
3403 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
3404 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
3405 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.ldexp.f32.i32(float [[X]], i32 [[Y]])
3406 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
3407 //
3408 extern "C" __device__ float test_ldexpf(float x, int y) {
3409 return ldexpf(x, y);
3410 }
3411
3412 // DEFAULT-LABEL: define dso_local noundef double @test_ldexp(
3413 // DEFAULT-SAME: double noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
3414 // DEFAULT-NEXT: [[ENTRY:.*:]]
3415 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.ldexp.f64.i32(double [[X]], i32 [[Y]])
3416 // DEFAULT-NEXT: ret double [[TMP0]]
3417 //
3418 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_ldexp(
3419 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
3420 // FINITEONLY-NEXT: [[ENTRY:.*:]]
3421 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef double @llvm.ldexp.f64.i32(double nofpclass(nan inf) [[X]], i32 [[Y]])
3422 // FINITEONLY-NEXT: ret double [[TMP0]]
3423 //
3424 // APPROX-LABEL: define dso_local noundef double @test_ldexp(
3425 // APPROX-SAME: double noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
3426 // APPROX-NEXT: [[ENTRY:.*:]]
3427 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.ldexp.f64.i32(double [[X]], i32 [[Y]])
3428 // APPROX-NEXT: ret double [[TMP0]]
3429 //
3430 // NCRDIV-LABEL: define dso_local noundef double @test_ldexp(
3431 // NCRDIV-SAME: double noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
3432 // NCRDIV-NEXT: [[ENTRY:.*:]]
3433 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.ldexp.f64.i32(double [[X]], i32 [[Y]])
3434 // NCRDIV-NEXT: ret double [[TMP0]]
3435 //
3436 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_ldexp(
3437 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
3438 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
3439 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) double @llvm.ldexp.f64.i32(double [[X]], i32 [[Y]])
3440 // AMDGCNSPIRV-NEXT: ret double [[TMP0]]
3441 //
3442 extern "C" __device__ double test_ldexp(double x, int y) {
3443 return ldexp(x, y);
3444 }
3445
3446 // DEFAULT-LABEL: define dso_local noundef float @test_lgammaf(
3447 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
3448 // DEFAULT-NEXT: [[ENTRY:.*:]]
3449 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_lgamma_f32(float noundef [[X]]) #[[ATTR15]]
3450 // DEFAULT-NEXT: ret float [[CALL_I]]
3451 //
3452 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_lgammaf(
3453 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
3454 // FINITEONLY-NEXT: [[ENTRY:.*:]]
3455 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_lgamma_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
3456 // FINITEONLY-NEXT: ret float [[CALL_I]]
3457 //
3458 // APPROX-LABEL: define dso_local noundef float @test_lgammaf(
3459 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
3460 // APPROX-NEXT: [[ENTRY:.*:]]
3461 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_lgamma_f32(float noundef [[X]]) #[[ATTR15]]
3462 // APPROX-NEXT: ret float [[CALL_I]]
3463 //
3464 // NCRDIV-LABEL: define dso_local noundef float @test_lgammaf(
3465 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
3466 // NCRDIV-NEXT: [[ENTRY:.*:]]
3467 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_lgamma_f32(float noundef [[X]]) #[[ATTR15]]
3468 // NCRDIV-NEXT: ret float [[CALL_I]]
3469 //
3470 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_lgammaf(
3471 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
3472 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
3473 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_lgamma_f32(float noundef [[X]]) #[[ATTR15]]
3474 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
3475 //
3476 extern "C" __device__ float test_lgammaf(float x) {
3477 return lgammaf(x);
3478 }
3479
3480 // DEFAULT-LABEL: define dso_local noundef double @test_lgamma(
3481 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
3482 // DEFAULT-NEXT: [[ENTRY:.*:]]
3483 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_lgamma_f64(double noundef [[X]]) #[[ATTR15]]
3484 // DEFAULT-NEXT: ret double [[CALL_I]]
3485 //
3486 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_lgamma(
3487 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
3488 // FINITEONLY-NEXT: [[ENTRY:.*:]]
3489 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_lgamma_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
3490 // FINITEONLY-NEXT: ret double [[CALL_I]]
3491 //
3492 // APPROX-LABEL: define dso_local noundef double @test_lgamma(
3493 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
3494 // APPROX-NEXT: [[ENTRY:.*:]]
3495 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_lgamma_f64(double noundef [[X]]) #[[ATTR15]]
3496 // APPROX-NEXT: ret double [[CALL_I]]
3497 //
3498 // NCRDIV-LABEL: define dso_local noundef double @test_lgamma(
3499 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
3500 // NCRDIV-NEXT: [[ENTRY:.*:]]
3501 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_lgamma_f64(double noundef [[X]]) #[[ATTR15]]
3502 // NCRDIV-NEXT: ret double [[CALL_I]]
3503 //
3504 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_lgamma(
3505 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
3506 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
3507 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_lgamma_f64(double noundef [[X]]) #[[ATTR15]]
3508 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
3509 //
3510 extern "C" __device__ double test_lgamma(double x) {
3511 return lgamma(x);
3512 }
3513
3514 // DEFAULT-LABEL: define dso_local i64 @test_llrintf(
3515 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3516 // DEFAULT-NEXT: [[ENTRY:.*:]]
3517 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract float @llvm.rint.f32(float [[X]])
3518 // DEFAULT-NEXT: [[CONV_I:%.*]] = fptosi float [[TMP0]] to i64
3519 // DEFAULT-NEXT: ret i64 [[CONV_I]]
3520 //
3521 // FINITEONLY-LABEL: define dso_local i64 @test_llrintf(
3522 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3523 // FINITEONLY-NEXT: [[ENTRY:.*:]]
3524 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract float @llvm.rint.f32(float nofpclass(nan inf) [[X]])
3525 // FINITEONLY-NEXT: [[CONV_I:%.*]] = fptosi float [[TMP0]] to i64
3526 // FINITEONLY-NEXT: ret i64 [[CONV_I]]
3527 //
3528 // APPROX-LABEL: define dso_local i64 @test_llrintf(
3529 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3530 // APPROX-NEXT: [[ENTRY:.*:]]
3531 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract float @llvm.rint.f32(float [[X]])
3532 // APPROX-NEXT: [[CONV_I:%.*]] = fptosi float [[TMP0]] to i64
3533 // APPROX-NEXT: ret i64 [[CONV_I]]
3534 //
3535 // NCRDIV-LABEL: define dso_local i64 @test_llrintf(
3536 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3537 // NCRDIV-NEXT: [[ENTRY:.*:]]
3538 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract float @llvm.rint.f32(float [[X]])
3539 // NCRDIV-NEXT: [[CONV_I:%.*]] = fptosi float [[TMP0]] to i64
3540 // NCRDIV-NEXT: ret i64 [[CONV_I]]
3541 //
3542 // AMDGCNSPIRV-LABEL: define spir_func i64 @test_llrintf(
3543 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
3544 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
3545 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract addrspace(4) float @llvm.rint.f32(float [[X]])
3546 // AMDGCNSPIRV-NEXT: [[CONV_I:%.*]] = fptosi float [[TMP0]] to i64
3547 // AMDGCNSPIRV-NEXT: ret i64 [[CONV_I]]
3548 //
3549 extern "C" __device__ long long int test_llrintf(float x) {
3550 return llrintf(x);
3551 }
3552
3553 // DEFAULT-LABEL: define dso_local i64 @test_llrint(
3554 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3555 // DEFAULT-NEXT: [[ENTRY:.*:]]
3556 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract double @llvm.rint.f64(double [[X]])
3557 // DEFAULT-NEXT: [[CONV_I:%.*]] = fptosi double [[TMP0]] to i64
3558 // DEFAULT-NEXT: ret i64 [[CONV_I]]
3559 //
3560 // FINITEONLY-LABEL: define dso_local i64 @test_llrint(
3561 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3562 // FINITEONLY-NEXT: [[ENTRY:.*:]]
3563 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract double @llvm.rint.f64(double nofpclass(nan inf) [[X]])
3564 // FINITEONLY-NEXT: [[CONV_I:%.*]] = fptosi double [[TMP0]] to i64
3565 // FINITEONLY-NEXT: ret i64 [[CONV_I]]
3566 //
3567 // APPROX-LABEL: define dso_local i64 @test_llrint(
3568 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3569 // APPROX-NEXT: [[ENTRY:.*:]]
3570 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract double @llvm.rint.f64(double [[X]])
3571 // APPROX-NEXT: [[CONV_I:%.*]] = fptosi double [[TMP0]] to i64
3572 // APPROX-NEXT: ret i64 [[CONV_I]]
3573 //
3574 // NCRDIV-LABEL: define dso_local i64 @test_llrint(
3575 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3576 // NCRDIV-NEXT: [[ENTRY:.*:]]
3577 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract double @llvm.rint.f64(double [[X]])
3578 // NCRDIV-NEXT: [[CONV_I:%.*]] = fptosi double [[TMP0]] to i64
3579 // NCRDIV-NEXT: ret i64 [[CONV_I]]
3580 //
3581 // AMDGCNSPIRV-LABEL: define spir_func i64 @test_llrint(
3582 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
3583 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
3584 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract addrspace(4) double @llvm.rint.f64(double [[X]])
3585 // AMDGCNSPIRV-NEXT: [[CONV_I:%.*]] = fptosi double [[TMP0]] to i64
3586 // AMDGCNSPIRV-NEXT: ret i64 [[CONV_I]]
3587 //
3588 extern "C" __device__ long long int test_llrint(double x) {
3589 return llrint(x);
3590 }
3591
3592 // DEFAULT-LABEL: define dso_local i64 @test_llroundf(
3593 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3594 // DEFAULT-NEXT: [[ENTRY:.*:]]
3595 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract float @llvm.round.f32(float [[X]])
3596 // DEFAULT-NEXT: [[CONV_I:%.*]] = fptosi float [[TMP0]] to i64
3597 // DEFAULT-NEXT: ret i64 [[CONV_I]]
3598 //
3599 // FINITEONLY-LABEL: define dso_local i64 @test_llroundf(
3600 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3601 // FINITEONLY-NEXT: [[ENTRY:.*:]]
3602 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract float @llvm.round.f32(float nofpclass(nan inf) [[X]])
3603 // FINITEONLY-NEXT: [[CONV_I:%.*]] = fptosi float [[TMP0]] to i64
3604 // FINITEONLY-NEXT: ret i64 [[CONV_I]]
3605 //
3606 // APPROX-LABEL: define dso_local i64 @test_llroundf(
3607 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3608 // APPROX-NEXT: [[ENTRY:.*:]]
3609 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract float @llvm.round.f32(float [[X]])
3610 // APPROX-NEXT: [[CONV_I:%.*]] = fptosi float [[TMP0]] to i64
3611 // APPROX-NEXT: ret i64 [[CONV_I]]
3612 //
3613 // NCRDIV-LABEL: define dso_local i64 @test_llroundf(
3614 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3615 // NCRDIV-NEXT: [[ENTRY:.*:]]
3616 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract float @llvm.round.f32(float [[X]])
3617 // NCRDIV-NEXT: [[CONV_I:%.*]] = fptosi float [[TMP0]] to i64
3618 // NCRDIV-NEXT: ret i64 [[CONV_I]]
3619 //
3620 // AMDGCNSPIRV-LABEL: define spir_func i64 @test_llroundf(
3621 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
3622 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
3623 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract addrspace(4) float @llvm.round.f32(float [[X]])
3624 // AMDGCNSPIRV-NEXT: [[CONV_I:%.*]] = fptosi float [[TMP0]] to i64
3625 // AMDGCNSPIRV-NEXT: ret i64 [[CONV_I]]
3626 //
3627 extern "C" __device__ long long int test_llroundf(float x) {
3628 return llroundf(x);
3629 }
3630
3631 // DEFAULT-LABEL: define dso_local i64 @test_llround(
3632 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3633 // DEFAULT-NEXT: [[ENTRY:.*:]]
3634 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract double @llvm.round.f64(double [[X]])
3635 // DEFAULT-NEXT: [[CONV_I:%.*]] = fptosi double [[TMP0]] to i64
3636 // DEFAULT-NEXT: ret i64 [[CONV_I]]
3637 //
3638 // FINITEONLY-LABEL: define dso_local i64 @test_llround(
3639 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3640 // FINITEONLY-NEXT: [[ENTRY:.*:]]
3641 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract double @llvm.round.f64(double nofpclass(nan inf) [[X]])
3642 // FINITEONLY-NEXT: [[CONV_I:%.*]] = fptosi double [[TMP0]] to i64
3643 // FINITEONLY-NEXT: ret i64 [[CONV_I]]
3644 //
3645 // APPROX-LABEL: define dso_local i64 @test_llround(
3646 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3647 // APPROX-NEXT: [[ENTRY:.*:]]
3648 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract double @llvm.round.f64(double [[X]])
3649 // APPROX-NEXT: [[CONV_I:%.*]] = fptosi double [[TMP0]] to i64
3650 // APPROX-NEXT: ret i64 [[CONV_I]]
3651 //
3652 // NCRDIV-LABEL: define dso_local i64 @test_llround(
3653 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3654 // NCRDIV-NEXT: [[ENTRY:.*:]]
3655 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract double @llvm.round.f64(double [[X]])
3656 // NCRDIV-NEXT: [[CONV_I:%.*]] = fptosi double [[TMP0]] to i64
3657 // NCRDIV-NEXT: ret i64 [[CONV_I]]
3658 //
3659 // AMDGCNSPIRV-LABEL: define spir_func i64 @test_llround(
3660 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
3661 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
3662 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract addrspace(4) double @llvm.round.f64(double [[X]])
3663 // AMDGCNSPIRV-NEXT: [[CONV_I:%.*]] = fptosi double [[TMP0]] to i64
3664 // AMDGCNSPIRV-NEXT: ret i64 [[CONV_I]]
3665 //
3666 extern "C" __device__ long long int test_llround(double x) {
3667 return llround(x);
3668 }
3669
3670 // DEFAULT-LABEL: define dso_local noundef float @test_log10f(
3671 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3672 // DEFAULT-NEXT: [[ENTRY:.*:]]
3673 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.log10.f32(float [[X]])
3674 // DEFAULT-NEXT: ret float [[TMP0]]
3675 //
3676 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_log10f(
3677 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3678 // FINITEONLY-NEXT: [[ENTRY:.*:]]
3679 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.log10.f32(float nofpclass(nan inf) [[X]])
3680 // FINITEONLY-NEXT: ret float [[TMP0]]
3681 //
3682 // APPROX-LABEL: define dso_local noundef float @test_log10f(
3683 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3684 // APPROX-NEXT: [[ENTRY:.*:]]
3685 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.log10.f32(float [[X]])
3686 // APPROX-NEXT: ret float [[TMP0]]
3687 //
3688 // NCRDIV-LABEL: define dso_local noundef float @test_log10f(
3689 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3690 // NCRDIV-NEXT: [[ENTRY:.*:]]
3691 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.log10.f32(float [[X]])
3692 // NCRDIV-NEXT: ret float [[TMP0]]
3693 //
3694 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_log10f(
3695 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
3696 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
3697 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.log10.f32(float [[X]])
3698 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
3699 //
3700 extern "C" __device__ float test_log10f(float x) {
3701 return log10f(x);
3702 }
3703
3704 // DEFAULT-LABEL: define dso_local noundef double @test_log10(
3705 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
3706 // DEFAULT-NEXT: [[ENTRY:.*:]]
3707 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_log10_f64(double noundef [[X]]) #[[ATTR14]]
3708 // DEFAULT-NEXT: ret double [[CALL_I]]
3709 //
3710 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_log10(
3711 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
3712 // FINITEONLY-NEXT: [[ENTRY:.*:]]
3713 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_log10_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
3714 // FINITEONLY-NEXT: ret double [[CALL_I]]
3715 //
3716 // APPROX-LABEL: define dso_local noundef double @test_log10(
3717 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
3718 // APPROX-NEXT: [[ENTRY:.*:]]
3719 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_log10_f64(double noundef [[X]]) #[[ATTR14]]
3720 // APPROX-NEXT: ret double [[CALL_I]]
3721 //
3722 // NCRDIV-LABEL: define dso_local noundef double @test_log10(
3723 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
3724 // NCRDIV-NEXT: [[ENTRY:.*:]]
3725 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_log10_f64(double noundef [[X]]) #[[ATTR14]]
3726 // NCRDIV-NEXT: ret double [[CALL_I]]
3727 //
3728 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_log10(
3729 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
3730 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
3731 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_log10_f64(double noundef [[X]]) #[[ATTR14]]
3732 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
3733 //
3734 extern "C" __device__ double test_log10(double x) {
3735 return log10(x);
3736 }
3737
3738 // DEFAULT-LABEL: define dso_local noundef float @test_log1pf(
3739 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
3740 // DEFAULT-NEXT: [[ENTRY:.*:]]
3741 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_log1p_f32(float noundef [[X]]) #[[ATTR14]]
3742 // DEFAULT-NEXT: ret float [[CALL_I]]
3743 //
3744 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_log1pf(
3745 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
3746 // FINITEONLY-NEXT: [[ENTRY:.*:]]
3747 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_log1p_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
3748 // FINITEONLY-NEXT: ret float [[CALL_I]]
3749 //
3750 // APPROX-LABEL: define dso_local noundef float @test_log1pf(
3751 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
3752 // APPROX-NEXT: [[ENTRY:.*:]]
3753 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_log1p_f32(float noundef [[X]]) #[[ATTR14]]
3754 // APPROX-NEXT: ret float [[CALL_I]]
3755 //
3756 // NCRDIV-LABEL: define dso_local noundef float @test_log1pf(
3757 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
3758 // NCRDIV-NEXT: [[ENTRY:.*:]]
3759 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_log1p_f32(float noundef [[X]]) #[[ATTR14]]
3760 // NCRDIV-NEXT: ret float [[CALL_I]]
3761 //
3762 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_log1pf(
3763 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
3764 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
3765 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_log1p_f32(float noundef [[X]]) #[[ATTR14]]
3766 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
3767 //
3768 extern "C" __device__ float test_log1pf(float x) {
3769 return log1pf(x);
3770 }
3771
3772 // DEFAULT-LABEL: define dso_local noundef double @test_log1p(
3773 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
3774 // DEFAULT-NEXT: [[ENTRY:.*:]]
3775 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_log1p_f64(double noundef [[X]]) #[[ATTR14]]
3776 // DEFAULT-NEXT: ret double [[CALL_I]]
3777 //
3778 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_log1p(
3779 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
3780 // FINITEONLY-NEXT: [[ENTRY:.*:]]
3781 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_log1p_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
3782 // FINITEONLY-NEXT: ret double [[CALL_I]]
3783 //
3784 // APPROX-LABEL: define dso_local noundef double @test_log1p(
3785 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
3786 // APPROX-NEXT: [[ENTRY:.*:]]
3787 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_log1p_f64(double noundef [[X]]) #[[ATTR14]]
3788 // APPROX-NEXT: ret double [[CALL_I]]
3789 //
3790 // NCRDIV-LABEL: define dso_local noundef double @test_log1p(
3791 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
3792 // NCRDIV-NEXT: [[ENTRY:.*:]]
3793 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_log1p_f64(double noundef [[X]]) #[[ATTR14]]
3794 // NCRDIV-NEXT: ret double [[CALL_I]]
3795 //
3796 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_log1p(
3797 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
3798 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
3799 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_log1p_f64(double noundef [[X]]) #[[ATTR14]]
3800 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
3801 //
3802 extern "C" __device__ double test_log1p(double x) {
3803 return log1p(x);
3804 }
3805
3806 // DEFAULT-LABEL: define dso_local noundef float @test_log2f(
3807 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3808 // DEFAULT-NEXT: [[ENTRY:.*:]]
3809 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.log2.f32(float [[X]])
3810 // DEFAULT-NEXT: ret float [[TMP0]]
3811 //
3812 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_log2f(
3813 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3814 // FINITEONLY-NEXT: [[ENTRY:.*:]]
3815 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.log2.f32(float nofpclass(nan inf) [[X]])
3816 // FINITEONLY-NEXT: ret float [[TMP0]]
3817 //
3818 // APPROX-LABEL: define dso_local noundef float @test_log2f(
3819 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3820 // APPROX-NEXT: [[ENTRY:.*:]]
3821 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.amdgcn.log.f32(float [[X]])
3822 // APPROX-NEXT: ret float [[TMP0]]
3823 //
3824 // NCRDIV-LABEL: define dso_local noundef float @test_log2f(
3825 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3826 // NCRDIV-NEXT: [[ENTRY:.*:]]
3827 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.log2.f32(float [[X]])
3828 // NCRDIV-NEXT: ret float [[TMP0]]
3829 //
3830 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_log2f(
3831 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
3832 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
3833 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.log2.f32(float [[X]])
3834 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
3835 //
3836 extern "C" __device__ float test_log2f(float x) {
3837 return log2f(x);
3838 }
3839
3840 // DEFAULT-LABEL: define dso_local noundef double @test_log2(
3841 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
3842 // DEFAULT-NEXT: [[ENTRY:.*:]]
3843 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_log2_f64(double noundef [[X]]) #[[ATTR14]]
3844 // DEFAULT-NEXT: ret double [[CALL_I]]
3845 //
3846 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_log2(
3847 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
3848 // FINITEONLY-NEXT: [[ENTRY:.*:]]
3849 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_log2_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
3850 // FINITEONLY-NEXT: ret double [[CALL_I]]
3851 //
3852 // APPROX-LABEL: define dso_local noundef double @test_log2(
3853 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
3854 // APPROX-NEXT: [[ENTRY:.*:]]
3855 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_log2_f64(double noundef [[X]]) #[[ATTR14]]
3856 // APPROX-NEXT: ret double [[CALL_I]]
3857 //
3858 // NCRDIV-LABEL: define dso_local noundef double @test_log2(
3859 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
3860 // NCRDIV-NEXT: [[ENTRY:.*:]]
3861 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_log2_f64(double noundef [[X]]) #[[ATTR14]]
3862 // NCRDIV-NEXT: ret double [[CALL_I]]
3863 //
3864 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_log2(
3865 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
3866 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
3867 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_log2_f64(double noundef [[X]]) #[[ATTR14]]
3868 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
3869 //
3870 extern "C" __device__ double test_log2(double x) {
3871 return log2(x);
3872 }
3873
3874 // DEFAULT-LABEL: define dso_local float @test_logbf(
3875 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3876 // DEFAULT-NEXT: [[ENTRY:.*:]]
3877 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
3878 // DEFAULT-NEXT: [[TMP1:%.*]] = extractvalue { float, i32 } [[TMP0]], 1
3879 // DEFAULT-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], -1
3880 // DEFAULT-NEXT: [[TMP3:%.*]] = sitofp i32 [[TMP2]] to float
3881 // DEFAULT-NEXT: [[TMP4:%.*]] = tail call contract float @llvm.fabs.f32(float [[X]])
3882 // DEFAULT-NEXT: [[TMP5:%.*]] = fcmp contract one float [[TMP4]], 0x7FF0000000000000
3883 // DEFAULT-NEXT: [[TMP6:%.*]] = select contract i1 [[TMP5]], float [[TMP3]], float [[TMP4]]
3884 // DEFAULT-NEXT: [[TMP7:%.*]] = fcmp contract oeq float [[X]], 0.000000e+00
3885 // DEFAULT-NEXT: [[TMP8:%.*]] = select contract i1 [[TMP7]], float 0xFFF0000000000000, float [[TMP6]]
3886 // DEFAULT-NEXT: ret float [[TMP8]]
3887 //
3888 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) float @test_logbf(
3889 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3890 // FINITEONLY-NEXT: [[ENTRY:.*:]]
3891 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call { float, i32 } @llvm.frexp.f32.i32(float nofpclass(nan inf) [[X]])
3892 // FINITEONLY-NEXT: [[TMP1:%.*]] = extractvalue { float, i32 } [[TMP0]], 1
3893 // FINITEONLY-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], -1
3894 // FINITEONLY-NEXT: [[TMP3:%.*]] = sitofp i32 [[TMP2]] to float
3895 // FINITEONLY-NEXT: ret float [[TMP3]]
3896 //
3897 // APPROX-LABEL: define dso_local float @test_logbf(
3898 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3899 // APPROX-NEXT: [[ENTRY:.*:]]
3900 // APPROX-NEXT: [[TMP0:%.*]] = tail call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
3901 // APPROX-NEXT: [[TMP1:%.*]] = extractvalue { float, i32 } [[TMP0]], 1
3902 // APPROX-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], -1
3903 // APPROX-NEXT: [[TMP3:%.*]] = sitofp i32 [[TMP2]] to float
3904 // APPROX-NEXT: [[TMP4:%.*]] = tail call contract float @llvm.fabs.f32(float [[X]])
3905 // APPROX-NEXT: [[TMP5:%.*]] = fcmp contract one float [[TMP4]], 0x7FF0000000000000
3906 // APPROX-NEXT: [[TMP6:%.*]] = select contract i1 [[TMP5]], float [[TMP3]], float [[TMP4]]
3907 // APPROX-NEXT: [[TMP7:%.*]] = fcmp contract oeq float [[X]], 0.000000e+00
3908 // APPROX-NEXT: [[TMP8:%.*]] = select contract i1 [[TMP7]], float 0xFFF0000000000000, float [[TMP6]]
3909 // APPROX-NEXT: ret float [[TMP8]]
3910 //
3911 // NCRDIV-LABEL: define dso_local float @test_logbf(
3912 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3913 // NCRDIV-NEXT: [[ENTRY:.*:]]
3914 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
3915 // NCRDIV-NEXT: [[TMP1:%.*]] = extractvalue { float, i32 } [[TMP0]], 1
3916 // NCRDIV-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], -1
3917 // NCRDIV-NEXT: [[TMP3:%.*]] = sitofp i32 [[TMP2]] to float
3918 // NCRDIV-NEXT: [[TMP4:%.*]] = tail call contract float @llvm.fabs.f32(float [[X]])
3919 // NCRDIV-NEXT: [[TMP5:%.*]] = fcmp contract one float [[TMP4]], 0x7FF0000000000000
3920 // NCRDIV-NEXT: [[TMP6:%.*]] = select contract i1 [[TMP5]], float [[TMP3]], float [[TMP4]]
3921 // NCRDIV-NEXT: [[TMP7:%.*]] = fcmp contract oeq float [[X]], 0.000000e+00
3922 // NCRDIV-NEXT: [[TMP8:%.*]] = select contract i1 [[TMP7]], float 0xFFF0000000000000, float [[TMP6]]
3923 // NCRDIV-NEXT: ret float [[TMP8]]
3924 //
3925 // AMDGCNSPIRV-LABEL: define spir_func float @test_logbf(
3926 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
3927 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
3928 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call addrspace(4) { float, i32 } @llvm.frexp.f32.i32(float [[X]])
3929 // AMDGCNSPIRV-NEXT: [[TMP1:%.*]] = extractvalue { float, i32 } [[TMP0]], 1
3930 // AMDGCNSPIRV-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], -1
3931 // AMDGCNSPIRV-NEXT: [[TMP3:%.*]] = sitofp i32 [[TMP2]] to float
3932 // AMDGCNSPIRV-NEXT: [[TMP4:%.*]] = tail call contract addrspace(4) float @llvm.fabs.f32(float [[X]])
3933 // AMDGCNSPIRV-NEXT: [[TMP5:%.*]] = fcmp contract one float [[TMP4]], 0x7FF0000000000000
3934 // AMDGCNSPIRV-NEXT: [[TMP6:%.*]] = select contract i1 [[TMP5]], float [[TMP3]], float [[TMP4]]
3935 // AMDGCNSPIRV-NEXT: [[TMP7:%.*]] = fcmp contract oeq float [[X]], 0.000000e+00
3936 // AMDGCNSPIRV-NEXT: [[TMP8:%.*]] = select contract i1 [[TMP7]], float 0xFFF0000000000000, float [[TMP6]]
3937 // AMDGCNSPIRV-NEXT: ret float [[TMP8]]
3938 //
3939 extern "C" __device__ float test_logbf(float x) {
3940 return logbf(x);
3941 }
3942
3943 // DEFAULT-LABEL: define dso_local double @test_logb(
3944 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3945 // DEFAULT-NEXT: [[ENTRY:.*:]]
3946 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call { double, i32 } @llvm.frexp.f64.i32(double [[X]])
3947 // DEFAULT-NEXT: [[TMP1:%.*]] = extractvalue { double, i32 } [[TMP0]], 1
3948 // DEFAULT-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], -1
3949 // DEFAULT-NEXT: [[TMP3:%.*]] = sitofp i32 [[TMP2]] to double
3950 // DEFAULT-NEXT: [[TMP4:%.*]] = tail call contract double @llvm.fabs.f64(double [[X]])
3951 // DEFAULT-NEXT: [[TMP5:%.*]] = fcmp contract one double [[TMP4]], 0x7FF0000000000000
3952 // DEFAULT-NEXT: [[TMP6:%.*]] = select contract i1 [[TMP5]], double [[TMP3]], double [[TMP4]]
3953 // DEFAULT-NEXT: [[TMP7:%.*]] = fcmp contract oeq double [[X]], 0.000000e+00
3954 // DEFAULT-NEXT: [[TMP8:%.*]] = select contract i1 [[TMP7]], double 0xFFF0000000000000, double [[TMP6]]
3955 // DEFAULT-NEXT: ret double [[TMP8]]
3956 //
3957 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) double @test_logb(
3958 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3959 // FINITEONLY-NEXT: [[ENTRY:.*:]]
3960 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call { double, i32 } @llvm.frexp.f64.i32(double nofpclass(nan inf) [[X]])
3961 // FINITEONLY-NEXT: [[TMP1:%.*]] = extractvalue { double, i32 } [[TMP0]], 1
3962 // FINITEONLY-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], -1
3963 // FINITEONLY-NEXT: [[TMP3:%.*]] = sitofp i32 [[TMP2]] to double
3964 // FINITEONLY-NEXT: ret double [[TMP3]]
3965 //
3966 // APPROX-LABEL: define dso_local double @test_logb(
3967 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3968 // APPROX-NEXT: [[ENTRY:.*:]]
3969 // APPROX-NEXT: [[TMP0:%.*]] = tail call { double, i32 } @llvm.frexp.f64.i32(double [[X]])
3970 // APPROX-NEXT: [[TMP1:%.*]] = extractvalue { double, i32 } [[TMP0]], 1
3971 // APPROX-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], -1
3972 // APPROX-NEXT: [[TMP3:%.*]] = sitofp i32 [[TMP2]] to double
3973 // APPROX-NEXT: [[TMP4:%.*]] = tail call contract double @llvm.fabs.f64(double [[X]])
3974 // APPROX-NEXT: [[TMP5:%.*]] = fcmp contract one double [[TMP4]], 0x7FF0000000000000
3975 // APPROX-NEXT: [[TMP6:%.*]] = select contract i1 [[TMP5]], double [[TMP3]], double [[TMP4]]
3976 // APPROX-NEXT: [[TMP7:%.*]] = fcmp contract oeq double [[X]], 0.000000e+00
3977 // APPROX-NEXT: [[TMP8:%.*]] = select contract i1 [[TMP7]], double 0xFFF0000000000000, double [[TMP6]]
3978 // APPROX-NEXT: ret double [[TMP8]]
3979 //
3980 // NCRDIV-LABEL: define dso_local double @test_logb(
3981 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
3982 // NCRDIV-NEXT: [[ENTRY:.*:]]
3983 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call { double, i32 } @llvm.frexp.f64.i32(double [[X]])
3984 // NCRDIV-NEXT: [[TMP1:%.*]] = extractvalue { double, i32 } [[TMP0]], 1
3985 // NCRDIV-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], -1
3986 // NCRDIV-NEXT: [[TMP3:%.*]] = sitofp i32 [[TMP2]] to double
3987 // NCRDIV-NEXT: [[TMP4:%.*]] = tail call contract double @llvm.fabs.f64(double [[X]])
3988 // NCRDIV-NEXT: [[TMP5:%.*]] = fcmp contract one double [[TMP4]], 0x7FF0000000000000
3989 // NCRDIV-NEXT: [[TMP6:%.*]] = select contract i1 [[TMP5]], double [[TMP3]], double [[TMP4]]
3990 // NCRDIV-NEXT: [[TMP7:%.*]] = fcmp contract oeq double [[X]], 0.000000e+00
3991 // NCRDIV-NEXT: [[TMP8:%.*]] = select contract i1 [[TMP7]], double 0xFFF0000000000000, double [[TMP6]]
3992 // NCRDIV-NEXT: ret double [[TMP8]]
3993 //
3994 // AMDGCNSPIRV-LABEL: define spir_func double @test_logb(
3995 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
3996 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
3997 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call addrspace(4) { double, i32 } @llvm.frexp.f64.i32(double [[X]])
3998 // AMDGCNSPIRV-NEXT: [[TMP1:%.*]] = extractvalue { double, i32 } [[TMP0]], 1
3999 // AMDGCNSPIRV-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], -1
4000 // AMDGCNSPIRV-NEXT: [[TMP3:%.*]] = sitofp i32 [[TMP2]] to double
4001 // AMDGCNSPIRV-NEXT: [[TMP4:%.*]] = tail call contract addrspace(4) double @llvm.fabs.f64(double [[X]])
4002 // AMDGCNSPIRV-NEXT: [[TMP5:%.*]] = fcmp contract one double [[TMP4]], 0x7FF0000000000000
4003 // AMDGCNSPIRV-NEXT: [[TMP6:%.*]] = select contract i1 [[TMP5]], double [[TMP3]], double [[TMP4]]
4004 // AMDGCNSPIRV-NEXT: [[TMP7:%.*]] = fcmp contract oeq double [[X]], 0.000000e+00
4005 // AMDGCNSPIRV-NEXT: [[TMP8:%.*]] = select contract i1 [[TMP7]], double 0xFFF0000000000000, double [[TMP6]]
4006 // AMDGCNSPIRV-NEXT: ret double [[TMP8]]
4007 //
4008 extern "C" __device__ double test_logb(double x) {
4009 return logb(x);
4010 }
4011
4012 // DEFAULT-LABEL: define dso_local noundef float @test_logf(
4013 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
4014 // DEFAULT-NEXT: [[ENTRY:.*:]]
4015 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.log.f32(float [[X]])
4016 // DEFAULT-NEXT: ret float [[TMP0]]
4017 //
4018 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_logf(
4019 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
4020 // FINITEONLY-NEXT: [[ENTRY:.*:]]
4021 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.log.f32(float nofpclass(nan inf) [[X]])
4022 // FINITEONLY-NEXT: ret float [[TMP0]]
4023 //
4024 // APPROX-LABEL: define dso_local noundef float @test_logf(
4025 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
4026 // APPROX-NEXT: [[ENTRY:.*:]]
4027 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.log.f32(float [[X]])
4028 // APPROX-NEXT: ret float [[TMP0]]
4029 //
4030 // NCRDIV-LABEL: define dso_local noundef float @test_logf(
4031 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
4032 // NCRDIV-NEXT: [[ENTRY:.*:]]
4033 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.log.f32(float [[X]])
4034 // NCRDIV-NEXT: ret float [[TMP0]]
4035 //
4036 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_logf(
4037 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
4038 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
4039 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.log.f32(float [[X]])
4040 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
4041 //
4042 extern "C" __device__ float test_logf(float x) {
4043 return logf(x);
4044 }
4045
4046 // DEFAULT-LABEL: define dso_local i64 @test_lrintf(
4047 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
4048 // DEFAULT-NEXT: [[ENTRY:.*:]]
4049 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract float @llvm.rint.f32(float [[X]])
4050 // DEFAULT-NEXT: [[CONV_I:%.*]] = fptosi float [[TMP0]] to i64
4051 // DEFAULT-NEXT: ret i64 [[CONV_I]]
4052 //
4053 // FINITEONLY-LABEL: define dso_local i64 @test_lrintf(
4054 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
4055 // FINITEONLY-NEXT: [[ENTRY:.*:]]
4056 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract float @llvm.rint.f32(float nofpclass(nan inf) [[X]])
4057 // FINITEONLY-NEXT: [[CONV_I:%.*]] = fptosi float [[TMP0]] to i64
4058 // FINITEONLY-NEXT: ret i64 [[CONV_I]]
4059 //
4060 // APPROX-LABEL: define dso_local i64 @test_lrintf(
4061 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
4062 // APPROX-NEXT: [[ENTRY:.*:]]
4063 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract float @llvm.rint.f32(float [[X]])
4064 // APPROX-NEXT: [[CONV_I:%.*]] = fptosi float [[TMP0]] to i64
4065 // APPROX-NEXT: ret i64 [[CONV_I]]
4066 //
4067 // NCRDIV-LABEL: define dso_local i64 @test_lrintf(
4068 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
4069 // NCRDIV-NEXT: [[ENTRY:.*:]]
4070 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract float @llvm.rint.f32(float [[X]])
4071 // NCRDIV-NEXT: [[CONV_I:%.*]] = fptosi float [[TMP0]] to i64
4072 // NCRDIV-NEXT: ret i64 [[CONV_I]]
4073 //
4074 // AMDGCNSPIRV-LABEL: define spir_func i64 @test_lrintf(
4075 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
4076 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
4077 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract addrspace(4) float @llvm.rint.f32(float [[X]])
4078 // AMDGCNSPIRV-NEXT: [[CONV_I:%.*]] = fptosi float [[TMP0]] to i64
4079 // AMDGCNSPIRV-NEXT: ret i64 [[CONV_I]]
4080 //
4081 extern "C" __device__ long int test_lrintf(float x) {
4082 return lrintf(x);
4083 }
4084
4085 // DEFAULT-LABEL: define dso_local i64 @test_lrint(
4086 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
4087 // DEFAULT-NEXT: [[ENTRY:.*:]]
4088 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract double @llvm.rint.f64(double [[X]])
4089 // DEFAULT-NEXT: [[CONV_I:%.*]] = fptosi double [[TMP0]] to i64
4090 // DEFAULT-NEXT: ret i64 [[CONV_I]]
4091 //
4092 // FINITEONLY-LABEL: define dso_local i64 @test_lrint(
4093 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
4094 // FINITEONLY-NEXT: [[ENTRY:.*:]]
4095 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract double @llvm.rint.f64(double nofpclass(nan inf) [[X]])
4096 // FINITEONLY-NEXT: [[CONV_I:%.*]] = fptosi double [[TMP0]] to i64
4097 // FINITEONLY-NEXT: ret i64 [[CONV_I]]
4098 //
4099 // APPROX-LABEL: define dso_local i64 @test_lrint(
4100 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
4101 // APPROX-NEXT: [[ENTRY:.*:]]
4102 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract double @llvm.rint.f64(double [[X]])
4103 // APPROX-NEXT: [[CONV_I:%.*]] = fptosi double [[TMP0]] to i64
4104 // APPROX-NEXT: ret i64 [[CONV_I]]
4105 //
4106 // NCRDIV-LABEL: define dso_local i64 @test_lrint(
4107 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
4108 // NCRDIV-NEXT: [[ENTRY:.*:]]
4109 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract double @llvm.rint.f64(double [[X]])
4110 // NCRDIV-NEXT: [[CONV_I:%.*]] = fptosi double [[TMP0]] to i64
4111 // NCRDIV-NEXT: ret i64 [[CONV_I]]
4112 //
4113 // AMDGCNSPIRV-LABEL: define spir_func i64 @test_lrint(
4114 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
4115 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
4116 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract addrspace(4) double @llvm.rint.f64(double [[X]])
4117 // AMDGCNSPIRV-NEXT: [[CONV_I:%.*]] = fptosi double [[TMP0]] to i64
4118 // AMDGCNSPIRV-NEXT: ret i64 [[CONV_I]]
4119 //
4120 extern "C" __device__ long int test_lrint(double x) {
4121 return lrint(x);
4122 }
4123
4124 // DEFAULT-LABEL: define dso_local i64 @test_lroundf(
4125 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
4126 // DEFAULT-NEXT: [[ENTRY:.*:]]
4127 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract float @llvm.round.f32(float [[X]])
4128 // DEFAULT-NEXT: [[CONV_I:%.*]] = fptosi float [[TMP0]] to i64
4129 // DEFAULT-NEXT: ret i64 [[CONV_I]]
4130 //
4131 // FINITEONLY-LABEL: define dso_local i64 @test_lroundf(
4132 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
4133 // FINITEONLY-NEXT: [[ENTRY:.*:]]
4134 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract float @llvm.round.f32(float nofpclass(nan inf) [[X]])
4135 // FINITEONLY-NEXT: [[CONV_I:%.*]] = fptosi float [[TMP0]] to i64
4136 // FINITEONLY-NEXT: ret i64 [[CONV_I]]
4137 //
4138 // APPROX-LABEL: define dso_local i64 @test_lroundf(
4139 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
4140 // APPROX-NEXT: [[ENTRY:.*:]]
4141 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract float @llvm.round.f32(float [[X]])
4142 // APPROX-NEXT: [[CONV_I:%.*]] = fptosi float [[TMP0]] to i64
4143 // APPROX-NEXT: ret i64 [[CONV_I]]
4144 //
4145 // NCRDIV-LABEL: define dso_local i64 @test_lroundf(
4146 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
4147 // NCRDIV-NEXT: [[ENTRY:.*:]]
4148 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract float @llvm.round.f32(float [[X]])
4149 // NCRDIV-NEXT: [[CONV_I:%.*]] = fptosi float [[TMP0]] to i64
4150 // NCRDIV-NEXT: ret i64 [[CONV_I]]
4151 //
4152 // AMDGCNSPIRV-LABEL: define spir_func i64 @test_lroundf(
4153 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
4154 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
4155 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract addrspace(4) float @llvm.round.f32(float [[X]])
4156 // AMDGCNSPIRV-NEXT: [[CONV_I:%.*]] = fptosi float [[TMP0]] to i64
4157 // AMDGCNSPIRV-NEXT: ret i64 [[CONV_I]]
4158 //
4159 extern "C" __device__ long int test_lroundf(float x) {
4160 return lroundf(x);
4161 }
4162
4163 // DEFAULT-LABEL: define dso_local i64 @test_lround(
4164 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
4165 // DEFAULT-NEXT: [[ENTRY:.*:]]
4166 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract double @llvm.round.f64(double [[X]])
4167 // DEFAULT-NEXT: [[CONV_I:%.*]] = fptosi double [[TMP0]] to i64
4168 // DEFAULT-NEXT: ret i64 [[CONV_I]]
4169 //
4170 // FINITEONLY-LABEL: define dso_local i64 @test_lround(
4171 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
4172 // FINITEONLY-NEXT: [[ENTRY:.*:]]
4173 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract double @llvm.round.f64(double nofpclass(nan inf) [[X]])
4174 // FINITEONLY-NEXT: [[CONV_I:%.*]] = fptosi double [[TMP0]] to i64
4175 // FINITEONLY-NEXT: ret i64 [[CONV_I]]
4176 //
4177 // APPROX-LABEL: define dso_local i64 @test_lround(
4178 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
4179 // APPROX-NEXT: [[ENTRY:.*:]]
4180 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract double @llvm.round.f64(double [[X]])
4181 // APPROX-NEXT: [[CONV_I:%.*]] = fptosi double [[TMP0]] to i64
4182 // APPROX-NEXT: ret i64 [[CONV_I]]
4183 //
4184 // NCRDIV-LABEL: define dso_local i64 @test_lround(
4185 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
4186 // NCRDIV-NEXT: [[ENTRY:.*:]]
4187 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract double @llvm.round.f64(double [[X]])
4188 // NCRDIV-NEXT: [[CONV_I:%.*]] = fptosi double [[TMP0]] to i64
4189 // NCRDIV-NEXT: ret i64 [[CONV_I]]
4190 //
4191 // AMDGCNSPIRV-LABEL: define spir_func i64 @test_lround(
4192 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
4193 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
4194 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract addrspace(4) double @llvm.round.f64(double [[X]])
4195 // AMDGCNSPIRV-NEXT: [[CONV_I:%.*]] = fptosi double [[TMP0]] to i64
4196 // AMDGCNSPIRV-NEXT: ret i64 [[CONV_I]]
4197 //
4198 extern "C" __device__ long int test_lround(double x) {
4199 return lround(x);
4200 }
4201
4202 // DEFAULT-LABEL: define dso_local noundef float @test_modff(
4203 // DEFAULT-SAME: float noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
4204 // DEFAULT-NEXT: [[ENTRY:.*:]]
4205 // DEFAULT-NEXT: [[__TMP_I:%.*]] = alloca float, align 4, addrspace(5)
4206 // DEFAULT-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16:[0-9]+]]
4207 // DEFAULT-NEXT: [[CALL_I:%.*]] = call contract noundef float @__ocml_modf_f32(float noundef [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
4208 // DEFAULT-NEXT: [[TMP0:%.*]] = load float, ptr addrspace(5) [[__TMP_I]], align 4, !tbaa [[FLOAT_TBAA16:![0-9]+]]
4209 // DEFAULT-NEXT: store float [[TMP0]], ptr [[Y]], align 4, !tbaa [[FLOAT_TBAA16]]
4210 // DEFAULT-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
4211 // DEFAULT-NEXT: ret float [[CALL_I]]
4212 //
4213 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_modff(
4214 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
4215 // FINITEONLY-NEXT: [[ENTRY:.*:]]
4216 // FINITEONLY-NEXT: [[__TMP_I:%.*]] = alloca float, align 4, addrspace(5)
4217 // FINITEONLY-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16:[0-9]+]]
4218 // FINITEONLY-NEXT: [[CALL_I:%.*]] = call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_modf_f32(float noundef nofpclass(nan inf) [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
4219 // FINITEONLY-NEXT: [[TMP0:%.*]] = load float, ptr addrspace(5) [[__TMP_I]], align 4, !tbaa [[FLOAT_TBAA16:![0-9]+]]
4220 // FINITEONLY-NEXT: store float [[TMP0]], ptr [[Y]], align 4, !tbaa [[FLOAT_TBAA16]]
4221 // FINITEONLY-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
4222 // FINITEONLY-NEXT: ret float [[CALL_I]]
4223 //
4224 // APPROX-LABEL: define dso_local noundef float @test_modff(
4225 // APPROX-SAME: float noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
4226 // APPROX-NEXT: [[ENTRY:.*:]]
4227 // APPROX-NEXT: [[__TMP_I:%.*]] = alloca float, align 4, addrspace(5)
4228 // APPROX-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16:[0-9]+]]
4229 // APPROX-NEXT: [[CALL_I:%.*]] = call contract noundef float @__ocml_modf_f32(float noundef [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
4230 // APPROX-NEXT: [[TMP0:%.*]] = load float, ptr addrspace(5) [[__TMP_I]], align 4, !tbaa [[FLOAT_TBAA16:![0-9]+]]
4231 // APPROX-NEXT: store float [[TMP0]], ptr [[Y]], align 4, !tbaa [[FLOAT_TBAA16]]
4232 // APPROX-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
4233 // APPROX-NEXT: ret float [[CALL_I]]
4234 //
4235 // NCRDIV-LABEL: define dso_local noundef float @test_modff(
4236 // NCRDIV-SAME: float noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
4237 // NCRDIV-NEXT: [[ENTRY:.*:]]
4238 // NCRDIV-NEXT: [[__TMP_I:%.*]] = alloca float, align 4, addrspace(5)
4239 // NCRDIV-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16:[0-9]+]]
4240 // NCRDIV-NEXT: [[CALL_I:%.*]] = call contract noundef float @__ocml_modf_f32(float noundef [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
4241 // NCRDIV-NEXT: [[TMP0:%.*]] = load float, ptr addrspace(5) [[__TMP_I]], align 4, !tbaa [[FLOAT_TBAA17:![0-9]+]]
4242 // NCRDIV-NEXT: store float [[TMP0]], ptr [[Y]], align 4, !tbaa [[FLOAT_TBAA17]]
4243 // NCRDIV-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
4244 // NCRDIV-NEXT: ret float [[CALL_I]]
4245 //
4246 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_modff(
4247 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], ptr addrspace(4) noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
4248 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
4249 // AMDGCNSPIRV-NEXT: [[__TMP_I:%.*]] = alloca float, align 4
4250 // AMDGCNSPIRV-NEXT: [[__TMP_ASCAST_I:%.*]] = addrspacecast ptr [[__TMP_I]] to ptr addrspace(4)
4251 // AMDGCNSPIRV-NEXT: call addrspace(4) void @llvm.lifetime.start.p0(ptr nonnull [[__TMP_I]]) #[[ATTR16:[0-9]+]]
4252 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = call contract spir_func noundef addrspace(4) float @__ocml_modf_f32(float noundef [[X]], ptr noundef nonnull [[__TMP_I]]) #[[ATTR15]]
4253 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = load float, ptr addrspace(4) [[__TMP_ASCAST_I]], align 4, !tbaa [[FLOAT_TBAA17:![0-9]+]]
4254 // AMDGCNSPIRV-NEXT: store float [[TMP0]], ptr addrspace(4) [[Y]], align 4, !tbaa [[FLOAT_TBAA17]]
4255 // AMDGCNSPIRV-NEXT: call addrspace(4) void @llvm.lifetime.end.p0(ptr nonnull [[__TMP_I]]) #[[ATTR16]]
4256 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
4257 //
4258 extern "C" __device__ float test_modff(float x, float* y) {
4259 return modff(x, y);
4260 }
4261
4262 // DEFAULT-LABEL: define dso_local noundef double @test_modf(
4263 // DEFAULT-SAME: double noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
4264 // DEFAULT-NEXT: [[ENTRY:.*:]]
4265 // DEFAULT-NEXT: [[__TMP_I:%.*]] = alloca double, align 8, addrspace(5)
4266 // DEFAULT-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
4267 // DEFAULT-NEXT: [[CALL_I:%.*]] = call contract noundef double @__ocml_modf_f64(double noundef [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
4268 // DEFAULT-NEXT: [[TMP0:%.*]] = load double, ptr addrspace(5) [[__TMP_I]], align 8, !tbaa [[DOUBLE_TBAA18:![0-9]+]]
4269 // DEFAULT-NEXT: store double [[TMP0]], ptr [[Y]], align 8, !tbaa [[DOUBLE_TBAA18]]
4270 // DEFAULT-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
4271 // DEFAULT-NEXT: ret double [[CALL_I]]
4272 //
4273 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_modf(
4274 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
4275 // FINITEONLY-NEXT: [[ENTRY:.*:]]
4276 // FINITEONLY-NEXT: [[__TMP_I:%.*]] = alloca double, align 8, addrspace(5)
4277 // FINITEONLY-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
4278 // FINITEONLY-NEXT: [[CALL_I:%.*]] = call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_modf_f64(double noundef nofpclass(nan inf) [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
4279 // FINITEONLY-NEXT: [[TMP0:%.*]] = load double, ptr addrspace(5) [[__TMP_I]], align 8, !tbaa [[DOUBLE_TBAA18:![0-9]+]]
4280 // FINITEONLY-NEXT: store double [[TMP0]], ptr [[Y]], align 8, !tbaa [[DOUBLE_TBAA18]]
4281 // FINITEONLY-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
4282 // FINITEONLY-NEXT: ret double [[CALL_I]]
4283 //
4284 // APPROX-LABEL: define dso_local noundef double @test_modf(
4285 // APPROX-SAME: double noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
4286 // APPROX-NEXT: [[ENTRY:.*:]]
4287 // APPROX-NEXT: [[__TMP_I:%.*]] = alloca double, align 8, addrspace(5)
4288 // APPROX-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
4289 // APPROX-NEXT: [[CALL_I:%.*]] = call contract noundef double @__ocml_modf_f64(double noundef [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
4290 // APPROX-NEXT: [[TMP0:%.*]] = load double, ptr addrspace(5) [[__TMP_I]], align 8, !tbaa [[DOUBLE_TBAA18:![0-9]+]]
4291 // APPROX-NEXT: store double [[TMP0]], ptr [[Y]], align 8, !tbaa [[DOUBLE_TBAA18]]
4292 // APPROX-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
4293 // APPROX-NEXT: ret double [[CALL_I]]
4294 //
4295 // NCRDIV-LABEL: define dso_local noundef double @test_modf(
4296 // NCRDIV-SAME: double noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
4297 // NCRDIV-NEXT: [[ENTRY:.*:]]
4298 // NCRDIV-NEXT: [[__TMP_I:%.*]] = alloca double, align 8, addrspace(5)
4299 // NCRDIV-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
4300 // NCRDIV-NEXT: [[CALL_I:%.*]] = call contract noundef double @__ocml_modf_f64(double noundef [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
4301 // NCRDIV-NEXT: [[TMP0:%.*]] = load double, ptr addrspace(5) [[__TMP_I]], align 8, !tbaa [[DOUBLE_TBAA19:![0-9]+]]
4302 // NCRDIV-NEXT: store double [[TMP0]], ptr [[Y]], align 8, !tbaa [[DOUBLE_TBAA19]]
4303 // NCRDIV-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
4304 // NCRDIV-NEXT: ret double [[CALL_I]]
4305 //
4306 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_modf(
4307 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], ptr addrspace(4) noundef writeonly captures(none) initializes((0, 8)) [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
4308 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
4309 // AMDGCNSPIRV-NEXT: [[__TMP_I:%.*]] = alloca double, align 8
4310 // AMDGCNSPIRV-NEXT: [[__TMP_ASCAST_I:%.*]] = addrspacecast ptr [[__TMP_I]] to ptr addrspace(4)
4311 // AMDGCNSPIRV-NEXT: call addrspace(4) void @llvm.lifetime.start.p0(ptr nonnull [[__TMP_I]]) #[[ATTR16]]
4312 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = call contract spir_func noundef addrspace(4) double @__ocml_modf_f64(double noundef [[X]], ptr noundef nonnull [[__TMP_I]]) #[[ATTR15]]
4313 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = load double, ptr addrspace(4) [[__TMP_ASCAST_I]], align 8, !tbaa [[DOUBLE_TBAA19:![0-9]+]]
4314 // AMDGCNSPIRV-NEXT: store double [[TMP0]], ptr addrspace(4) [[Y]], align 8, !tbaa [[DOUBLE_TBAA19]]
4315 // AMDGCNSPIRV-NEXT: call addrspace(4) void @llvm.lifetime.end.p0(ptr nonnull [[__TMP_I]]) #[[ATTR16]]
4316 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
4317 //
4318 extern "C" __device__ double test_modf(double x, double* y) {
4319 return modf(x, y);
4320 }
4321
4322 // DEFAULT-LABEL: define dso_local float @test_nanf(
4323 // DEFAULT-SAME: ptr noundef readonly captures(none) [[TAG:%.*]]) local_unnamed_addr #[[ATTR2]] {
4324 // DEFAULT-NEXT: [[ENTRY:.*:]]
4325 // DEFAULT-NEXT: [[TMP0:%.*]] = load i8, ptr [[TAG]], align 1, !tbaa [[CHAR_TBAA8]]
4326 // DEFAULT-NEXT: [[CMP_I_I:%.*]] = icmp eq i8 [[TMP0]], 48
4327 // DEFAULT-NEXT: br i1 [[CMP_I_I]], label %[[IF_THEN_I_I:.*]], label %[[WHILE_COND_I14_I_I_PREHEADER:.*]]
4328 // DEFAULT: [[WHILE_COND_I14_I_I_PREHEADER]]:
4329 // DEFAULT-NEXT: [[TMP1:%.*]] = load i8, ptr [[TAG]], align 1, !tbaa [[CHAR_TBAA8]]
4330 // DEFAULT-NEXT: [[CMP_NOT_I17_I_I5:%.*]] = icmp eq i8 [[TMP1]], 0
4331 // DEFAULT-NEXT: br i1 [[CMP_NOT_I17_I_I5]], label %[[_ZL4NANFPKC_EXIT:.*]], label %[[WHILE_BODY_I18_I_I:.*]]
4332 // DEFAULT: [[IF_THEN_I_I]]:
4333 // DEFAULT-NEXT: [[INCDEC_PTR_I_I:%.*]] = getelementptr inbounds nuw i8, ptr [[TAG]], i64 1
4334 // DEFAULT-NEXT: [[TMP2:%.*]] = load i8, ptr [[INCDEC_PTR_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4335 // DEFAULT-NEXT: [[CMP_NOT_I_I_I14:%.*]] = icmp eq i8 [[TMP2]], 0
4336 // DEFAULT-NEXT: switch i8 [[TMP2]], label %[[WHILE_COND_I_I_I_PREHEADER:.*]] [
4337 // DEFAULT-NEXT: i8 120, label %[[IF_THEN5_I_I:.*]]
4338 // DEFAULT-NEXT: i8 88, label %[[IF_THEN5_I_I]]
4339 // DEFAULT-NEXT: ]
4340 // DEFAULT: [[WHILE_COND_I_I_I_PREHEADER]]:
4341 // DEFAULT-NEXT: br i1 [[CMP_NOT_I_I_I14]], label %[[_ZL4NANFPKC_EXIT]], label %[[WHILE_BODY_I_I_I:.*]]
4342 // DEFAULT: [[IF_THEN5_I_I]]:
4343 // DEFAULT-NEXT: br i1 [[CMP_NOT_I_I_I14]], label %[[_ZL4NANFPKC_EXIT]], label %[[WHILE_BODY_I31_I_I:.*]]
4344 // DEFAULT: [[WHILE_BODY_I31_I_I]]:
4345 // DEFAULT-NEXT: [[TMP3:%.*]] = phi i8 [ [[TMP7:%.*]], %[[IF_END31_I_I_I:.*]] ], [ [[TMP2]], %[[IF_THEN5_I_I]] ]
4346 // DEFAULT-NEXT: [[__R_0_I29_I_I11:%.*]] = phi i64 [ [[ADD28_I_I_I:%.*]], %[[IF_END31_I_I_I]] ], [ 0, %[[IF_THEN5_I_I]] ]
4347 // DEFAULT-NEXT: [[__TAGP_ADDR_0_I28_I_I10:%.*]] = phi ptr [ [[INCDEC_PTR_I34_I_I:%.*]], %[[IF_END31_I_I_I]] ], [ [[INCDEC_PTR_I_I]], %[[IF_THEN5_I_I]] ]
4348 // DEFAULT-NEXT: [[TMP4:%.*]] = add i8 [[TMP3]], -48
4349 // DEFAULT-NEXT: [[OR_COND_I32_I_I:%.*]] = icmp ult i8 [[TMP4]], 10
4350 // DEFAULT-NEXT: br i1 [[OR_COND_I32_I_I]], label %[[IF_END31_I_I_I]], label %[[IF_ELSE_I_I_I:.*]]
4351 // DEFAULT: [[IF_ELSE_I_I_I]]:
4352 // DEFAULT-NEXT: [[TMP5:%.*]] = add i8 [[TMP3]], -97
4353 // DEFAULT-NEXT: [[OR_COND33_I_I_I:%.*]] = icmp ult i8 [[TMP5]], 6
4354 // DEFAULT-NEXT: br i1 [[OR_COND33_I_I_I]], label %[[IF_END31_I_I_I]], label %[[IF_ELSE17_I_I_I:.*]]
4355 // DEFAULT: [[IF_ELSE17_I_I_I]]:
4356 // DEFAULT-NEXT: [[TMP6:%.*]] = add i8 [[TMP3]], -65
4357 // DEFAULT-NEXT: [[OR_COND34_I_I_I:%.*]] = icmp ult i8 [[TMP6]], 6
4358 // DEFAULT-NEXT: br i1 [[OR_COND34_I_I_I]], label %[[IF_END31_I_I_I]], label %[[_ZL4NANFPKC_EXIT]]
4359 // DEFAULT: [[IF_END31_I_I_I]]:
4360 // DEFAULT-NEXT: [[DOTSINK:%.*]] = phi i64 [ -87, %[[IF_ELSE_I_I_I]] ], [ -48, %[[WHILE_BODY_I31_I_I]] ], [ -55, %[[IF_ELSE17_I_I_I]] ]
4361 // DEFAULT-NEXT: [[MUL24_I_I_I:%.*]] = shl i64 [[__R_0_I29_I_I11]], 4
4362 // DEFAULT-NEXT: [[CONV25_I_I_I:%.*]] = zext nneg i8 [[TMP3]] to i64
4363 // DEFAULT-NEXT: [[ADD26_I_I_I:%.*]] = add i64 [[MUL24_I_I_I]], [[DOTSINK]]
4364 // DEFAULT-NEXT: [[ADD28_I_I_I]] = add i64 [[ADD26_I_I_I]], [[CONV25_I_I_I]]
4365 // DEFAULT-NEXT: [[INCDEC_PTR_I34_I_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I28_I_I10]], i64 1
4366 // DEFAULT-NEXT: [[TMP7]] = load i8, ptr [[INCDEC_PTR_I34_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4367 // DEFAULT-NEXT: [[CMP_NOT_I30_I_I:%.*]] = icmp eq i8 [[TMP7]], 0
4368 // DEFAULT-NEXT: br i1 [[CMP_NOT_I30_I_I]], label %[[_ZL4NANFPKC_EXIT]], label %[[WHILE_BODY_I31_I_I]], !llvm.loop [[LOOP13]]
4369 // DEFAULT: [[WHILE_BODY_I_I_I]]:
4370 // DEFAULT-NEXT: [[TMP8:%.*]] = phi i8 [ [[TMP10:%.*]], %[[IF_THEN_I_I_I:.*]] ], [ [[TMP2]], %[[WHILE_COND_I_I_I_PREHEADER]] ]
4371 // DEFAULT-NEXT: [[__R_0_I_I_I16:%.*]] = phi i64 [ [[SUB_I_I_I:%.*]], %[[IF_THEN_I_I_I]] ], [ 0, %[[WHILE_COND_I_I_I_PREHEADER]] ]
4372 // DEFAULT-NEXT: [[__TAGP_ADDR_0_I_I_I15:%.*]] = phi ptr [ [[INCDEC_PTR_I_I_I:%.*]], %[[IF_THEN_I_I_I]] ], [ [[INCDEC_PTR_I_I]], %[[WHILE_COND_I_I_I_PREHEADER]] ]
4373 // DEFAULT-NEXT: [[TMP9:%.*]] = and i8 [[TMP8]], -8
4374 // DEFAULT-NEXT: [[OR_COND_I_I_I:%.*]] = icmp eq i8 [[TMP9]], 48
4375 // DEFAULT-NEXT: br i1 [[OR_COND_I_I_I]], label %[[IF_THEN_I_I_I]], label %[[_ZL4NANFPKC_EXIT]]
4376 // DEFAULT: [[IF_THEN_I_I_I]]:
4377 // DEFAULT-NEXT: [[MUL_I_I_I:%.*]] = shl i64 [[__R_0_I_I_I16]], 3
4378 // DEFAULT-NEXT: [[CONV5_I_I_I:%.*]] = zext nneg i8 [[TMP8]] to i64
4379 // DEFAULT-NEXT: [[ADD_I_I_I:%.*]] = add i64 [[MUL_I_I_I]], -48
4380 // DEFAULT-NEXT: [[SUB_I_I_I]] = add i64 [[ADD_I_I_I]], [[CONV5_I_I_I]]
4381 // DEFAULT-NEXT: [[INCDEC_PTR_I_I_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I_I_I15]], i64 1
4382 // DEFAULT-NEXT: [[TMP10]] = load i8, ptr [[INCDEC_PTR_I_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4383 // DEFAULT-NEXT: [[CMP_NOT_I_I_I:%.*]] = icmp eq i8 [[TMP10]], 0
4384 // DEFAULT-NEXT: br i1 [[CMP_NOT_I_I_I]], label %[[_ZL4NANFPKC_EXIT]], label %[[WHILE_BODY_I_I_I]], !llvm.loop [[LOOP9]]
4385 // DEFAULT: [[WHILE_BODY_I18_I_I]]:
4386 // DEFAULT-NEXT: [[TMP11:%.*]] = phi i8 [ [[TMP13:%.*]], %[[IF_THEN_I21_I_I:.*]] ], [ [[TMP1]], %[[WHILE_COND_I14_I_I_PREHEADER]] ]
4387 // DEFAULT-NEXT: [[__R_0_I16_I_I7:%.*]] = phi i64 [ [[SUB_I25_I_I:%.*]], %[[IF_THEN_I21_I_I]] ], [ 0, %[[WHILE_COND_I14_I_I_PREHEADER]] ]
4388 // DEFAULT-NEXT: [[__TAGP_ADDR_0_I15_I_I6:%.*]] = phi ptr [ [[INCDEC_PTR_I26_I_I:%.*]], %[[IF_THEN_I21_I_I]] ], [ [[TAG]], %[[WHILE_COND_I14_I_I_PREHEADER]] ]
4389 // DEFAULT-NEXT: [[TMP12:%.*]] = add i8 [[TMP11]], -48
4390 // DEFAULT-NEXT: [[OR_COND_I19_I_I:%.*]] = icmp ult i8 [[TMP12]], 10
4391 // DEFAULT-NEXT: br i1 [[OR_COND_I19_I_I]], label %[[IF_THEN_I21_I_I]], label %[[_ZL4NANFPKC_EXIT]]
4392 // DEFAULT: [[IF_THEN_I21_I_I]]:
4393 // DEFAULT-NEXT: [[MUL_I22_I_I:%.*]] = mul i64 [[__R_0_I16_I_I7]], 10
4394 // DEFAULT-NEXT: [[CONV5_I23_I_I:%.*]] = zext nneg i8 [[TMP11]] to i64
4395 // DEFAULT-NEXT: [[ADD_I24_I_I:%.*]] = add i64 [[MUL_I22_I_I]], -48
4396 // DEFAULT-NEXT: [[SUB_I25_I_I]] = add i64 [[ADD_I24_I_I]], [[CONV5_I23_I_I]]
4397 // DEFAULT-NEXT: [[INCDEC_PTR_I26_I_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I15_I_I6]], i64 1
4398 // DEFAULT-NEXT: [[TMP13]] = load i8, ptr [[INCDEC_PTR_I26_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4399 // DEFAULT-NEXT: [[CMP_NOT_I17_I_I:%.*]] = icmp eq i8 [[TMP13]], 0
4400 // DEFAULT-NEXT: br i1 [[CMP_NOT_I17_I_I]], label %[[_ZL4NANFPKC_EXIT]], label %[[WHILE_BODY_I18_I_I]], !llvm.loop [[LOOP12]]
4401 // DEFAULT: [[_ZL4NANFPKC_EXIT]]:
4402 // DEFAULT-NEXT: [[RETVAL_0_I_I:%.*]] = phi i64 [ 0, %[[IF_THEN5_I_I]] ], [ 0, %[[WHILE_COND_I14_I_I_PREHEADER]] ], [ 0, %[[WHILE_COND_I_I_I_PREHEADER]] ], [ [[SUB_I_I_I]], %[[IF_THEN_I_I_I]] ], [ [[ADD28_I_I_I]], %[[IF_END31_I_I_I]] ], [ 0, %[[WHILE_BODY_I_I_I]] ], [ 0, %[[IF_ELSE17_I_I_I]] ], [ [[SUB_I25_I_I]], %[[IF_THEN_I21_I_I]] ], [ 0, %[[WHILE_BODY_I18_I_I]] ]
4403 // DEFAULT-NEXT: [[CONV_I:%.*]] = trunc i64 [[RETVAL_0_I_I]] to i32
4404 // DEFAULT-NEXT: [[BF_VALUE_I:%.*]] = and i32 [[CONV_I]], 4194303
4405 // DEFAULT-NEXT: [[BF_SET9_I:%.*]] = or disjoint i32 [[BF_VALUE_I]], 2143289344
4406 // DEFAULT-NEXT: [[TMP14:%.*]] = bitcast i32 [[BF_SET9_I]] to float
4407 // DEFAULT-NEXT: ret float [[TMP14]]
4408 //
4409 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) float @test_nanf(
4410 // FINITEONLY-SAME: ptr noundef readonly captures(none) [[TAG:%.*]]) local_unnamed_addr #[[ATTR3]] {
4411 // FINITEONLY-NEXT: [[ENTRY:.*:]]
4412 // FINITEONLY-NEXT: ret float poison
4413 //
4414 // APPROX-LABEL: define dso_local float @test_nanf(
4415 // APPROX-SAME: ptr noundef readonly captures(none) [[TAG:%.*]]) local_unnamed_addr #[[ATTR2]] {
4416 // APPROX-NEXT: [[ENTRY:.*:]]
4417 // APPROX-NEXT: [[TMP0:%.*]] = load i8, ptr [[TAG]], align 1, !tbaa [[CHAR_TBAA8]]
4418 // APPROX-NEXT: [[CMP_I_I:%.*]] = icmp eq i8 [[TMP0]], 48
4419 // APPROX-NEXT: br i1 [[CMP_I_I]], label %[[IF_THEN_I_I:.*]], label %[[WHILE_COND_I14_I_I_PREHEADER:.*]]
4420 // APPROX: [[WHILE_COND_I14_I_I_PREHEADER]]:
4421 // APPROX-NEXT: [[TMP1:%.*]] = load i8, ptr [[TAG]], align 1, !tbaa [[CHAR_TBAA8]]
4422 // APPROX-NEXT: [[CMP_NOT_I17_I_I5:%.*]] = icmp eq i8 [[TMP1]], 0
4423 // APPROX-NEXT: br i1 [[CMP_NOT_I17_I_I5]], label %[[_ZL4NANFPKC_EXIT:.*]], label %[[WHILE_BODY_I18_I_I:.*]]
4424 // APPROX: [[IF_THEN_I_I]]:
4425 // APPROX-NEXT: [[INCDEC_PTR_I_I:%.*]] = getelementptr inbounds nuw i8, ptr [[TAG]], i64 1
4426 // APPROX-NEXT: [[TMP2:%.*]] = load i8, ptr [[INCDEC_PTR_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4427 // APPROX-NEXT: [[CMP_NOT_I_I_I14:%.*]] = icmp eq i8 [[TMP2]], 0
4428 // APPROX-NEXT: switch i8 [[TMP2]], label %[[WHILE_COND_I_I_I_PREHEADER:.*]] [
4429 // APPROX-NEXT: i8 120, label %[[IF_THEN5_I_I:.*]]
4430 // APPROX-NEXT: i8 88, label %[[IF_THEN5_I_I]]
4431 // APPROX-NEXT: ]
4432 // APPROX: [[WHILE_COND_I_I_I_PREHEADER]]:
4433 // APPROX-NEXT: br i1 [[CMP_NOT_I_I_I14]], label %[[_ZL4NANFPKC_EXIT]], label %[[WHILE_BODY_I_I_I:.*]]
4434 // APPROX: [[IF_THEN5_I_I]]:
4435 // APPROX-NEXT: br i1 [[CMP_NOT_I_I_I14]], label %[[_ZL4NANFPKC_EXIT]], label %[[WHILE_BODY_I31_I_I:.*]]
4436 // APPROX: [[WHILE_BODY_I31_I_I]]:
4437 // APPROX-NEXT: [[TMP3:%.*]] = phi i8 [ [[TMP7:%.*]], %[[IF_END31_I_I_I:.*]] ], [ [[TMP2]], %[[IF_THEN5_I_I]] ]
4438 // APPROX-NEXT: [[__R_0_I29_I_I11:%.*]] = phi i64 [ [[ADD28_I_I_I:%.*]], %[[IF_END31_I_I_I]] ], [ 0, %[[IF_THEN5_I_I]] ]
4439 // APPROX-NEXT: [[__TAGP_ADDR_0_I28_I_I10:%.*]] = phi ptr [ [[INCDEC_PTR_I34_I_I:%.*]], %[[IF_END31_I_I_I]] ], [ [[INCDEC_PTR_I_I]], %[[IF_THEN5_I_I]] ]
4440 // APPROX-NEXT: [[TMP4:%.*]] = add i8 [[TMP3]], -48
4441 // APPROX-NEXT: [[OR_COND_I32_I_I:%.*]] = icmp ult i8 [[TMP4]], 10
4442 // APPROX-NEXT: br i1 [[OR_COND_I32_I_I]], label %[[IF_END31_I_I_I]], label %[[IF_ELSE_I_I_I:.*]]
4443 // APPROX: [[IF_ELSE_I_I_I]]:
4444 // APPROX-NEXT: [[TMP5:%.*]] = add i8 [[TMP3]], -97
4445 // APPROX-NEXT: [[OR_COND33_I_I_I:%.*]] = icmp ult i8 [[TMP5]], 6
4446 // APPROX-NEXT: br i1 [[OR_COND33_I_I_I]], label %[[IF_END31_I_I_I]], label %[[IF_ELSE17_I_I_I:.*]]
4447 // APPROX: [[IF_ELSE17_I_I_I]]:
4448 // APPROX-NEXT: [[TMP6:%.*]] = add i8 [[TMP3]], -65
4449 // APPROX-NEXT: [[OR_COND34_I_I_I:%.*]] = icmp ult i8 [[TMP6]], 6
4450 // APPROX-NEXT: br i1 [[OR_COND34_I_I_I]], label %[[IF_END31_I_I_I]], label %[[_ZL4NANFPKC_EXIT]]
4451 // APPROX: [[IF_END31_I_I_I]]:
4452 // APPROX-NEXT: [[DOTSINK:%.*]] = phi i64 [ -87, %[[IF_ELSE_I_I_I]] ], [ -48, %[[WHILE_BODY_I31_I_I]] ], [ -55, %[[IF_ELSE17_I_I_I]] ]
4453 // APPROX-NEXT: [[MUL24_I_I_I:%.*]] = shl i64 [[__R_0_I29_I_I11]], 4
4454 // APPROX-NEXT: [[CONV25_I_I_I:%.*]] = zext nneg i8 [[TMP3]] to i64
4455 // APPROX-NEXT: [[ADD26_I_I_I:%.*]] = add i64 [[MUL24_I_I_I]], [[DOTSINK]]
4456 // APPROX-NEXT: [[ADD28_I_I_I]] = add i64 [[ADD26_I_I_I]], [[CONV25_I_I_I]]
4457 // APPROX-NEXT: [[INCDEC_PTR_I34_I_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I28_I_I10]], i64 1
4458 // APPROX-NEXT: [[TMP7]] = load i8, ptr [[INCDEC_PTR_I34_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4459 // APPROX-NEXT: [[CMP_NOT_I30_I_I:%.*]] = icmp eq i8 [[TMP7]], 0
4460 // APPROX-NEXT: br i1 [[CMP_NOT_I30_I_I]], label %[[_ZL4NANFPKC_EXIT]], label %[[WHILE_BODY_I31_I_I]], !llvm.loop [[LOOP13]]
4461 // APPROX: [[WHILE_BODY_I_I_I]]:
4462 // APPROX-NEXT: [[TMP8:%.*]] = phi i8 [ [[TMP10:%.*]], %[[IF_THEN_I_I_I:.*]] ], [ [[TMP2]], %[[WHILE_COND_I_I_I_PREHEADER]] ]
4463 // APPROX-NEXT: [[__R_0_I_I_I16:%.*]] = phi i64 [ [[SUB_I_I_I:%.*]], %[[IF_THEN_I_I_I]] ], [ 0, %[[WHILE_COND_I_I_I_PREHEADER]] ]
4464 // APPROX-NEXT: [[__TAGP_ADDR_0_I_I_I15:%.*]] = phi ptr [ [[INCDEC_PTR_I_I_I:%.*]], %[[IF_THEN_I_I_I]] ], [ [[INCDEC_PTR_I_I]], %[[WHILE_COND_I_I_I_PREHEADER]] ]
4465 // APPROX-NEXT: [[TMP9:%.*]] = and i8 [[TMP8]], -8
4466 // APPROX-NEXT: [[OR_COND_I_I_I:%.*]] = icmp eq i8 [[TMP9]], 48
4467 // APPROX-NEXT: br i1 [[OR_COND_I_I_I]], label %[[IF_THEN_I_I_I]], label %[[_ZL4NANFPKC_EXIT]]
4468 // APPROX: [[IF_THEN_I_I_I]]:
4469 // APPROX-NEXT: [[MUL_I_I_I:%.*]] = shl i64 [[__R_0_I_I_I16]], 3
4470 // APPROX-NEXT: [[CONV5_I_I_I:%.*]] = zext nneg i8 [[TMP8]] to i64
4471 // APPROX-NEXT: [[ADD_I_I_I:%.*]] = add i64 [[MUL_I_I_I]], -48
4472 // APPROX-NEXT: [[SUB_I_I_I]] = add i64 [[ADD_I_I_I]], [[CONV5_I_I_I]]
4473 // APPROX-NEXT: [[INCDEC_PTR_I_I_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I_I_I15]], i64 1
4474 // APPROX-NEXT: [[TMP10]] = load i8, ptr [[INCDEC_PTR_I_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4475 // APPROX-NEXT: [[CMP_NOT_I_I_I:%.*]] = icmp eq i8 [[TMP10]], 0
4476 // APPROX-NEXT: br i1 [[CMP_NOT_I_I_I]], label %[[_ZL4NANFPKC_EXIT]], label %[[WHILE_BODY_I_I_I]], !llvm.loop [[LOOP9]]
4477 // APPROX: [[WHILE_BODY_I18_I_I]]:
4478 // APPROX-NEXT: [[TMP11:%.*]] = phi i8 [ [[TMP13:%.*]], %[[IF_THEN_I21_I_I:.*]] ], [ [[TMP1]], %[[WHILE_COND_I14_I_I_PREHEADER]] ]
4479 // APPROX-NEXT: [[__R_0_I16_I_I7:%.*]] = phi i64 [ [[SUB_I25_I_I:%.*]], %[[IF_THEN_I21_I_I]] ], [ 0, %[[WHILE_COND_I14_I_I_PREHEADER]] ]
4480 // APPROX-NEXT: [[__TAGP_ADDR_0_I15_I_I6:%.*]] = phi ptr [ [[INCDEC_PTR_I26_I_I:%.*]], %[[IF_THEN_I21_I_I]] ], [ [[TAG]], %[[WHILE_COND_I14_I_I_PREHEADER]] ]
4481 // APPROX-NEXT: [[TMP12:%.*]] = add i8 [[TMP11]], -48
4482 // APPROX-NEXT: [[OR_COND_I19_I_I:%.*]] = icmp ult i8 [[TMP12]], 10
4483 // APPROX-NEXT: br i1 [[OR_COND_I19_I_I]], label %[[IF_THEN_I21_I_I]], label %[[_ZL4NANFPKC_EXIT]]
4484 // APPROX: [[IF_THEN_I21_I_I]]:
4485 // APPROX-NEXT: [[MUL_I22_I_I:%.*]] = mul i64 [[__R_0_I16_I_I7]], 10
4486 // APPROX-NEXT: [[CONV5_I23_I_I:%.*]] = zext nneg i8 [[TMP11]] to i64
4487 // APPROX-NEXT: [[ADD_I24_I_I:%.*]] = add i64 [[MUL_I22_I_I]], -48
4488 // APPROX-NEXT: [[SUB_I25_I_I]] = add i64 [[ADD_I24_I_I]], [[CONV5_I23_I_I]]
4489 // APPROX-NEXT: [[INCDEC_PTR_I26_I_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I15_I_I6]], i64 1
4490 // APPROX-NEXT: [[TMP13]] = load i8, ptr [[INCDEC_PTR_I26_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4491 // APPROX-NEXT: [[CMP_NOT_I17_I_I:%.*]] = icmp eq i8 [[TMP13]], 0
4492 // APPROX-NEXT: br i1 [[CMP_NOT_I17_I_I]], label %[[_ZL4NANFPKC_EXIT]], label %[[WHILE_BODY_I18_I_I]], !llvm.loop [[LOOP12]]
4493 // APPROX: [[_ZL4NANFPKC_EXIT]]:
4494 // APPROX-NEXT: [[RETVAL_0_I_I:%.*]] = phi i64 [ 0, %[[IF_THEN5_I_I]] ], [ 0, %[[WHILE_COND_I14_I_I_PREHEADER]] ], [ 0, %[[WHILE_COND_I_I_I_PREHEADER]] ], [ [[SUB_I_I_I]], %[[IF_THEN_I_I_I]] ], [ [[ADD28_I_I_I]], %[[IF_END31_I_I_I]] ], [ 0, %[[WHILE_BODY_I_I_I]] ], [ 0, %[[IF_ELSE17_I_I_I]] ], [ [[SUB_I25_I_I]], %[[IF_THEN_I21_I_I]] ], [ 0, %[[WHILE_BODY_I18_I_I]] ]
4495 // APPROX-NEXT: [[CONV_I:%.*]] = trunc i64 [[RETVAL_0_I_I]] to i32
4496 // APPROX-NEXT: [[BF_VALUE_I:%.*]] = and i32 [[CONV_I]], 4194303
4497 // APPROX-NEXT: [[BF_SET9_I:%.*]] = or disjoint i32 [[BF_VALUE_I]], 2143289344
4498 // APPROX-NEXT: [[TMP14:%.*]] = bitcast i32 [[BF_SET9_I]] to float
4499 // APPROX-NEXT: ret float [[TMP14]]
4500 //
4501 // NCRDIV-LABEL: define dso_local float @test_nanf(
4502 // NCRDIV-SAME: ptr noundef readonly captures(none) [[TAG:%.*]]) local_unnamed_addr #[[ATTR2]] {
4503 // NCRDIV-NEXT: [[ENTRY:.*:]]
4504 // NCRDIV-NEXT: [[TMP0:%.*]] = load i8, ptr [[TAG]], align 1, !tbaa [[CHAR_TBAA8]]
4505 // NCRDIV-NEXT: [[CMP_I_I:%.*]] = icmp eq i8 [[TMP0]], 48
4506 // NCRDIV-NEXT: br i1 [[CMP_I_I]], label %[[IF_THEN_I_I:.*]], label %[[WHILE_COND_I14_I_I_PREHEADER:.*]]
4507 // NCRDIV: [[WHILE_COND_I14_I_I_PREHEADER]]:
4508 // NCRDIV-NEXT: [[TMP1:%.*]] = load i8, ptr [[TAG]], align 1, !tbaa [[CHAR_TBAA8]]
4509 // NCRDIV-NEXT: [[CMP_NOT_I17_I_I5:%.*]] = icmp eq i8 [[TMP1]], 0
4510 // NCRDIV-NEXT: br i1 [[CMP_NOT_I17_I_I5]], label %[[_ZL4NANFPKC_EXIT:.*]], label %[[WHILE_BODY_I18_I_I:.*]]
4511 // NCRDIV: [[IF_THEN_I_I]]:
4512 // NCRDIV-NEXT: [[INCDEC_PTR_I_I:%.*]] = getelementptr inbounds nuw i8, ptr [[TAG]], i64 1
4513 // NCRDIV-NEXT: [[TMP2:%.*]] = load i8, ptr [[INCDEC_PTR_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4514 // NCRDIV-NEXT: [[CMP_NOT_I_I_I14:%.*]] = icmp eq i8 [[TMP2]], 0
4515 // NCRDIV-NEXT: switch i8 [[TMP2]], label %[[WHILE_COND_I_I_I_PREHEADER:.*]] [
4516 // NCRDIV-NEXT: i8 120, label %[[IF_THEN5_I_I:.*]]
4517 // NCRDIV-NEXT: i8 88, label %[[IF_THEN5_I_I]]
4518 // NCRDIV-NEXT: ]
4519 // NCRDIV: [[WHILE_COND_I_I_I_PREHEADER]]:
4520 // NCRDIV-NEXT: br i1 [[CMP_NOT_I_I_I14]], label %[[_ZL4NANFPKC_EXIT]], label %[[WHILE_BODY_I_I_I:.*]]
4521 // NCRDIV: [[IF_THEN5_I_I]]:
4522 // NCRDIV-NEXT: br i1 [[CMP_NOT_I_I_I14]], label %[[_ZL4NANFPKC_EXIT]], label %[[WHILE_BODY_I31_I_I:.*]]
4523 // NCRDIV: [[WHILE_BODY_I31_I_I]]:
4524 // NCRDIV-NEXT: [[TMP3:%.*]] = phi i8 [ [[TMP7:%.*]], %[[IF_END31_I_I_I:.*]] ], [ [[TMP2]], %[[IF_THEN5_I_I]] ]
4525 // NCRDIV-NEXT: [[__R_0_I29_I_I11:%.*]] = phi i64 [ [[ADD28_I_I_I:%.*]], %[[IF_END31_I_I_I]] ], [ 0, %[[IF_THEN5_I_I]] ]
4526 // NCRDIV-NEXT: [[__TAGP_ADDR_0_I28_I_I10:%.*]] = phi ptr [ [[INCDEC_PTR_I34_I_I:%.*]], %[[IF_END31_I_I_I]] ], [ [[INCDEC_PTR_I_I]], %[[IF_THEN5_I_I]] ]
4527 // NCRDIV-NEXT: [[TMP4:%.*]] = add i8 [[TMP3]], -48
4528 // NCRDIV-NEXT: [[OR_COND_I32_I_I:%.*]] = icmp ult i8 [[TMP4]], 10
4529 // NCRDIV-NEXT: br i1 [[OR_COND_I32_I_I]], label %[[IF_END31_I_I_I]], label %[[IF_ELSE_I_I_I:.*]]
4530 // NCRDIV: [[IF_ELSE_I_I_I]]:
4531 // NCRDIV-NEXT: [[TMP5:%.*]] = add i8 [[TMP3]], -97
4532 // NCRDIV-NEXT: [[OR_COND33_I_I_I:%.*]] = icmp ult i8 [[TMP5]], 6
4533 // NCRDIV-NEXT: br i1 [[OR_COND33_I_I_I]], label %[[IF_END31_I_I_I]], label %[[IF_ELSE17_I_I_I:.*]]
4534 // NCRDIV: [[IF_ELSE17_I_I_I]]:
4535 // NCRDIV-NEXT: [[TMP6:%.*]] = add i8 [[TMP3]], -65
4536 // NCRDIV-NEXT: [[OR_COND34_I_I_I:%.*]] = icmp ult i8 [[TMP6]], 6
4537 // NCRDIV-NEXT: br i1 [[OR_COND34_I_I_I]], label %[[IF_END31_I_I_I]], label %[[_ZL4NANFPKC_EXIT]]
4538 // NCRDIV: [[IF_END31_I_I_I]]:
4539 // NCRDIV-NEXT: [[DOTSINK:%.*]] = phi i64 [ -87, %[[IF_ELSE_I_I_I]] ], [ -48, %[[WHILE_BODY_I31_I_I]] ], [ -55, %[[IF_ELSE17_I_I_I]] ]
4540 // NCRDIV-NEXT: [[MUL24_I_I_I:%.*]] = shl i64 [[__R_0_I29_I_I11]], 4
4541 // NCRDIV-NEXT: [[CONV25_I_I_I:%.*]] = zext nneg i8 [[TMP3]] to i64
4542 // NCRDIV-NEXT: [[ADD26_I_I_I:%.*]] = add i64 [[MUL24_I_I_I]], [[DOTSINK]]
4543 // NCRDIV-NEXT: [[ADD28_I_I_I]] = add i64 [[ADD26_I_I_I]], [[CONV25_I_I_I]]
4544 // NCRDIV-NEXT: [[INCDEC_PTR_I34_I_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I28_I_I10]], i64 1
4545 // NCRDIV-NEXT: [[TMP7]] = load i8, ptr [[INCDEC_PTR_I34_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4546 // NCRDIV-NEXT: [[CMP_NOT_I30_I_I:%.*]] = icmp eq i8 [[TMP7]], 0
4547 // NCRDIV-NEXT: br i1 [[CMP_NOT_I30_I_I]], label %[[_ZL4NANFPKC_EXIT]], label %[[WHILE_BODY_I31_I_I]], !llvm.loop [[LOOP13]]
4548 // NCRDIV: [[WHILE_BODY_I_I_I]]:
4549 // NCRDIV-NEXT: [[TMP8:%.*]] = phi i8 [ [[TMP10:%.*]], %[[IF_THEN_I_I_I:.*]] ], [ [[TMP2]], %[[WHILE_COND_I_I_I_PREHEADER]] ]
4550 // NCRDIV-NEXT: [[__R_0_I_I_I16:%.*]] = phi i64 [ [[SUB_I_I_I:%.*]], %[[IF_THEN_I_I_I]] ], [ 0, %[[WHILE_COND_I_I_I_PREHEADER]] ]
4551 // NCRDIV-NEXT: [[__TAGP_ADDR_0_I_I_I15:%.*]] = phi ptr [ [[INCDEC_PTR_I_I_I:%.*]], %[[IF_THEN_I_I_I]] ], [ [[INCDEC_PTR_I_I]], %[[WHILE_COND_I_I_I_PREHEADER]] ]
4552 // NCRDIV-NEXT: [[TMP9:%.*]] = and i8 [[TMP8]], -8
4553 // NCRDIV-NEXT: [[OR_COND_I_I_I:%.*]] = icmp eq i8 [[TMP9]], 48
4554 // NCRDIV-NEXT: br i1 [[OR_COND_I_I_I]], label %[[IF_THEN_I_I_I]], label %[[_ZL4NANFPKC_EXIT]]
4555 // NCRDIV: [[IF_THEN_I_I_I]]:
4556 // NCRDIV-NEXT: [[MUL_I_I_I:%.*]] = shl i64 [[__R_0_I_I_I16]], 3
4557 // NCRDIV-NEXT: [[CONV5_I_I_I:%.*]] = zext nneg i8 [[TMP8]] to i64
4558 // NCRDIV-NEXT: [[ADD_I_I_I:%.*]] = add i64 [[MUL_I_I_I]], -48
4559 // NCRDIV-NEXT: [[SUB_I_I_I]] = add i64 [[ADD_I_I_I]], [[CONV5_I_I_I]]
4560 // NCRDIV-NEXT: [[INCDEC_PTR_I_I_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I_I_I15]], i64 1
4561 // NCRDIV-NEXT: [[TMP10]] = load i8, ptr [[INCDEC_PTR_I_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4562 // NCRDIV-NEXT: [[CMP_NOT_I_I_I:%.*]] = icmp eq i8 [[TMP10]], 0
4563 // NCRDIV-NEXT: br i1 [[CMP_NOT_I_I_I]], label %[[_ZL4NANFPKC_EXIT]], label %[[WHILE_BODY_I_I_I]], !llvm.loop [[LOOP9]]
4564 // NCRDIV: [[WHILE_BODY_I18_I_I]]:
4565 // NCRDIV-NEXT: [[TMP11:%.*]] = phi i8 [ [[TMP13:%.*]], %[[IF_THEN_I21_I_I:.*]] ], [ [[TMP1]], %[[WHILE_COND_I14_I_I_PREHEADER]] ]
4566 // NCRDIV-NEXT: [[__R_0_I16_I_I7:%.*]] = phi i64 [ [[SUB_I25_I_I:%.*]], %[[IF_THEN_I21_I_I]] ], [ 0, %[[WHILE_COND_I14_I_I_PREHEADER]] ]
4567 // NCRDIV-NEXT: [[__TAGP_ADDR_0_I15_I_I6:%.*]] = phi ptr [ [[INCDEC_PTR_I26_I_I:%.*]], %[[IF_THEN_I21_I_I]] ], [ [[TAG]], %[[WHILE_COND_I14_I_I_PREHEADER]] ]
4568 // NCRDIV-NEXT: [[TMP12:%.*]] = add i8 [[TMP11]], -48
4569 // NCRDIV-NEXT: [[OR_COND_I19_I_I:%.*]] = icmp ult i8 [[TMP12]], 10
4570 // NCRDIV-NEXT: br i1 [[OR_COND_I19_I_I]], label %[[IF_THEN_I21_I_I]], label %[[_ZL4NANFPKC_EXIT]]
4571 // NCRDIV: [[IF_THEN_I21_I_I]]:
4572 // NCRDIV-NEXT: [[MUL_I22_I_I:%.*]] = mul i64 [[__R_0_I16_I_I7]], 10
4573 // NCRDIV-NEXT: [[CONV5_I23_I_I:%.*]] = zext nneg i8 [[TMP11]] to i64
4574 // NCRDIV-NEXT: [[ADD_I24_I_I:%.*]] = add i64 [[MUL_I22_I_I]], -48
4575 // NCRDIV-NEXT: [[SUB_I25_I_I]] = add i64 [[ADD_I24_I_I]], [[CONV5_I23_I_I]]
4576 // NCRDIV-NEXT: [[INCDEC_PTR_I26_I_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I15_I_I6]], i64 1
4577 // NCRDIV-NEXT: [[TMP13]] = load i8, ptr [[INCDEC_PTR_I26_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4578 // NCRDIV-NEXT: [[CMP_NOT_I17_I_I:%.*]] = icmp eq i8 [[TMP13]], 0
4579 // NCRDIV-NEXT: br i1 [[CMP_NOT_I17_I_I]], label %[[_ZL4NANFPKC_EXIT]], label %[[WHILE_BODY_I18_I_I]], !llvm.loop [[LOOP12]]
4580 // NCRDIV: [[_ZL4NANFPKC_EXIT]]:
4581 // NCRDIV-NEXT: [[RETVAL_0_I_I:%.*]] = phi i64 [ 0, %[[IF_THEN5_I_I]] ], [ 0, %[[WHILE_COND_I14_I_I_PREHEADER]] ], [ 0, %[[WHILE_COND_I_I_I_PREHEADER]] ], [ [[SUB_I_I_I]], %[[IF_THEN_I_I_I]] ], [ [[ADD28_I_I_I]], %[[IF_END31_I_I_I]] ], [ 0, %[[WHILE_BODY_I_I_I]] ], [ 0, %[[IF_ELSE17_I_I_I]] ], [ [[SUB_I25_I_I]], %[[IF_THEN_I21_I_I]] ], [ 0, %[[WHILE_BODY_I18_I_I]] ]
4582 // NCRDIV-NEXT: [[CONV_I:%.*]] = trunc i64 [[RETVAL_0_I_I]] to i32
4583 // NCRDIV-NEXT: [[BF_VALUE_I:%.*]] = and i32 [[CONV_I]], 4194303
4584 // NCRDIV-NEXT: [[BF_SET9_I:%.*]] = or disjoint i32 [[BF_VALUE_I]], 2143289344
4585 // NCRDIV-NEXT: [[TMP14:%.*]] = bitcast i32 [[BF_SET9_I]] to float
4586 // NCRDIV-NEXT: ret float [[TMP14]]
4587 //
4588 // AMDGCNSPIRV-LABEL: define spir_func float @test_nanf(
4589 // AMDGCNSPIRV-SAME: ptr addrspace(4) noundef readonly captures(none) [[TAG:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR2]] {
4590 // AMDGCNSPIRV-NEXT: [[ENTRY:.*]]:
4591 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = load i8, ptr addrspace(4) [[TAG]], align 1, !tbaa [[CHAR_TBAA9]]
4592 // AMDGCNSPIRV-NEXT: [[CMP_I_I:%.*]] = icmp eq i8 [[TMP0]], 48
4593 // AMDGCNSPIRV-NEXT: br i1 [[CMP_I_I]], label %[[IF_THEN_I_I:.*]], label %[[WHILE_COND_I14_I_I:.*]]
4594 // AMDGCNSPIRV: [[IF_THEN_I_I]]:
4595 // AMDGCNSPIRV-NEXT: [[INCDEC_PTR_I_I:%.*]] = getelementptr inbounds nuw i8, ptr addrspace(4) [[TAG]], i64 1
4596 // AMDGCNSPIRV-NEXT: [[TMP1:%.*]] = load i8, ptr addrspace(4) [[INCDEC_PTR_I_I]], align 1, !tbaa [[CHAR_TBAA9]]
4597 // AMDGCNSPIRV-NEXT: switch i8 [[TMP1]], label %[[WHILE_COND_I_I_I:.*]] [
4598 // AMDGCNSPIRV-NEXT: i8 120, label %[[IF_THEN5_I_I:.*]]
4599 // AMDGCNSPIRV-NEXT: i8 88, label %[[IF_THEN5_I_I]]
4600 // AMDGCNSPIRV-NEXT: ]
4601 // AMDGCNSPIRV: [[IF_THEN5_I_I]]:
4602 // AMDGCNSPIRV-NEXT: [[TMP2:%.*]] = load i8, ptr addrspace(4) [[INCDEC_PTR_I_I]], align 1, !tbaa [[CHAR_TBAA9]]
4603 // AMDGCNSPIRV-NEXT: [[CMP_NOT_I31_I_I5:%.*]] = icmp eq i8 [[TMP2]], 0
4604 // AMDGCNSPIRV-NEXT: br i1 [[CMP_NOT_I31_I_I5]], label %[[_ZL4NANFPKC_EXIT:.*]], label %[[WHILE_BODY_I32_I_I:.*]]
4605 // AMDGCNSPIRV: [[WHILE_BODY_I32_I_I]]:
4606 // AMDGCNSPIRV-NEXT: [[TMP3:%.*]] = phi i8 [ [[TMP7:%.*]], %[[IF_END31_I_I_I:.*]] ], [ [[TMP2]], %[[IF_THEN5_I_I]] ]
4607 // AMDGCNSPIRV-NEXT: [[__R_0_I30_I_I7:%.*]] = phi i64 [ [[ADD28_I_I_I:%.*]], %[[IF_END31_I_I_I]] ], [ 0, %[[IF_THEN5_I_I]] ]
4608 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_0_I29_I_I6:%.*]] = phi ptr addrspace(4) [ [[INCDEC_PTR_I36_I_I:%.*]], %[[IF_END31_I_I_I]] ], [ [[INCDEC_PTR_I_I]], %[[IF_THEN5_I_I]] ]
4609 // AMDGCNSPIRV-NEXT: [[TMP4:%.*]] = add i8 [[TMP3]], -48
4610 // AMDGCNSPIRV-NEXT: [[OR_COND_I33_I_I:%.*]] = icmp ult i8 [[TMP4]], 10
4611 // AMDGCNSPIRV-NEXT: br i1 [[OR_COND_I33_I_I]], label %[[IF_END31_I_I_I]], label %[[IF_ELSE_I_I_I:.*]]
4612 // AMDGCNSPIRV: [[IF_ELSE_I_I_I]]:
4613 // AMDGCNSPIRV-NEXT: [[TMP5:%.*]] = add i8 [[TMP3]], -97
4614 // AMDGCNSPIRV-NEXT: [[OR_COND33_I_I_I:%.*]] = icmp ult i8 [[TMP5]], 6
4615 // AMDGCNSPIRV-NEXT: br i1 [[OR_COND33_I_I_I]], label %[[IF_END31_I_I_I]], label %[[IF_ELSE17_I_I_I:.*]]
4616 // AMDGCNSPIRV: [[IF_ELSE17_I_I_I]]:
4617 // AMDGCNSPIRV-NEXT: [[TMP6:%.*]] = add i8 [[TMP3]], -65
4618 // AMDGCNSPIRV-NEXT: [[OR_COND34_I_I_I:%.*]] = icmp ult i8 [[TMP6]], 6
4619 // AMDGCNSPIRV-NEXT: br i1 [[OR_COND34_I_I_I]], label %[[IF_END31_I_I_I]], label %[[_ZL4NANFPKC_EXIT]]
4620 // AMDGCNSPIRV: [[IF_END31_I_I_I]]:
4621 // AMDGCNSPIRV-NEXT: [[DOTSINK:%.*]] = phi i64 [ -87, %[[IF_ELSE_I_I_I]] ], [ -48, %[[WHILE_BODY_I32_I_I]] ], [ -55, %[[IF_ELSE17_I_I_I]] ]
4622 // AMDGCNSPIRV-NEXT: [[MUL24_I_I_I:%.*]] = shl i64 [[__R_0_I30_I_I7]], 4
4623 // AMDGCNSPIRV-NEXT: [[CONV25_I_I_I:%.*]] = zext nneg i8 [[TMP3]] to i64
4624 // AMDGCNSPIRV-NEXT: [[ADD26_I_I_I:%.*]] = add i64 [[MUL24_I_I_I]], [[DOTSINK]]
4625 // AMDGCNSPIRV-NEXT: [[ADD28_I_I_I]] = add i64 [[ADD26_I_I_I]], [[CONV25_I_I_I]]
4626 // AMDGCNSPIRV-NEXT: [[INCDEC_PTR_I36_I_I]] = getelementptr inbounds nuw i8, ptr addrspace(4) [[__TAGP_ADDR_0_I29_I_I6]], i64 1
4627 // AMDGCNSPIRV-NEXT: [[TMP7]] = load i8, ptr addrspace(4) [[INCDEC_PTR_I36_I_I]], align 1, !tbaa [[CHAR_TBAA9]]
4628 // AMDGCNSPIRV-NEXT: [[CMP_NOT_I31_I_I:%.*]] = icmp eq i8 [[TMP7]], 0
4629 // AMDGCNSPIRV-NEXT: br i1 [[CMP_NOT_I31_I_I]], label %[[_ZL4NANFPKC_EXIT]], label %[[WHILE_BODY_I32_I_I]], !llvm.loop [[LOOP14]]
4630 // AMDGCNSPIRV: [[WHILE_COND_I_I_I]]:
4631 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_0_I_I_I:%.*]] = phi ptr addrspace(4) [ [[__TAGP_ADDR_1_I_I_I:%.*]], %[[WHILE_BODY_I_I_I:.*]] ], [ [[INCDEC_PTR_I_I]], %[[IF_THEN_I_I]] ]
4632 // AMDGCNSPIRV-NEXT: [[__R_0_I_I_I:%.*]] = phi i64 [ [[__R_1_I_I_I:%.*]], %[[WHILE_BODY_I_I_I]] ], [ 0, %[[IF_THEN_I_I]] ]
4633 // AMDGCNSPIRV-NEXT: [[TMP8:%.*]] = load i8, ptr addrspace(4) [[__TAGP_ADDR_0_I_I_I]], align 1, !tbaa [[CHAR_TBAA9]]
4634 // AMDGCNSPIRV-NEXT: [[CMP_NOT_I_I_I:%.*]] = icmp eq i8 [[TMP8]], 0
4635 // AMDGCNSPIRV-NEXT: br i1 [[CMP_NOT_I_I_I]], label %[[_ZL4NANFPKC_EXIT]], label %[[WHILE_BODY_I_I_I]]
4636 // AMDGCNSPIRV: [[WHILE_BODY_I_I_I]]:
4637 // AMDGCNSPIRV-NEXT: [[TMP9:%.*]] = and i8 [[TMP8]], -8
4638 // AMDGCNSPIRV-NEXT: [[OR_COND_I_I_I:%.*]] = icmp eq i8 [[TMP9]], 48
4639 // AMDGCNSPIRV-NEXT: [[MUL_I_I_I:%.*]] = shl i64 [[__R_0_I_I_I]], 3
4640 // AMDGCNSPIRV-NEXT: [[CONV5_I_I_I:%.*]] = zext nneg i8 [[TMP8]] to i64
4641 // AMDGCNSPIRV-NEXT: [[ADD_I_I_I:%.*]] = add i64 [[MUL_I_I_I]], -48
4642 // AMDGCNSPIRV-NEXT: [[SUB_I_I_I:%.*]] = add i64 [[ADD_I_I_I]], [[CONV5_I_I_I]]
4643 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_1_I_I_I_IDX:%.*]] = zext i1 [[OR_COND_I_I_I]] to i64
4644 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_1_I_I_I]] = getelementptr inbounds nuw i8, ptr addrspace(4) [[__TAGP_ADDR_0_I_I_I]], i64 [[__TAGP_ADDR_1_I_I_I_IDX]]
4645 // AMDGCNSPIRV-NEXT: [[__R_1_I_I_I]] = select i1 [[OR_COND_I_I_I]], i64 [[SUB_I_I_I]], i64 [[__R_0_I_I_I]]
4646 // AMDGCNSPIRV-NEXT: br i1 [[OR_COND_I_I_I]], label %[[WHILE_COND_I_I_I]], label %[[_ZL4NANFPKC_EXIT]], !llvm.loop [[LOOP10]]
4647 // AMDGCNSPIRV: [[WHILE_COND_I14_I_I]]:
4648 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_0_I15_I_I:%.*]] = phi ptr addrspace(4) [ [[__TAGP_ADDR_1_I25_I_I:%.*]], %[[WHILE_BODY_I18_I_I:.*]] ], [ [[TAG]], %[[ENTRY]] ]
4649 // AMDGCNSPIRV-NEXT: [[__R_0_I16_I_I:%.*]] = phi i64 [ [[__R_1_I26_I_I:%.*]], %[[WHILE_BODY_I18_I_I]] ], [ 0, %[[ENTRY]] ]
4650 // AMDGCNSPIRV-NEXT: [[TMP10:%.*]] = load i8, ptr addrspace(4) [[__TAGP_ADDR_0_I15_I_I]], align 1, !tbaa [[CHAR_TBAA9]]
4651 // AMDGCNSPIRV-NEXT: [[CMP_NOT_I17_I_I:%.*]] = icmp eq i8 [[TMP10]], 0
4652 // AMDGCNSPIRV-NEXT: br i1 [[CMP_NOT_I17_I_I]], label %[[_ZL4NANFPKC_EXIT]], label %[[WHILE_BODY_I18_I_I]]
4653 // AMDGCNSPIRV: [[WHILE_BODY_I18_I_I]]:
4654 // AMDGCNSPIRV-NEXT: [[TMP11:%.*]] = add i8 [[TMP10]], -48
4655 // AMDGCNSPIRV-NEXT: [[OR_COND_I19_I_I:%.*]] = icmp ult i8 [[TMP11]], 10
4656 // AMDGCNSPIRV-NEXT: [[MUL_I20_I_I:%.*]] = mul i64 [[__R_0_I16_I_I]], 10
4657 // AMDGCNSPIRV-NEXT: [[CONV5_I21_I_I:%.*]] = zext nneg i8 [[TMP10]] to i64
4658 // AMDGCNSPIRV-NEXT: [[ADD_I22_I_I:%.*]] = add i64 [[MUL_I20_I_I]], -48
4659 // AMDGCNSPIRV-NEXT: [[SUB_I23_I_I:%.*]] = add i64 [[ADD_I22_I_I]], [[CONV5_I21_I_I]]
4660 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_1_I25_I_I_IDX:%.*]] = zext i1 [[OR_COND_I19_I_I]] to i64
4661 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_1_I25_I_I]] = getelementptr inbounds nuw i8, ptr addrspace(4) [[__TAGP_ADDR_0_I15_I_I]], i64 [[__TAGP_ADDR_1_I25_I_I_IDX]]
4662 // AMDGCNSPIRV-NEXT: [[__R_1_I26_I_I]] = select i1 [[OR_COND_I19_I_I]], i64 [[SUB_I23_I_I]], i64 [[__R_0_I16_I_I]]
4663 // AMDGCNSPIRV-NEXT: br i1 [[OR_COND_I19_I_I]], label %[[WHILE_COND_I14_I_I]], label %[[_ZL4NANFPKC_EXIT]], !llvm.loop [[LOOP13]]
4664 // AMDGCNSPIRV: [[_ZL4NANFPKC_EXIT]]:
4665 // AMDGCNSPIRV-NEXT: [[RETVAL_0_I_I:%.*]] = phi i64 [ 0, %[[IF_THEN5_I_I]] ], [ [[ADD28_I_I_I]], %[[IF_END31_I_I_I]] ], [ [[__R_0_I_I_I]], %[[WHILE_COND_I_I_I]] ], [ 0, %[[WHILE_BODY_I_I_I]] ], [ 0, %[[IF_ELSE17_I_I_I]] ], [ 0, %[[WHILE_BODY_I18_I_I]] ], [ [[__R_0_I16_I_I]], %[[WHILE_COND_I14_I_I]] ]
4666 // AMDGCNSPIRV-NEXT: [[CONV_I:%.*]] = trunc i64 [[RETVAL_0_I_I]] to i32
4667 // AMDGCNSPIRV-NEXT: [[BF_VALUE_I:%.*]] = and i32 [[CONV_I]], 4194303
4668 // AMDGCNSPIRV-NEXT: [[BF_SET9_I:%.*]] = or disjoint i32 [[BF_VALUE_I]], 2143289344
4669 // AMDGCNSPIRV-NEXT: [[TMP12:%.*]] = bitcast i32 [[BF_SET9_I]] to float
4670 // AMDGCNSPIRV-NEXT: ret float [[TMP12]]
4671 //
4672 extern "C" __device__ float test_nanf(const char *tag) {
4673 return nanf(tag);
4674 }
4675
4676 // DEFAULT-LABEL: define dso_local double @test_nan(
4677 // DEFAULT-SAME: ptr noundef readonly captures(none) [[TAG:%.*]]) local_unnamed_addr #[[ATTR2]] {
4678 // DEFAULT-NEXT: [[ENTRY:.*:]]
4679 // DEFAULT-NEXT: [[TMP0:%.*]] = load i8, ptr [[TAG]], align 1, !tbaa [[CHAR_TBAA8]]
4680 // DEFAULT-NEXT: [[CMP_I_I:%.*]] = icmp eq i8 [[TMP0]], 48
4681 // DEFAULT-NEXT: br i1 [[CMP_I_I]], label %[[IF_THEN_I_I:.*]], label %[[WHILE_COND_I14_I_I_PREHEADER:.*]]
4682 // DEFAULT: [[WHILE_COND_I14_I_I_PREHEADER]]:
4683 // DEFAULT-NEXT: [[TMP1:%.*]] = load i8, ptr [[TAG]], align 1, !tbaa [[CHAR_TBAA8]]
4684 // DEFAULT-NEXT: [[CMP_NOT_I17_I_I5:%.*]] = icmp eq i8 [[TMP1]], 0
4685 // DEFAULT-NEXT: br i1 [[CMP_NOT_I17_I_I5]], label %[[_ZL3NANPKC_EXIT:.*]], label %[[WHILE_BODY_I18_I_I:.*]]
4686 // DEFAULT: [[IF_THEN_I_I]]:
4687 // DEFAULT-NEXT: [[INCDEC_PTR_I_I:%.*]] = getelementptr inbounds nuw i8, ptr [[TAG]], i64 1
4688 // DEFAULT-NEXT: [[TMP2:%.*]] = load i8, ptr [[INCDEC_PTR_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4689 // DEFAULT-NEXT: [[CMP_NOT_I_I_I14:%.*]] = icmp eq i8 [[TMP2]], 0
4690 // DEFAULT-NEXT: switch i8 [[TMP2]], label %[[WHILE_COND_I_I_I_PREHEADER:.*]] [
4691 // DEFAULT-NEXT: i8 120, label %[[IF_THEN5_I_I:.*]]
4692 // DEFAULT-NEXT: i8 88, label %[[IF_THEN5_I_I]]
4693 // DEFAULT-NEXT: ]
4694 // DEFAULT: [[WHILE_COND_I_I_I_PREHEADER]]:
4695 // DEFAULT-NEXT: br i1 [[CMP_NOT_I_I_I14]], label %[[_ZL3NANPKC_EXIT]], label %[[WHILE_BODY_I_I_I:.*]]
4696 // DEFAULT: [[IF_THEN5_I_I]]:
4697 // DEFAULT-NEXT: br i1 [[CMP_NOT_I_I_I14]], label %[[_ZL3NANPKC_EXIT]], label %[[WHILE_BODY_I31_I_I:.*]]
4698 // DEFAULT: [[WHILE_BODY_I31_I_I]]:
4699 // DEFAULT-NEXT: [[TMP3:%.*]] = phi i8 [ [[TMP7:%.*]], %[[IF_END31_I_I_I:.*]] ], [ [[TMP2]], %[[IF_THEN5_I_I]] ]
4700 // DEFAULT-NEXT: [[__R_0_I29_I_I11:%.*]] = phi i64 [ [[ADD28_I_I_I:%.*]], %[[IF_END31_I_I_I]] ], [ 0, %[[IF_THEN5_I_I]] ]
4701 // DEFAULT-NEXT: [[__TAGP_ADDR_0_I28_I_I10:%.*]] = phi ptr [ [[INCDEC_PTR_I34_I_I:%.*]], %[[IF_END31_I_I_I]] ], [ [[INCDEC_PTR_I_I]], %[[IF_THEN5_I_I]] ]
4702 // DEFAULT-NEXT: [[TMP4:%.*]] = add i8 [[TMP3]], -48
4703 // DEFAULT-NEXT: [[OR_COND_I32_I_I:%.*]] = icmp ult i8 [[TMP4]], 10
4704 // DEFAULT-NEXT: br i1 [[OR_COND_I32_I_I]], label %[[IF_END31_I_I_I]], label %[[IF_ELSE_I_I_I:.*]]
4705 // DEFAULT: [[IF_ELSE_I_I_I]]:
4706 // DEFAULT-NEXT: [[TMP5:%.*]] = add i8 [[TMP3]], -97
4707 // DEFAULT-NEXT: [[OR_COND33_I_I_I:%.*]] = icmp ult i8 [[TMP5]], 6
4708 // DEFAULT-NEXT: br i1 [[OR_COND33_I_I_I]], label %[[IF_END31_I_I_I]], label %[[IF_ELSE17_I_I_I:.*]]
4709 // DEFAULT: [[IF_ELSE17_I_I_I]]:
4710 // DEFAULT-NEXT: [[TMP6:%.*]] = add i8 [[TMP3]], -65
4711 // DEFAULT-NEXT: [[OR_COND34_I_I_I:%.*]] = icmp ult i8 [[TMP6]], 6
4712 // DEFAULT-NEXT: br i1 [[OR_COND34_I_I_I]], label %[[IF_END31_I_I_I]], label %[[_ZL3NANPKC_EXIT]]
4713 // DEFAULT: [[IF_END31_I_I_I]]:
4714 // DEFAULT-NEXT: [[DOTSINK:%.*]] = phi i64 [ -87, %[[IF_ELSE_I_I_I]] ], [ -48, %[[WHILE_BODY_I31_I_I]] ], [ -55, %[[IF_ELSE17_I_I_I]] ]
4715 // DEFAULT-NEXT: [[MUL24_I_I_I:%.*]] = shl i64 [[__R_0_I29_I_I11]], 4
4716 // DEFAULT-NEXT: [[CONV25_I_I_I:%.*]] = zext nneg i8 [[TMP3]] to i64
4717 // DEFAULT-NEXT: [[ADD26_I_I_I:%.*]] = add i64 [[MUL24_I_I_I]], [[DOTSINK]]
4718 // DEFAULT-NEXT: [[ADD28_I_I_I]] = add i64 [[ADD26_I_I_I]], [[CONV25_I_I_I]]
4719 // DEFAULT-NEXT: [[INCDEC_PTR_I34_I_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I28_I_I10]], i64 1
4720 // DEFAULT-NEXT: [[TMP7]] = load i8, ptr [[INCDEC_PTR_I34_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4721 // DEFAULT-NEXT: [[CMP_NOT_I30_I_I:%.*]] = icmp eq i8 [[TMP7]], 0
4722 // DEFAULT-NEXT: br i1 [[CMP_NOT_I30_I_I]], label %[[_ZL3NANPKC_EXIT]], label %[[WHILE_BODY_I31_I_I]], !llvm.loop [[LOOP13]]
4723 // DEFAULT: [[WHILE_BODY_I_I_I]]:
4724 // DEFAULT-NEXT: [[TMP8:%.*]] = phi i8 [ [[TMP10:%.*]], %[[IF_THEN_I_I_I:.*]] ], [ [[TMP2]], %[[WHILE_COND_I_I_I_PREHEADER]] ]
4725 // DEFAULT-NEXT: [[__R_0_I_I_I16:%.*]] = phi i64 [ [[SUB_I_I_I:%.*]], %[[IF_THEN_I_I_I]] ], [ 0, %[[WHILE_COND_I_I_I_PREHEADER]] ]
4726 // DEFAULT-NEXT: [[__TAGP_ADDR_0_I_I_I15:%.*]] = phi ptr [ [[INCDEC_PTR_I_I_I:%.*]], %[[IF_THEN_I_I_I]] ], [ [[INCDEC_PTR_I_I]], %[[WHILE_COND_I_I_I_PREHEADER]] ]
4727 // DEFAULT-NEXT: [[TMP9:%.*]] = and i8 [[TMP8]], -8
4728 // DEFAULT-NEXT: [[OR_COND_I_I_I:%.*]] = icmp eq i8 [[TMP9]], 48
4729 // DEFAULT-NEXT: br i1 [[OR_COND_I_I_I]], label %[[IF_THEN_I_I_I]], label %[[_ZL3NANPKC_EXIT]]
4730 // DEFAULT: [[IF_THEN_I_I_I]]:
4731 // DEFAULT-NEXT: [[MUL_I_I_I:%.*]] = shl i64 [[__R_0_I_I_I16]], 3
4732 // DEFAULT-NEXT: [[CONV5_I_I_I:%.*]] = zext nneg i8 [[TMP8]] to i64
4733 // DEFAULT-NEXT: [[ADD_I_I_I:%.*]] = add i64 [[MUL_I_I_I]], -48
4734 // DEFAULT-NEXT: [[SUB_I_I_I]] = add i64 [[ADD_I_I_I]], [[CONV5_I_I_I]]
4735 // DEFAULT-NEXT: [[INCDEC_PTR_I_I_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I_I_I15]], i64 1
4736 // DEFAULT-NEXT: [[TMP10]] = load i8, ptr [[INCDEC_PTR_I_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4737 // DEFAULT-NEXT: [[CMP_NOT_I_I_I:%.*]] = icmp eq i8 [[TMP10]], 0
4738 // DEFAULT-NEXT: br i1 [[CMP_NOT_I_I_I]], label %[[_ZL3NANPKC_EXIT]], label %[[WHILE_BODY_I_I_I]], !llvm.loop [[LOOP9]]
4739 // DEFAULT: [[WHILE_BODY_I18_I_I]]:
4740 // DEFAULT-NEXT: [[TMP11:%.*]] = phi i8 [ [[TMP13:%.*]], %[[IF_THEN_I21_I_I:.*]] ], [ [[TMP1]], %[[WHILE_COND_I14_I_I_PREHEADER]] ]
4741 // DEFAULT-NEXT: [[__R_0_I16_I_I7:%.*]] = phi i64 [ [[SUB_I25_I_I:%.*]], %[[IF_THEN_I21_I_I]] ], [ 0, %[[WHILE_COND_I14_I_I_PREHEADER]] ]
4742 // DEFAULT-NEXT: [[__TAGP_ADDR_0_I15_I_I6:%.*]] = phi ptr [ [[INCDEC_PTR_I26_I_I:%.*]], %[[IF_THEN_I21_I_I]] ], [ [[TAG]], %[[WHILE_COND_I14_I_I_PREHEADER]] ]
4743 // DEFAULT-NEXT: [[TMP12:%.*]] = add i8 [[TMP11]], -48
4744 // DEFAULT-NEXT: [[OR_COND_I19_I_I:%.*]] = icmp ult i8 [[TMP12]], 10
4745 // DEFAULT-NEXT: br i1 [[OR_COND_I19_I_I]], label %[[IF_THEN_I21_I_I]], label %[[_ZL3NANPKC_EXIT]]
4746 // DEFAULT: [[IF_THEN_I21_I_I]]:
4747 // DEFAULT-NEXT: [[MUL_I22_I_I:%.*]] = mul i64 [[__R_0_I16_I_I7]], 10
4748 // DEFAULT-NEXT: [[CONV5_I23_I_I:%.*]] = zext nneg i8 [[TMP11]] to i64
4749 // DEFAULT-NEXT: [[ADD_I24_I_I:%.*]] = add i64 [[MUL_I22_I_I]], -48
4750 // DEFAULT-NEXT: [[SUB_I25_I_I]] = add i64 [[ADD_I24_I_I]], [[CONV5_I23_I_I]]
4751 // DEFAULT-NEXT: [[INCDEC_PTR_I26_I_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I15_I_I6]], i64 1
4752 // DEFAULT-NEXT: [[TMP13]] = load i8, ptr [[INCDEC_PTR_I26_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4753 // DEFAULT-NEXT: [[CMP_NOT_I17_I_I:%.*]] = icmp eq i8 [[TMP13]], 0
4754 // DEFAULT-NEXT: br i1 [[CMP_NOT_I17_I_I]], label %[[_ZL3NANPKC_EXIT]], label %[[WHILE_BODY_I18_I_I]], !llvm.loop [[LOOP12]]
4755 // DEFAULT: [[_ZL3NANPKC_EXIT]]:
4756 // DEFAULT-NEXT: [[RETVAL_0_I_I:%.*]] = phi i64 [ 0, %[[IF_THEN5_I_I]] ], [ 0, %[[WHILE_COND_I14_I_I_PREHEADER]] ], [ 0, %[[WHILE_COND_I_I_I_PREHEADER]] ], [ [[SUB_I_I_I]], %[[IF_THEN_I_I_I]] ], [ [[ADD28_I_I_I]], %[[IF_END31_I_I_I]] ], [ 0, %[[WHILE_BODY_I_I_I]] ], [ 0, %[[IF_ELSE17_I_I_I]] ], [ [[SUB_I25_I_I]], %[[IF_THEN_I21_I_I]] ], [ 0, %[[WHILE_BODY_I18_I_I]] ]
4757 // DEFAULT-NEXT: [[BF_VALUE_I:%.*]] = and i64 [[RETVAL_0_I_I]], 2251799813685247
4758 // DEFAULT-NEXT: [[BF_SET9_I:%.*]] = or disjoint i64 [[BF_VALUE_I]], 9221120237041090560
4759 // DEFAULT-NEXT: [[TMP14:%.*]] = bitcast i64 [[BF_SET9_I]] to double
4760 // DEFAULT-NEXT: ret double [[TMP14]]
4761 //
4762 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) double @test_nan(
4763 // FINITEONLY-SAME: ptr noundef readonly captures(none) [[TAG:%.*]]) local_unnamed_addr #[[ATTR3]] {
4764 // FINITEONLY-NEXT: [[ENTRY:.*:]]
4765 // FINITEONLY-NEXT: ret double poison
4766 //
4767 // APPROX-LABEL: define dso_local double @test_nan(
4768 // APPROX-SAME: ptr noundef readonly captures(none) [[TAG:%.*]]) local_unnamed_addr #[[ATTR2]] {
4769 // APPROX-NEXT: [[ENTRY:.*:]]
4770 // APPROX-NEXT: [[TMP0:%.*]] = load i8, ptr [[TAG]], align 1, !tbaa [[CHAR_TBAA8]]
4771 // APPROX-NEXT: [[CMP_I_I:%.*]] = icmp eq i8 [[TMP0]], 48
4772 // APPROX-NEXT: br i1 [[CMP_I_I]], label %[[IF_THEN_I_I:.*]], label %[[WHILE_COND_I14_I_I_PREHEADER:.*]]
4773 // APPROX: [[WHILE_COND_I14_I_I_PREHEADER]]:
4774 // APPROX-NEXT: [[TMP1:%.*]] = load i8, ptr [[TAG]], align 1, !tbaa [[CHAR_TBAA8]]
4775 // APPROX-NEXT: [[CMP_NOT_I17_I_I5:%.*]] = icmp eq i8 [[TMP1]], 0
4776 // APPROX-NEXT: br i1 [[CMP_NOT_I17_I_I5]], label %[[_ZL3NANPKC_EXIT:.*]], label %[[WHILE_BODY_I18_I_I:.*]]
4777 // APPROX: [[IF_THEN_I_I]]:
4778 // APPROX-NEXT: [[INCDEC_PTR_I_I:%.*]] = getelementptr inbounds nuw i8, ptr [[TAG]], i64 1
4779 // APPROX-NEXT: [[TMP2:%.*]] = load i8, ptr [[INCDEC_PTR_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4780 // APPROX-NEXT: [[CMP_NOT_I_I_I14:%.*]] = icmp eq i8 [[TMP2]], 0
4781 // APPROX-NEXT: switch i8 [[TMP2]], label %[[WHILE_COND_I_I_I_PREHEADER:.*]] [
4782 // APPROX-NEXT: i8 120, label %[[IF_THEN5_I_I:.*]]
4783 // APPROX-NEXT: i8 88, label %[[IF_THEN5_I_I]]
4784 // APPROX-NEXT: ]
4785 // APPROX: [[WHILE_COND_I_I_I_PREHEADER]]:
4786 // APPROX-NEXT: br i1 [[CMP_NOT_I_I_I14]], label %[[_ZL3NANPKC_EXIT]], label %[[WHILE_BODY_I_I_I:.*]]
4787 // APPROX: [[IF_THEN5_I_I]]:
4788 // APPROX-NEXT: br i1 [[CMP_NOT_I_I_I14]], label %[[_ZL3NANPKC_EXIT]], label %[[WHILE_BODY_I31_I_I:.*]]
4789 // APPROX: [[WHILE_BODY_I31_I_I]]:
4790 // APPROX-NEXT: [[TMP3:%.*]] = phi i8 [ [[TMP7:%.*]], %[[IF_END31_I_I_I:.*]] ], [ [[TMP2]], %[[IF_THEN5_I_I]] ]
4791 // APPROX-NEXT: [[__R_0_I29_I_I11:%.*]] = phi i64 [ [[ADD28_I_I_I:%.*]], %[[IF_END31_I_I_I]] ], [ 0, %[[IF_THEN5_I_I]] ]
4792 // APPROX-NEXT: [[__TAGP_ADDR_0_I28_I_I10:%.*]] = phi ptr [ [[INCDEC_PTR_I34_I_I:%.*]], %[[IF_END31_I_I_I]] ], [ [[INCDEC_PTR_I_I]], %[[IF_THEN5_I_I]] ]
4793 // APPROX-NEXT: [[TMP4:%.*]] = add i8 [[TMP3]], -48
4794 // APPROX-NEXT: [[OR_COND_I32_I_I:%.*]] = icmp ult i8 [[TMP4]], 10
4795 // APPROX-NEXT: br i1 [[OR_COND_I32_I_I]], label %[[IF_END31_I_I_I]], label %[[IF_ELSE_I_I_I:.*]]
4796 // APPROX: [[IF_ELSE_I_I_I]]:
4797 // APPROX-NEXT: [[TMP5:%.*]] = add i8 [[TMP3]], -97
4798 // APPROX-NEXT: [[OR_COND33_I_I_I:%.*]] = icmp ult i8 [[TMP5]], 6
4799 // APPROX-NEXT: br i1 [[OR_COND33_I_I_I]], label %[[IF_END31_I_I_I]], label %[[IF_ELSE17_I_I_I:.*]]
4800 // APPROX: [[IF_ELSE17_I_I_I]]:
4801 // APPROX-NEXT: [[TMP6:%.*]] = add i8 [[TMP3]], -65
4802 // APPROX-NEXT: [[OR_COND34_I_I_I:%.*]] = icmp ult i8 [[TMP6]], 6
4803 // APPROX-NEXT: br i1 [[OR_COND34_I_I_I]], label %[[IF_END31_I_I_I]], label %[[_ZL3NANPKC_EXIT]]
4804 // APPROX: [[IF_END31_I_I_I]]:
4805 // APPROX-NEXT: [[DOTSINK:%.*]] = phi i64 [ -87, %[[IF_ELSE_I_I_I]] ], [ -48, %[[WHILE_BODY_I31_I_I]] ], [ -55, %[[IF_ELSE17_I_I_I]] ]
4806 // APPROX-NEXT: [[MUL24_I_I_I:%.*]] = shl i64 [[__R_0_I29_I_I11]], 4
4807 // APPROX-NEXT: [[CONV25_I_I_I:%.*]] = zext nneg i8 [[TMP3]] to i64
4808 // APPROX-NEXT: [[ADD26_I_I_I:%.*]] = add i64 [[MUL24_I_I_I]], [[DOTSINK]]
4809 // APPROX-NEXT: [[ADD28_I_I_I]] = add i64 [[ADD26_I_I_I]], [[CONV25_I_I_I]]
4810 // APPROX-NEXT: [[INCDEC_PTR_I34_I_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I28_I_I10]], i64 1
4811 // APPROX-NEXT: [[TMP7]] = load i8, ptr [[INCDEC_PTR_I34_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4812 // APPROX-NEXT: [[CMP_NOT_I30_I_I:%.*]] = icmp eq i8 [[TMP7]], 0
4813 // APPROX-NEXT: br i1 [[CMP_NOT_I30_I_I]], label %[[_ZL3NANPKC_EXIT]], label %[[WHILE_BODY_I31_I_I]], !llvm.loop [[LOOP13]]
4814 // APPROX: [[WHILE_BODY_I_I_I]]:
4815 // APPROX-NEXT: [[TMP8:%.*]] = phi i8 [ [[TMP10:%.*]], %[[IF_THEN_I_I_I:.*]] ], [ [[TMP2]], %[[WHILE_COND_I_I_I_PREHEADER]] ]
4816 // APPROX-NEXT: [[__R_0_I_I_I16:%.*]] = phi i64 [ [[SUB_I_I_I:%.*]], %[[IF_THEN_I_I_I]] ], [ 0, %[[WHILE_COND_I_I_I_PREHEADER]] ]
4817 // APPROX-NEXT: [[__TAGP_ADDR_0_I_I_I15:%.*]] = phi ptr [ [[INCDEC_PTR_I_I_I:%.*]], %[[IF_THEN_I_I_I]] ], [ [[INCDEC_PTR_I_I]], %[[WHILE_COND_I_I_I_PREHEADER]] ]
4818 // APPROX-NEXT: [[TMP9:%.*]] = and i8 [[TMP8]], -8
4819 // APPROX-NEXT: [[OR_COND_I_I_I:%.*]] = icmp eq i8 [[TMP9]], 48
4820 // APPROX-NEXT: br i1 [[OR_COND_I_I_I]], label %[[IF_THEN_I_I_I]], label %[[_ZL3NANPKC_EXIT]]
4821 // APPROX: [[IF_THEN_I_I_I]]:
4822 // APPROX-NEXT: [[MUL_I_I_I:%.*]] = shl i64 [[__R_0_I_I_I16]], 3
4823 // APPROX-NEXT: [[CONV5_I_I_I:%.*]] = zext nneg i8 [[TMP8]] to i64
4824 // APPROX-NEXT: [[ADD_I_I_I:%.*]] = add i64 [[MUL_I_I_I]], -48
4825 // APPROX-NEXT: [[SUB_I_I_I]] = add i64 [[ADD_I_I_I]], [[CONV5_I_I_I]]
4826 // APPROX-NEXT: [[INCDEC_PTR_I_I_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I_I_I15]], i64 1
4827 // APPROX-NEXT: [[TMP10]] = load i8, ptr [[INCDEC_PTR_I_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4828 // APPROX-NEXT: [[CMP_NOT_I_I_I:%.*]] = icmp eq i8 [[TMP10]], 0
4829 // APPROX-NEXT: br i1 [[CMP_NOT_I_I_I]], label %[[_ZL3NANPKC_EXIT]], label %[[WHILE_BODY_I_I_I]], !llvm.loop [[LOOP9]]
4830 // APPROX: [[WHILE_BODY_I18_I_I]]:
4831 // APPROX-NEXT: [[TMP11:%.*]] = phi i8 [ [[TMP13:%.*]], %[[IF_THEN_I21_I_I:.*]] ], [ [[TMP1]], %[[WHILE_COND_I14_I_I_PREHEADER]] ]
4832 // APPROX-NEXT: [[__R_0_I16_I_I7:%.*]] = phi i64 [ [[SUB_I25_I_I:%.*]], %[[IF_THEN_I21_I_I]] ], [ 0, %[[WHILE_COND_I14_I_I_PREHEADER]] ]
4833 // APPROX-NEXT: [[__TAGP_ADDR_0_I15_I_I6:%.*]] = phi ptr [ [[INCDEC_PTR_I26_I_I:%.*]], %[[IF_THEN_I21_I_I]] ], [ [[TAG]], %[[WHILE_COND_I14_I_I_PREHEADER]] ]
4834 // APPROX-NEXT: [[TMP12:%.*]] = add i8 [[TMP11]], -48
4835 // APPROX-NEXT: [[OR_COND_I19_I_I:%.*]] = icmp ult i8 [[TMP12]], 10
4836 // APPROX-NEXT: br i1 [[OR_COND_I19_I_I]], label %[[IF_THEN_I21_I_I]], label %[[_ZL3NANPKC_EXIT]]
4837 // APPROX: [[IF_THEN_I21_I_I]]:
4838 // APPROX-NEXT: [[MUL_I22_I_I:%.*]] = mul i64 [[__R_0_I16_I_I7]], 10
4839 // APPROX-NEXT: [[CONV5_I23_I_I:%.*]] = zext nneg i8 [[TMP11]] to i64
4840 // APPROX-NEXT: [[ADD_I24_I_I:%.*]] = add i64 [[MUL_I22_I_I]], -48
4841 // APPROX-NEXT: [[SUB_I25_I_I]] = add i64 [[ADD_I24_I_I]], [[CONV5_I23_I_I]]
4842 // APPROX-NEXT: [[INCDEC_PTR_I26_I_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I15_I_I6]], i64 1
4843 // APPROX-NEXT: [[TMP13]] = load i8, ptr [[INCDEC_PTR_I26_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4844 // APPROX-NEXT: [[CMP_NOT_I17_I_I:%.*]] = icmp eq i8 [[TMP13]], 0
4845 // APPROX-NEXT: br i1 [[CMP_NOT_I17_I_I]], label %[[_ZL3NANPKC_EXIT]], label %[[WHILE_BODY_I18_I_I]], !llvm.loop [[LOOP12]]
4846 // APPROX: [[_ZL3NANPKC_EXIT]]:
4847 // APPROX-NEXT: [[RETVAL_0_I_I:%.*]] = phi i64 [ 0, %[[IF_THEN5_I_I]] ], [ 0, %[[WHILE_COND_I14_I_I_PREHEADER]] ], [ 0, %[[WHILE_COND_I_I_I_PREHEADER]] ], [ [[SUB_I_I_I]], %[[IF_THEN_I_I_I]] ], [ [[ADD28_I_I_I]], %[[IF_END31_I_I_I]] ], [ 0, %[[WHILE_BODY_I_I_I]] ], [ 0, %[[IF_ELSE17_I_I_I]] ], [ [[SUB_I25_I_I]], %[[IF_THEN_I21_I_I]] ], [ 0, %[[WHILE_BODY_I18_I_I]] ]
4848 // APPROX-NEXT: [[BF_VALUE_I:%.*]] = and i64 [[RETVAL_0_I_I]], 2251799813685247
4849 // APPROX-NEXT: [[BF_SET9_I:%.*]] = or disjoint i64 [[BF_VALUE_I]], 9221120237041090560
4850 // APPROX-NEXT: [[TMP14:%.*]] = bitcast i64 [[BF_SET9_I]] to double
4851 // APPROX-NEXT: ret double [[TMP14]]
4852 //
4853 // NCRDIV-LABEL: define dso_local double @test_nan(
4854 // NCRDIV-SAME: ptr noundef readonly captures(none) [[TAG:%.*]]) local_unnamed_addr #[[ATTR2]] {
4855 // NCRDIV-NEXT: [[ENTRY:.*:]]
4856 // NCRDIV-NEXT: [[TMP0:%.*]] = load i8, ptr [[TAG]], align 1, !tbaa [[CHAR_TBAA8]]
4857 // NCRDIV-NEXT: [[CMP_I_I:%.*]] = icmp eq i8 [[TMP0]], 48
4858 // NCRDIV-NEXT: br i1 [[CMP_I_I]], label %[[IF_THEN_I_I:.*]], label %[[WHILE_COND_I14_I_I_PREHEADER:.*]]
4859 // NCRDIV: [[WHILE_COND_I14_I_I_PREHEADER]]:
4860 // NCRDIV-NEXT: [[TMP1:%.*]] = load i8, ptr [[TAG]], align 1, !tbaa [[CHAR_TBAA8]]
4861 // NCRDIV-NEXT: [[CMP_NOT_I17_I_I5:%.*]] = icmp eq i8 [[TMP1]], 0
4862 // NCRDIV-NEXT: br i1 [[CMP_NOT_I17_I_I5]], label %[[_ZL3NANPKC_EXIT:.*]], label %[[WHILE_BODY_I18_I_I:.*]]
4863 // NCRDIV: [[IF_THEN_I_I]]:
4864 // NCRDIV-NEXT: [[INCDEC_PTR_I_I:%.*]] = getelementptr inbounds nuw i8, ptr [[TAG]], i64 1
4865 // NCRDIV-NEXT: [[TMP2:%.*]] = load i8, ptr [[INCDEC_PTR_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4866 // NCRDIV-NEXT: [[CMP_NOT_I_I_I14:%.*]] = icmp eq i8 [[TMP2]], 0
4867 // NCRDIV-NEXT: switch i8 [[TMP2]], label %[[WHILE_COND_I_I_I_PREHEADER:.*]] [
4868 // NCRDIV-NEXT: i8 120, label %[[IF_THEN5_I_I:.*]]
4869 // NCRDIV-NEXT: i8 88, label %[[IF_THEN5_I_I]]
4870 // NCRDIV-NEXT: ]
4871 // NCRDIV: [[WHILE_COND_I_I_I_PREHEADER]]:
4872 // NCRDIV-NEXT: br i1 [[CMP_NOT_I_I_I14]], label %[[_ZL3NANPKC_EXIT]], label %[[WHILE_BODY_I_I_I:.*]]
4873 // NCRDIV: [[IF_THEN5_I_I]]:
4874 // NCRDIV-NEXT: br i1 [[CMP_NOT_I_I_I14]], label %[[_ZL3NANPKC_EXIT]], label %[[WHILE_BODY_I31_I_I:.*]]
4875 // NCRDIV: [[WHILE_BODY_I31_I_I]]:
4876 // NCRDIV-NEXT: [[TMP3:%.*]] = phi i8 [ [[TMP7:%.*]], %[[IF_END31_I_I_I:.*]] ], [ [[TMP2]], %[[IF_THEN5_I_I]] ]
4877 // NCRDIV-NEXT: [[__R_0_I29_I_I11:%.*]] = phi i64 [ [[ADD28_I_I_I:%.*]], %[[IF_END31_I_I_I]] ], [ 0, %[[IF_THEN5_I_I]] ]
4878 // NCRDIV-NEXT: [[__TAGP_ADDR_0_I28_I_I10:%.*]] = phi ptr [ [[INCDEC_PTR_I34_I_I:%.*]], %[[IF_END31_I_I_I]] ], [ [[INCDEC_PTR_I_I]], %[[IF_THEN5_I_I]] ]
4879 // NCRDIV-NEXT: [[TMP4:%.*]] = add i8 [[TMP3]], -48
4880 // NCRDIV-NEXT: [[OR_COND_I32_I_I:%.*]] = icmp ult i8 [[TMP4]], 10
4881 // NCRDIV-NEXT: br i1 [[OR_COND_I32_I_I]], label %[[IF_END31_I_I_I]], label %[[IF_ELSE_I_I_I:.*]]
4882 // NCRDIV: [[IF_ELSE_I_I_I]]:
4883 // NCRDIV-NEXT: [[TMP5:%.*]] = add i8 [[TMP3]], -97
4884 // NCRDIV-NEXT: [[OR_COND33_I_I_I:%.*]] = icmp ult i8 [[TMP5]], 6
4885 // NCRDIV-NEXT: br i1 [[OR_COND33_I_I_I]], label %[[IF_END31_I_I_I]], label %[[IF_ELSE17_I_I_I:.*]]
4886 // NCRDIV: [[IF_ELSE17_I_I_I]]:
4887 // NCRDIV-NEXT: [[TMP6:%.*]] = add i8 [[TMP3]], -65
4888 // NCRDIV-NEXT: [[OR_COND34_I_I_I:%.*]] = icmp ult i8 [[TMP6]], 6
4889 // NCRDIV-NEXT: br i1 [[OR_COND34_I_I_I]], label %[[IF_END31_I_I_I]], label %[[_ZL3NANPKC_EXIT]]
4890 // NCRDIV: [[IF_END31_I_I_I]]:
4891 // NCRDIV-NEXT: [[DOTSINK:%.*]] = phi i64 [ -87, %[[IF_ELSE_I_I_I]] ], [ -48, %[[WHILE_BODY_I31_I_I]] ], [ -55, %[[IF_ELSE17_I_I_I]] ]
4892 // NCRDIV-NEXT: [[MUL24_I_I_I:%.*]] = shl i64 [[__R_0_I29_I_I11]], 4
4893 // NCRDIV-NEXT: [[CONV25_I_I_I:%.*]] = zext nneg i8 [[TMP3]] to i64
4894 // NCRDIV-NEXT: [[ADD26_I_I_I:%.*]] = add i64 [[MUL24_I_I_I]], [[DOTSINK]]
4895 // NCRDIV-NEXT: [[ADD28_I_I_I]] = add i64 [[ADD26_I_I_I]], [[CONV25_I_I_I]]
4896 // NCRDIV-NEXT: [[INCDEC_PTR_I34_I_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I28_I_I10]], i64 1
4897 // NCRDIV-NEXT: [[TMP7]] = load i8, ptr [[INCDEC_PTR_I34_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4898 // NCRDIV-NEXT: [[CMP_NOT_I30_I_I:%.*]] = icmp eq i8 [[TMP7]], 0
4899 // NCRDIV-NEXT: br i1 [[CMP_NOT_I30_I_I]], label %[[_ZL3NANPKC_EXIT]], label %[[WHILE_BODY_I31_I_I]], !llvm.loop [[LOOP13]]
4900 // NCRDIV: [[WHILE_BODY_I_I_I]]:
4901 // NCRDIV-NEXT: [[TMP8:%.*]] = phi i8 [ [[TMP10:%.*]], %[[IF_THEN_I_I_I:.*]] ], [ [[TMP2]], %[[WHILE_COND_I_I_I_PREHEADER]] ]
4902 // NCRDIV-NEXT: [[__R_0_I_I_I16:%.*]] = phi i64 [ [[SUB_I_I_I:%.*]], %[[IF_THEN_I_I_I]] ], [ 0, %[[WHILE_COND_I_I_I_PREHEADER]] ]
4903 // NCRDIV-NEXT: [[__TAGP_ADDR_0_I_I_I15:%.*]] = phi ptr [ [[INCDEC_PTR_I_I_I:%.*]], %[[IF_THEN_I_I_I]] ], [ [[INCDEC_PTR_I_I]], %[[WHILE_COND_I_I_I_PREHEADER]] ]
4904 // NCRDIV-NEXT: [[TMP9:%.*]] = and i8 [[TMP8]], -8
4905 // NCRDIV-NEXT: [[OR_COND_I_I_I:%.*]] = icmp eq i8 [[TMP9]], 48
4906 // NCRDIV-NEXT: br i1 [[OR_COND_I_I_I]], label %[[IF_THEN_I_I_I]], label %[[_ZL3NANPKC_EXIT]]
4907 // NCRDIV: [[IF_THEN_I_I_I]]:
4908 // NCRDIV-NEXT: [[MUL_I_I_I:%.*]] = shl i64 [[__R_0_I_I_I16]], 3
4909 // NCRDIV-NEXT: [[CONV5_I_I_I:%.*]] = zext nneg i8 [[TMP8]] to i64
4910 // NCRDIV-NEXT: [[ADD_I_I_I:%.*]] = add i64 [[MUL_I_I_I]], -48
4911 // NCRDIV-NEXT: [[SUB_I_I_I]] = add i64 [[ADD_I_I_I]], [[CONV5_I_I_I]]
4912 // NCRDIV-NEXT: [[INCDEC_PTR_I_I_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I_I_I15]], i64 1
4913 // NCRDIV-NEXT: [[TMP10]] = load i8, ptr [[INCDEC_PTR_I_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4914 // NCRDIV-NEXT: [[CMP_NOT_I_I_I:%.*]] = icmp eq i8 [[TMP10]], 0
4915 // NCRDIV-NEXT: br i1 [[CMP_NOT_I_I_I]], label %[[_ZL3NANPKC_EXIT]], label %[[WHILE_BODY_I_I_I]], !llvm.loop [[LOOP9]]
4916 // NCRDIV: [[WHILE_BODY_I18_I_I]]:
4917 // NCRDIV-NEXT: [[TMP11:%.*]] = phi i8 [ [[TMP13:%.*]], %[[IF_THEN_I21_I_I:.*]] ], [ [[TMP1]], %[[WHILE_COND_I14_I_I_PREHEADER]] ]
4918 // NCRDIV-NEXT: [[__R_0_I16_I_I7:%.*]] = phi i64 [ [[SUB_I25_I_I:%.*]], %[[IF_THEN_I21_I_I]] ], [ 0, %[[WHILE_COND_I14_I_I_PREHEADER]] ]
4919 // NCRDIV-NEXT: [[__TAGP_ADDR_0_I15_I_I6:%.*]] = phi ptr [ [[INCDEC_PTR_I26_I_I:%.*]], %[[IF_THEN_I21_I_I]] ], [ [[TAG]], %[[WHILE_COND_I14_I_I_PREHEADER]] ]
4920 // NCRDIV-NEXT: [[TMP12:%.*]] = add i8 [[TMP11]], -48
4921 // NCRDIV-NEXT: [[OR_COND_I19_I_I:%.*]] = icmp ult i8 [[TMP12]], 10
4922 // NCRDIV-NEXT: br i1 [[OR_COND_I19_I_I]], label %[[IF_THEN_I21_I_I]], label %[[_ZL3NANPKC_EXIT]]
4923 // NCRDIV: [[IF_THEN_I21_I_I]]:
4924 // NCRDIV-NEXT: [[MUL_I22_I_I:%.*]] = mul i64 [[__R_0_I16_I_I7]], 10
4925 // NCRDIV-NEXT: [[CONV5_I23_I_I:%.*]] = zext nneg i8 [[TMP11]] to i64
4926 // NCRDIV-NEXT: [[ADD_I24_I_I:%.*]] = add i64 [[MUL_I22_I_I]], -48
4927 // NCRDIV-NEXT: [[SUB_I25_I_I]] = add i64 [[ADD_I24_I_I]], [[CONV5_I23_I_I]]
4928 // NCRDIV-NEXT: [[INCDEC_PTR_I26_I_I]] = getelementptr inbounds nuw i8, ptr [[__TAGP_ADDR_0_I15_I_I6]], i64 1
4929 // NCRDIV-NEXT: [[TMP13]] = load i8, ptr [[INCDEC_PTR_I26_I_I]], align 1, !tbaa [[CHAR_TBAA8]]
4930 // NCRDIV-NEXT: [[CMP_NOT_I17_I_I:%.*]] = icmp eq i8 [[TMP13]], 0
4931 // NCRDIV-NEXT: br i1 [[CMP_NOT_I17_I_I]], label %[[_ZL3NANPKC_EXIT]], label %[[WHILE_BODY_I18_I_I]], !llvm.loop [[LOOP12]]
4932 // NCRDIV: [[_ZL3NANPKC_EXIT]]:
4933 // NCRDIV-NEXT: [[RETVAL_0_I_I:%.*]] = phi i64 [ 0, %[[IF_THEN5_I_I]] ], [ 0, %[[WHILE_COND_I14_I_I_PREHEADER]] ], [ 0, %[[WHILE_COND_I_I_I_PREHEADER]] ], [ [[SUB_I_I_I]], %[[IF_THEN_I_I_I]] ], [ [[ADD28_I_I_I]], %[[IF_END31_I_I_I]] ], [ 0, %[[WHILE_BODY_I_I_I]] ], [ 0, %[[IF_ELSE17_I_I_I]] ], [ [[SUB_I25_I_I]], %[[IF_THEN_I21_I_I]] ], [ 0, %[[WHILE_BODY_I18_I_I]] ]
4934 // NCRDIV-NEXT: [[BF_VALUE_I:%.*]] = and i64 [[RETVAL_0_I_I]], 2251799813685247
4935 // NCRDIV-NEXT: [[BF_SET9_I:%.*]] = or disjoint i64 [[BF_VALUE_I]], 9221120237041090560
4936 // NCRDIV-NEXT: [[TMP14:%.*]] = bitcast i64 [[BF_SET9_I]] to double
4937 // NCRDIV-NEXT: ret double [[TMP14]]
4938 //
4939 // AMDGCNSPIRV-LABEL: define spir_func double @test_nan(
4940 // AMDGCNSPIRV-SAME: ptr addrspace(4) noundef readonly captures(none) [[TAG:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR2]] {
4941 // AMDGCNSPIRV-NEXT: [[ENTRY:.*]]:
4942 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = load i8, ptr addrspace(4) [[TAG]], align 1, !tbaa [[CHAR_TBAA9]]
4943 // AMDGCNSPIRV-NEXT: [[CMP_I_I:%.*]] = icmp eq i8 [[TMP0]], 48
4944 // AMDGCNSPIRV-NEXT: br i1 [[CMP_I_I]], label %[[IF_THEN_I_I:.*]], label %[[WHILE_COND_I14_I_I:.*]]
4945 // AMDGCNSPIRV: [[IF_THEN_I_I]]:
4946 // AMDGCNSPIRV-NEXT: [[INCDEC_PTR_I_I:%.*]] = getelementptr inbounds nuw i8, ptr addrspace(4) [[TAG]], i64 1
4947 // AMDGCNSPIRV-NEXT: [[TMP1:%.*]] = load i8, ptr addrspace(4) [[INCDEC_PTR_I_I]], align 1, !tbaa [[CHAR_TBAA9]]
4948 // AMDGCNSPIRV-NEXT: switch i8 [[TMP1]], label %[[WHILE_COND_I_I_I:.*]] [
4949 // AMDGCNSPIRV-NEXT: i8 120, label %[[IF_THEN5_I_I:.*]]
4950 // AMDGCNSPIRV-NEXT: i8 88, label %[[IF_THEN5_I_I]]
4951 // AMDGCNSPIRV-NEXT: ]
4952 // AMDGCNSPIRV: [[IF_THEN5_I_I]]:
4953 // AMDGCNSPIRV-NEXT: [[TMP2:%.*]] = load i8, ptr addrspace(4) [[INCDEC_PTR_I_I]], align 1, !tbaa [[CHAR_TBAA9]]
4954 // AMDGCNSPIRV-NEXT: [[CMP_NOT_I31_I_I5:%.*]] = icmp eq i8 [[TMP2]], 0
4955 // AMDGCNSPIRV-NEXT: br i1 [[CMP_NOT_I31_I_I5]], label %[[_ZL3NANPKC_EXIT:.*]], label %[[WHILE_BODY_I32_I_I:.*]]
4956 // AMDGCNSPIRV: [[WHILE_BODY_I32_I_I]]:
4957 // AMDGCNSPIRV-NEXT: [[TMP3:%.*]] = phi i8 [ [[TMP7:%.*]], %[[IF_END31_I_I_I:.*]] ], [ [[TMP2]], %[[IF_THEN5_I_I]] ]
4958 // AMDGCNSPIRV-NEXT: [[__R_0_I30_I_I7:%.*]] = phi i64 [ [[ADD28_I_I_I:%.*]], %[[IF_END31_I_I_I]] ], [ 0, %[[IF_THEN5_I_I]] ]
4959 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_0_I29_I_I6:%.*]] = phi ptr addrspace(4) [ [[INCDEC_PTR_I36_I_I:%.*]], %[[IF_END31_I_I_I]] ], [ [[INCDEC_PTR_I_I]], %[[IF_THEN5_I_I]] ]
4960 // AMDGCNSPIRV-NEXT: [[TMP4:%.*]] = add i8 [[TMP3]], -48
4961 // AMDGCNSPIRV-NEXT: [[OR_COND_I33_I_I:%.*]] = icmp ult i8 [[TMP4]], 10
4962 // AMDGCNSPIRV-NEXT: br i1 [[OR_COND_I33_I_I]], label %[[IF_END31_I_I_I]], label %[[IF_ELSE_I_I_I:.*]]
4963 // AMDGCNSPIRV: [[IF_ELSE_I_I_I]]:
4964 // AMDGCNSPIRV-NEXT: [[TMP5:%.*]] = add i8 [[TMP3]], -97
4965 // AMDGCNSPIRV-NEXT: [[OR_COND33_I_I_I:%.*]] = icmp ult i8 [[TMP5]], 6
4966 // AMDGCNSPIRV-NEXT: br i1 [[OR_COND33_I_I_I]], label %[[IF_END31_I_I_I]], label %[[IF_ELSE17_I_I_I:.*]]
4967 // AMDGCNSPIRV: [[IF_ELSE17_I_I_I]]:
4968 // AMDGCNSPIRV-NEXT: [[TMP6:%.*]] = add i8 [[TMP3]], -65
4969 // AMDGCNSPIRV-NEXT: [[OR_COND34_I_I_I:%.*]] = icmp ult i8 [[TMP6]], 6
4970 // AMDGCNSPIRV-NEXT: br i1 [[OR_COND34_I_I_I]], label %[[IF_END31_I_I_I]], label %[[_ZL3NANPKC_EXIT]]
4971 // AMDGCNSPIRV: [[IF_END31_I_I_I]]:
4972 // AMDGCNSPIRV-NEXT: [[DOTSINK:%.*]] = phi i64 [ -87, %[[IF_ELSE_I_I_I]] ], [ -48, %[[WHILE_BODY_I32_I_I]] ], [ -55, %[[IF_ELSE17_I_I_I]] ]
4973 // AMDGCNSPIRV-NEXT: [[MUL24_I_I_I:%.*]] = shl i64 [[__R_0_I30_I_I7]], 4
4974 // AMDGCNSPIRV-NEXT: [[CONV25_I_I_I:%.*]] = zext nneg i8 [[TMP3]] to i64
4975 // AMDGCNSPIRV-NEXT: [[ADD26_I_I_I:%.*]] = add i64 [[MUL24_I_I_I]], [[DOTSINK]]
4976 // AMDGCNSPIRV-NEXT: [[ADD28_I_I_I]] = add i64 [[ADD26_I_I_I]], [[CONV25_I_I_I]]
4977 // AMDGCNSPIRV-NEXT: [[INCDEC_PTR_I36_I_I]] = getelementptr inbounds nuw i8, ptr addrspace(4) [[__TAGP_ADDR_0_I29_I_I6]], i64 1
4978 // AMDGCNSPIRV-NEXT: [[TMP7]] = load i8, ptr addrspace(4) [[INCDEC_PTR_I36_I_I]], align 1, !tbaa [[CHAR_TBAA9]]
4979 // AMDGCNSPIRV-NEXT: [[CMP_NOT_I31_I_I:%.*]] = icmp eq i8 [[TMP7]], 0
4980 // AMDGCNSPIRV-NEXT: br i1 [[CMP_NOT_I31_I_I]], label %[[_ZL3NANPKC_EXIT]], label %[[WHILE_BODY_I32_I_I]], !llvm.loop [[LOOP14]]
4981 // AMDGCNSPIRV: [[WHILE_COND_I_I_I]]:
4982 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_0_I_I_I:%.*]] = phi ptr addrspace(4) [ [[__TAGP_ADDR_1_I_I_I:%.*]], %[[WHILE_BODY_I_I_I:.*]] ], [ [[INCDEC_PTR_I_I]], %[[IF_THEN_I_I]] ]
4983 // AMDGCNSPIRV-NEXT: [[__R_0_I_I_I:%.*]] = phi i64 [ [[__R_1_I_I_I:%.*]], %[[WHILE_BODY_I_I_I]] ], [ 0, %[[IF_THEN_I_I]] ]
4984 // AMDGCNSPIRV-NEXT: [[TMP8:%.*]] = load i8, ptr addrspace(4) [[__TAGP_ADDR_0_I_I_I]], align 1, !tbaa [[CHAR_TBAA9]]
4985 // AMDGCNSPIRV-NEXT: [[CMP_NOT_I_I_I:%.*]] = icmp eq i8 [[TMP8]], 0
4986 // AMDGCNSPIRV-NEXT: br i1 [[CMP_NOT_I_I_I]], label %[[_ZL3NANPKC_EXIT]], label %[[WHILE_BODY_I_I_I]]
4987 // AMDGCNSPIRV: [[WHILE_BODY_I_I_I]]:
4988 // AMDGCNSPIRV-NEXT: [[TMP9:%.*]] = and i8 [[TMP8]], -8
4989 // AMDGCNSPIRV-NEXT: [[OR_COND_I_I_I:%.*]] = icmp eq i8 [[TMP9]], 48
4990 // AMDGCNSPIRV-NEXT: [[MUL_I_I_I:%.*]] = shl i64 [[__R_0_I_I_I]], 3
4991 // AMDGCNSPIRV-NEXT: [[CONV5_I_I_I:%.*]] = zext nneg i8 [[TMP8]] to i64
4992 // AMDGCNSPIRV-NEXT: [[ADD_I_I_I:%.*]] = add i64 [[MUL_I_I_I]], -48
4993 // AMDGCNSPIRV-NEXT: [[SUB_I_I_I:%.*]] = add i64 [[ADD_I_I_I]], [[CONV5_I_I_I]]
4994 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_1_I_I_I_IDX:%.*]] = zext i1 [[OR_COND_I_I_I]] to i64
4995 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_1_I_I_I]] = getelementptr inbounds nuw i8, ptr addrspace(4) [[__TAGP_ADDR_0_I_I_I]], i64 [[__TAGP_ADDR_1_I_I_I_IDX]]
4996 // AMDGCNSPIRV-NEXT: [[__R_1_I_I_I]] = select i1 [[OR_COND_I_I_I]], i64 [[SUB_I_I_I]], i64 [[__R_0_I_I_I]]
4997 // AMDGCNSPIRV-NEXT: br i1 [[OR_COND_I_I_I]], label %[[WHILE_COND_I_I_I]], label %[[_ZL3NANPKC_EXIT]], !llvm.loop [[LOOP10]]
4998 // AMDGCNSPIRV: [[WHILE_COND_I14_I_I]]:
4999 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_0_I15_I_I:%.*]] = phi ptr addrspace(4) [ [[__TAGP_ADDR_1_I25_I_I:%.*]], %[[WHILE_BODY_I18_I_I:.*]] ], [ [[TAG]], %[[ENTRY]] ]
5000 // AMDGCNSPIRV-NEXT: [[__R_0_I16_I_I:%.*]] = phi i64 [ [[__R_1_I26_I_I:%.*]], %[[WHILE_BODY_I18_I_I]] ], [ 0, %[[ENTRY]] ]
5001 // AMDGCNSPIRV-NEXT: [[TMP10:%.*]] = load i8, ptr addrspace(4) [[__TAGP_ADDR_0_I15_I_I]], align 1, !tbaa [[CHAR_TBAA9]]
5002 // AMDGCNSPIRV-NEXT: [[CMP_NOT_I17_I_I:%.*]] = icmp eq i8 [[TMP10]], 0
5003 // AMDGCNSPIRV-NEXT: br i1 [[CMP_NOT_I17_I_I]], label %[[_ZL3NANPKC_EXIT]], label %[[WHILE_BODY_I18_I_I]]
5004 // AMDGCNSPIRV: [[WHILE_BODY_I18_I_I]]:
5005 // AMDGCNSPIRV-NEXT: [[TMP11:%.*]] = add i8 [[TMP10]], -48
5006 // AMDGCNSPIRV-NEXT: [[OR_COND_I19_I_I:%.*]] = icmp ult i8 [[TMP11]], 10
5007 // AMDGCNSPIRV-NEXT: [[MUL_I20_I_I:%.*]] = mul i64 [[__R_0_I16_I_I]], 10
5008 // AMDGCNSPIRV-NEXT: [[CONV5_I21_I_I:%.*]] = zext nneg i8 [[TMP10]] to i64
5009 // AMDGCNSPIRV-NEXT: [[ADD_I22_I_I:%.*]] = add i64 [[MUL_I20_I_I]], -48
5010 // AMDGCNSPIRV-NEXT: [[SUB_I23_I_I:%.*]] = add i64 [[ADD_I22_I_I]], [[CONV5_I21_I_I]]
5011 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_1_I25_I_I_IDX:%.*]] = zext i1 [[OR_COND_I19_I_I]] to i64
5012 // AMDGCNSPIRV-NEXT: [[__TAGP_ADDR_1_I25_I_I]] = getelementptr inbounds nuw i8, ptr addrspace(4) [[__TAGP_ADDR_0_I15_I_I]], i64 [[__TAGP_ADDR_1_I25_I_I_IDX]]
5013 // AMDGCNSPIRV-NEXT: [[__R_1_I26_I_I]] = select i1 [[OR_COND_I19_I_I]], i64 [[SUB_I23_I_I]], i64 [[__R_0_I16_I_I]]
5014 // AMDGCNSPIRV-NEXT: br i1 [[OR_COND_I19_I_I]], label %[[WHILE_COND_I14_I_I]], label %[[_ZL3NANPKC_EXIT]], !llvm.loop [[LOOP13]]
5015 // AMDGCNSPIRV: [[_ZL3NANPKC_EXIT]]:
5016 // AMDGCNSPIRV-NEXT: [[RETVAL_0_I_I:%.*]] = phi i64 [ 0, %[[IF_THEN5_I_I]] ], [ [[ADD28_I_I_I]], %[[IF_END31_I_I_I]] ], [ [[__R_0_I_I_I]], %[[WHILE_COND_I_I_I]] ], [ 0, %[[WHILE_BODY_I_I_I]] ], [ 0, %[[IF_ELSE17_I_I_I]] ], [ 0, %[[WHILE_BODY_I18_I_I]] ], [ [[__R_0_I16_I_I]], %[[WHILE_COND_I14_I_I]] ]
5017 // AMDGCNSPIRV-NEXT: [[BF_VALUE_I:%.*]] = and i64 [[RETVAL_0_I_I]], 2251799813685247
5018 // AMDGCNSPIRV-NEXT: [[BF_SET9_I:%.*]] = or disjoint i64 [[BF_VALUE_I]], 9221120237041090560
5019 // AMDGCNSPIRV-NEXT: [[TMP12:%.*]] = bitcast i64 [[BF_SET9_I]] to double
5020 // AMDGCNSPIRV-NEXT: ret double [[TMP12]]
5021 //
5022 extern "C" __device__ double test_nan(const char *tag) {
5023 return nan(tag);
5024 }
5025
5026 // DEFAULT-LABEL: define dso_local noundef float @test_nanf_emptystr(
5027 // DEFAULT-SAME: ) local_unnamed_addr #[[ATTR3]] {
5028 // DEFAULT-NEXT: [[ENTRY:.*:]]
5029 // DEFAULT-NEXT: ret float 0x7FF8000000000000
5030 //
5031 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) float @test_nanf_emptystr(
5032 // FINITEONLY-SAME: ) local_unnamed_addr #[[ATTR3]] {
5033 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5034 // FINITEONLY-NEXT: ret float poison
5035 //
5036 // APPROX-LABEL: define dso_local noundef float @test_nanf_emptystr(
5037 // APPROX-SAME: ) local_unnamed_addr #[[ATTR3]] {
5038 // APPROX-NEXT: [[ENTRY:.*:]]
5039 // APPROX-NEXT: ret float 0x7FF8000000000000
5040 //
5041 // NCRDIV-LABEL: define dso_local noundef float @test_nanf_emptystr(
5042 // NCRDIV-SAME: ) local_unnamed_addr #[[ATTR3]] {
5043 // NCRDIV-NEXT: [[ENTRY:.*:]]
5044 // NCRDIV-NEXT: ret float 0x7FF8000000000000
5045 //
5046 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_nanf_emptystr(
5047 // AMDGCNSPIRV-SAME: ) local_unnamed_addr addrspace(4) #[[ATTR3]] {
5048 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5049 // AMDGCNSPIRV-NEXT: ret float 0x7FF8000000000000
5050 //
5051 extern "C" __device__ float test_nanf_emptystr() {
5052 return nanf("");
5053 }
5054
5055 // DEFAULT-LABEL: define dso_local noundef double @test_nan_emptystr(
5056 // DEFAULT-SAME: ) local_unnamed_addr #[[ATTR3]] {
5057 // DEFAULT-NEXT: [[ENTRY:.*:]]
5058 // DEFAULT-NEXT: ret double 0x7FF8000000000000
5059 //
5060 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) double @test_nan_emptystr(
5061 // FINITEONLY-SAME: ) local_unnamed_addr #[[ATTR3]] {
5062 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5063 // FINITEONLY-NEXT: ret double poison
5064 //
5065 // APPROX-LABEL: define dso_local noundef double @test_nan_emptystr(
5066 // APPROX-SAME: ) local_unnamed_addr #[[ATTR3]] {
5067 // APPROX-NEXT: [[ENTRY:.*:]]
5068 // APPROX-NEXT: ret double 0x7FF8000000000000
5069 //
5070 // NCRDIV-LABEL: define dso_local noundef double @test_nan_emptystr(
5071 // NCRDIV-SAME: ) local_unnamed_addr #[[ATTR3]] {
5072 // NCRDIV-NEXT: [[ENTRY:.*:]]
5073 // NCRDIV-NEXT: ret double 0x7FF8000000000000
5074 //
5075 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_nan_emptystr(
5076 // AMDGCNSPIRV-SAME: ) local_unnamed_addr addrspace(4) #[[ATTR3]] {
5077 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5078 // AMDGCNSPIRV-NEXT: ret double 0x7FF8000000000000
5079 //
5080 extern "C" __device__ double test_nan_emptystr() {
5081 return nan("");
5082 }
5083
5084 // DEFAULT-LABEL: define dso_local noundef float @test_nanf_fill(
5085 // DEFAULT-SAME: ) local_unnamed_addr #[[ATTR3]] {
5086 // DEFAULT-NEXT: [[ENTRY:.*:]]
5087 // DEFAULT-NEXT: ret float 0x7FF8000000000000
5088 //
5089 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) float @test_nanf_fill(
5090 // FINITEONLY-SAME: ) local_unnamed_addr #[[ATTR3]] {
5091 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5092 // FINITEONLY-NEXT: ret float poison
5093 //
5094 // APPROX-LABEL: define dso_local noundef float @test_nanf_fill(
5095 // APPROX-SAME: ) local_unnamed_addr #[[ATTR3]] {
5096 // APPROX-NEXT: [[ENTRY:.*:]]
5097 // APPROX-NEXT: ret float 0x7FF8000000000000
5098 //
5099 // NCRDIV-LABEL: define dso_local noundef float @test_nanf_fill(
5100 // NCRDIV-SAME: ) local_unnamed_addr #[[ATTR3]] {
5101 // NCRDIV-NEXT: [[ENTRY:.*:]]
5102 // NCRDIV-NEXT: ret float 0x7FF8000000000000
5103 //
5104 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_nanf_fill(
5105 // AMDGCNSPIRV-SAME: ) local_unnamed_addr addrspace(4) #[[ATTR3]] {
5106 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5107 // AMDGCNSPIRV-NEXT: ret float 0x7FF8000000000000
5108 //
5109 extern "C" __device__ float test_nanf_fill() {
5110 return nanf("0x456");
5111 }
5112
5113 // DEFAULT-LABEL: define dso_local noundef double @test_nan_fill(
5114 // DEFAULT-SAME: ) local_unnamed_addr #[[ATTR3]] {
5115 // DEFAULT-NEXT: [[ENTRY:.*:]]
5116 // DEFAULT-NEXT: ret double 0x7FF8000000000000
5117 //
5118 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) double @test_nan_fill(
5119 // FINITEONLY-SAME: ) local_unnamed_addr #[[ATTR3]] {
5120 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5121 // FINITEONLY-NEXT: ret double poison
5122 //
5123 // APPROX-LABEL: define dso_local noundef double @test_nan_fill(
5124 // APPROX-SAME: ) local_unnamed_addr #[[ATTR3]] {
5125 // APPROX-NEXT: [[ENTRY:.*:]]
5126 // APPROX-NEXT: ret double 0x7FF8000000000000
5127 //
5128 // NCRDIV-LABEL: define dso_local noundef double @test_nan_fill(
5129 // NCRDIV-SAME: ) local_unnamed_addr #[[ATTR3]] {
5130 // NCRDIV-NEXT: [[ENTRY:.*:]]
5131 // NCRDIV-NEXT: ret double 0x7FF8000000000000
5132 //
5133 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_nan_fill(
5134 // AMDGCNSPIRV-SAME: ) local_unnamed_addr addrspace(4) #[[ATTR3]] {
5135 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5136 // AMDGCNSPIRV-NEXT: ret double 0x7FF8000000000000
5137 //
5138 extern "C" __device__ double test_nan_fill() {
5139 return nan("0x123");
5140 }
5141
5142 // DEFAULT-LABEL: define dso_local noundef float @test_nearbyintf(
5143 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
5144 // DEFAULT-NEXT: [[ENTRY:.*:]]
5145 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.nearbyint.f32(float [[X]])
5146 // DEFAULT-NEXT: ret float [[TMP0]]
5147 //
5148 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_nearbyintf(
5149 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
5150 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5151 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.nearbyint.f32(float nofpclass(nan inf) [[X]])
5152 // FINITEONLY-NEXT: ret float [[TMP0]]
5153 //
5154 // APPROX-LABEL: define dso_local noundef float @test_nearbyintf(
5155 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
5156 // APPROX-NEXT: [[ENTRY:.*:]]
5157 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.nearbyint.f32(float [[X]])
5158 // APPROX-NEXT: ret float [[TMP0]]
5159 //
5160 // NCRDIV-LABEL: define dso_local noundef float @test_nearbyintf(
5161 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
5162 // NCRDIV-NEXT: [[ENTRY:.*:]]
5163 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.nearbyint.f32(float [[X]])
5164 // NCRDIV-NEXT: ret float [[TMP0]]
5165 //
5166 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_nearbyintf(
5167 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
5168 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5169 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.nearbyint.f32(float [[X]])
5170 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
5171 //
5172 extern "C" __device__ float test_nearbyintf(float x) {
5173 return nearbyintf(x);
5174 }
5175
5176 // DEFAULT-LABEL: define dso_local noundef double @test_nearbyint(
5177 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
5178 // DEFAULT-NEXT: [[ENTRY:.*:]]
5179 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.nearbyint.f64(double [[X]])
5180 // DEFAULT-NEXT: ret double [[TMP0]]
5181 //
5182 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_nearbyint(
5183 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
5184 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5185 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef double @llvm.nearbyint.f64(double nofpclass(nan inf) [[X]])
5186 // FINITEONLY-NEXT: ret double [[TMP0]]
5187 //
5188 // APPROX-LABEL: define dso_local noundef double @test_nearbyint(
5189 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
5190 // APPROX-NEXT: [[ENTRY:.*:]]
5191 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.nearbyint.f64(double [[X]])
5192 // APPROX-NEXT: ret double [[TMP0]]
5193 //
5194 // NCRDIV-LABEL: define dso_local noundef double @test_nearbyint(
5195 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
5196 // NCRDIV-NEXT: [[ENTRY:.*:]]
5197 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.nearbyint.f64(double [[X]])
5198 // NCRDIV-NEXT: ret double [[TMP0]]
5199 //
5200 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_nearbyint(
5201 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
5202 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5203 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) double @llvm.nearbyint.f64(double [[X]])
5204 // AMDGCNSPIRV-NEXT: ret double [[TMP0]]
5205 //
5206 extern "C" __device__ double test_nearbyint(double x) {
5207 return nearbyint(x);
5208 }
5209
5210 // DEFAULT-LABEL: define dso_local noundef float @test_nextafterf(
5211 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
5212 // DEFAULT-NEXT: [[ENTRY:.*:]]
5213 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_nextafter_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
5214 // DEFAULT-NEXT: ret float [[CALL_I]]
5215 //
5216 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_nextafterf(
5217 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
5218 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5219 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_nextafter_f32(float noundef nofpclass(nan inf) [[X]], float noundef nofpclass(nan inf) [[Y]]) #[[ATTR13]]
5220 // FINITEONLY-NEXT: ret float [[CALL_I]]
5221 //
5222 // APPROX-LABEL: define dso_local noundef float @test_nextafterf(
5223 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
5224 // APPROX-NEXT: [[ENTRY:.*:]]
5225 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_nextafter_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
5226 // APPROX-NEXT: ret float [[CALL_I]]
5227 //
5228 // NCRDIV-LABEL: define dso_local noundef float @test_nextafterf(
5229 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
5230 // NCRDIV-NEXT: [[ENTRY:.*:]]
5231 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_nextafter_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
5232 // NCRDIV-NEXT: ret float [[CALL_I]]
5233 //
5234 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_nextafterf(
5235 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
5236 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5237 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_nextafter_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
5238 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
5239 //
5240 extern "C" __device__ float test_nextafterf(float x, float y) {
5241 return nextafterf(x, y);
5242 }
5243
5244 // DEFAULT-LABEL: define dso_local noundef double @test_nextafter(
5245 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
5246 // DEFAULT-NEXT: [[ENTRY:.*:]]
5247 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_nextafter_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
5248 // DEFAULT-NEXT: ret double [[CALL_I]]
5249 //
5250 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_nextafter(
5251 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
5252 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5253 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_nextafter_f64(double noundef nofpclass(nan inf) [[X]], double noundef nofpclass(nan inf) [[Y]]) #[[ATTR13]]
5254 // FINITEONLY-NEXT: ret double [[CALL_I]]
5255 //
5256 // APPROX-LABEL: define dso_local noundef double @test_nextafter(
5257 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
5258 // APPROX-NEXT: [[ENTRY:.*:]]
5259 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_nextafter_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
5260 // APPROX-NEXT: ret double [[CALL_I]]
5261 //
5262 // NCRDIV-LABEL: define dso_local noundef double @test_nextafter(
5263 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
5264 // NCRDIV-NEXT: [[ENTRY:.*:]]
5265 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_nextafter_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
5266 // NCRDIV-NEXT: ret double [[CALL_I]]
5267 //
5268 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_nextafter(
5269 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
5270 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5271 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_nextafter_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
5272 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
5273 //
5274 extern "C" __device__ double test_nextafter(double x, double y) {
5275 return nextafter(x, y);
5276 }
5277
5278 // DEFAULT-LABEL: define dso_local noundef float @test_norm3df(
5279 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR4]] {
5280 // DEFAULT-NEXT: [[ENTRY:.*:]]
5281 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_len3_f32(float noundef [[X]], float noundef [[Y]], float noundef [[Z]]) #[[ATTR13]]
5282 // DEFAULT-NEXT: ret float [[CALL_I]]
5283 //
5284 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_norm3df(
5285 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]], float noundef nofpclass(nan inf) [[Z:%.*]]) local_unnamed_addr #[[ATTR4]] {
5286 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5287 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_len3_f32(float noundef nofpclass(nan inf) [[X]], float noundef nofpclass(nan inf) [[Y]], float noundef nofpclass(nan inf) [[Z]]) #[[ATTR13]]
5288 // FINITEONLY-NEXT: ret float [[CALL_I]]
5289 //
5290 // APPROX-LABEL: define dso_local noundef float @test_norm3df(
5291 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR4]] {
5292 // APPROX-NEXT: [[ENTRY:.*:]]
5293 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_len3_f32(float noundef [[X]], float noundef [[Y]], float noundef [[Z]]) #[[ATTR13]]
5294 // APPROX-NEXT: ret float [[CALL_I]]
5295 //
5296 // NCRDIV-LABEL: define dso_local noundef float @test_norm3df(
5297 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR4]] {
5298 // NCRDIV-NEXT: [[ENTRY:.*:]]
5299 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_len3_f32(float noundef [[X]], float noundef [[Y]], float noundef [[Z]]) #[[ATTR13]]
5300 // NCRDIV-NEXT: ret float [[CALL_I]]
5301 //
5302 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_norm3df(
5303 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
5304 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5305 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_len3_f32(float noundef [[X]], float noundef [[Y]], float noundef [[Z]]) #[[ATTR13]]
5306 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
5307 //
5308 extern "C" __device__ float test_norm3df(float x, float y, float z) {
5309 return norm3df(x, y, z);
5310 }
5311
5312 // DEFAULT-LABEL: define dso_local noundef double @test_norm3d(
5313 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR4]] {
5314 // DEFAULT-NEXT: [[ENTRY:.*:]]
5315 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_len3_f64(double noundef [[X]], double noundef [[Y]], double noundef [[Z]]) #[[ATTR13]]
5316 // DEFAULT-NEXT: ret double [[CALL_I]]
5317 //
5318 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_norm3d(
5319 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]], double noundef nofpclass(nan inf) [[Z:%.*]]) local_unnamed_addr #[[ATTR4]] {
5320 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5321 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_len3_f64(double noundef nofpclass(nan inf) [[X]], double noundef nofpclass(nan inf) [[Y]], double noundef nofpclass(nan inf) [[Z]]) #[[ATTR13]]
5322 // FINITEONLY-NEXT: ret double [[CALL_I]]
5323 //
5324 // APPROX-LABEL: define dso_local noundef double @test_norm3d(
5325 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR4]] {
5326 // APPROX-NEXT: [[ENTRY:.*:]]
5327 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_len3_f64(double noundef [[X]], double noundef [[Y]], double noundef [[Z]]) #[[ATTR13]]
5328 // APPROX-NEXT: ret double [[CALL_I]]
5329 //
5330 // NCRDIV-LABEL: define dso_local noundef double @test_norm3d(
5331 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR4]] {
5332 // NCRDIV-NEXT: [[ENTRY:.*:]]
5333 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_len3_f64(double noundef [[X]], double noundef [[Y]], double noundef [[Z]]) #[[ATTR13]]
5334 // NCRDIV-NEXT: ret double [[CALL_I]]
5335 //
5336 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_norm3d(
5337 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
5338 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5339 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_len3_f64(double noundef [[X]], double noundef [[Y]], double noundef [[Z]]) #[[ATTR13]]
5340 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
5341 //
5342 extern "C" __device__ double test_norm3d(double x, double y, double z) {
5343 return norm3d(x, y, z);
5344 }
5345
5346 // DEFAULT-LABEL: define dso_local noundef float @test_norm4df(
5347 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]], float noundef [[W:%.*]]) local_unnamed_addr #[[ATTR4]] {
5348 // DEFAULT-NEXT: [[ENTRY:.*:]]
5349 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_len4_f32(float noundef [[X]], float noundef [[Y]], float noundef [[Z]], float noundef [[W]]) #[[ATTR13]]
5350 // DEFAULT-NEXT: ret float [[CALL_I]]
5351 //
5352 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_norm4df(
5353 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]], float noundef nofpclass(nan inf) [[Z:%.*]], float noundef nofpclass(nan inf) [[W:%.*]]) local_unnamed_addr #[[ATTR4]] {
5354 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5355 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_len4_f32(float noundef nofpclass(nan inf) [[X]], float noundef nofpclass(nan inf) [[Y]], float noundef nofpclass(nan inf) [[Z]], float noundef nofpclass(nan inf) [[W]]) #[[ATTR13]]
5356 // FINITEONLY-NEXT: ret float [[CALL_I]]
5357 //
5358 // APPROX-LABEL: define dso_local noundef float @test_norm4df(
5359 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]], float noundef [[W:%.*]]) local_unnamed_addr #[[ATTR4]] {
5360 // APPROX-NEXT: [[ENTRY:.*:]]
5361 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_len4_f32(float noundef [[X]], float noundef [[Y]], float noundef [[Z]], float noundef [[W]]) #[[ATTR13]]
5362 // APPROX-NEXT: ret float [[CALL_I]]
5363 //
5364 // NCRDIV-LABEL: define dso_local noundef float @test_norm4df(
5365 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]], float noundef [[W:%.*]]) local_unnamed_addr #[[ATTR4]] {
5366 // NCRDIV-NEXT: [[ENTRY:.*:]]
5367 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_len4_f32(float noundef [[X]], float noundef [[Y]], float noundef [[Z]], float noundef [[W]]) #[[ATTR13]]
5368 // NCRDIV-NEXT: ret float [[CALL_I]]
5369 //
5370 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_norm4df(
5371 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]], float noundef [[W:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
5372 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5373 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_len4_f32(float noundef [[X]], float noundef [[Y]], float noundef [[Z]], float noundef [[W]]) #[[ATTR13]]
5374 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
5375 //
5376 extern "C" __device__ float test_norm4df(float x, float y, float z, float w) {
5377 return norm4df(x, y, z, w);
5378 }
5379
5380 // DEFAULT-LABEL: define dso_local noundef double @test_norm4d(
5381 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]], double noundef [[W:%.*]]) local_unnamed_addr #[[ATTR4]] {
5382 // DEFAULT-NEXT: [[ENTRY:.*:]]
5383 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_len4_f64(double noundef [[X]], double noundef [[Y]], double noundef [[Z]], double noundef [[W]]) #[[ATTR13]]
5384 // DEFAULT-NEXT: ret double [[CALL_I]]
5385 //
5386 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_norm4d(
5387 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]], double noundef nofpclass(nan inf) [[Z:%.*]], double noundef nofpclass(nan inf) [[W:%.*]]) local_unnamed_addr #[[ATTR4]] {
5388 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5389 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_len4_f64(double noundef nofpclass(nan inf) [[X]], double noundef nofpclass(nan inf) [[Y]], double noundef nofpclass(nan inf) [[Z]], double noundef nofpclass(nan inf) [[W]]) #[[ATTR13]]
5390 // FINITEONLY-NEXT: ret double [[CALL_I]]
5391 //
5392 // APPROX-LABEL: define dso_local noundef double @test_norm4d(
5393 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]], double noundef [[W:%.*]]) local_unnamed_addr #[[ATTR4]] {
5394 // APPROX-NEXT: [[ENTRY:.*:]]
5395 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_len4_f64(double noundef [[X]], double noundef [[Y]], double noundef [[Z]], double noundef [[W]]) #[[ATTR13]]
5396 // APPROX-NEXT: ret double [[CALL_I]]
5397 //
5398 // NCRDIV-LABEL: define dso_local noundef double @test_norm4d(
5399 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]], double noundef [[W:%.*]]) local_unnamed_addr #[[ATTR4]] {
5400 // NCRDIV-NEXT: [[ENTRY:.*:]]
5401 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_len4_f64(double noundef [[X]], double noundef [[Y]], double noundef [[Z]], double noundef [[W]]) #[[ATTR13]]
5402 // NCRDIV-NEXT: ret double [[CALL_I]]
5403 //
5404 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_norm4d(
5405 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]], double noundef [[W:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
5406 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5407 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_len4_f64(double noundef [[X]], double noundef [[Y]], double noundef [[Z]], double noundef [[W]]) #[[ATTR13]]
5408 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
5409 //
5410 extern "C" __device__ double test_norm4d(double x, double y, double z, double w) {
5411 return norm4d(x, y, z, w);
5412 }
5413
5414 // DEFAULT-LABEL: define dso_local noundef float @test_normcdff(
5415 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5416 // DEFAULT-NEXT: [[ENTRY:.*:]]
5417 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_ncdf_f32(float noundef [[X]]) #[[ATTR14]]
5418 // DEFAULT-NEXT: ret float [[CALL_I]]
5419 //
5420 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_normcdff(
5421 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5422 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5423 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_ncdf_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
5424 // FINITEONLY-NEXT: ret float [[CALL_I]]
5425 //
5426 // APPROX-LABEL: define dso_local noundef float @test_normcdff(
5427 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5428 // APPROX-NEXT: [[ENTRY:.*:]]
5429 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_ncdf_f32(float noundef [[X]]) #[[ATTR14]]
5430 // APPROX-NEXT: ret float [[CALL_I]]
5431 //
5432 // NCRDIV-LABEL: define dso_local noundef float @test_normcdff(
5433 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5434 // NCRDIV-NEXT: [[ENTRY:.*:]]
5435 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_ncdf_f32(float noundef [[X]]) #[[ATTR14]]
5436 // NCRDIV-NEXT: ret float [[CALL_I]]
5437 //
5438 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_normcdff(
5439 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
5440 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5441 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_ncdf_f32(float noundef [[X]]) #[[ATTR14]]
5442 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
5443 //
5444 extern "C" __device__ float test_normcdff(float x) {
5445 return normcdff(x);
5446 }
5447
5448 // DEFAULT-LABEL: define dso_local noundef double @test_normcdf(
5449 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5450 // DEFAULT-NEXT: [[ENTRY:.*:]]
5451 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_ncdf_f64(double noundef [[X]]) #[[ATTR14]]
5452 // DEFAULT-NEXT: ret double [[CALL_I]]
5453 //
5454 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_normcdf(
5455 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5456 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5457 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_ncdf_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
5458 // FINITEONLY-NEXT: ret double [[CALL_I]]
5459 //
5460 // APPROX-LABEL: define dso_local noundef double @test_normcdf(
5461 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5462 // APPROX-NEXT: [[ENTRY:.*:]]
5463 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_ncdf_f64(double noundef [[X]]) #[[ATTR14]]
5464 // APPROX-NEXT: ret double [[CALL_I]]
5465 //
5466 // NCRDIV-LABEL: define dso_local noundef double @test_normcdf(
5467 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5468 // NCRDIV-NEXT: [[ENTRY:.*:]]
5469 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_ncdf_f64(double noundef [[X]]) #[[ATTR14]]
5470 // NCRDIV-NEXT: ret double [[CALL_I]]
5471 //
5472 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_normcdf(
5473 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
5474 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5475 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_ncdf_f64(double noundef [[X]]) #[[ATTR14]]
5476 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
5477 //
5478 extern "C" __device__ double test_normcdf(double x) {
5479 return normcdf(x);
5480 }
5481
5482 // DEFAULT-LABEL: define dso_local noundef float @test_normcdfinvf(
5483 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5484 // DEFAULT-NEXT: [[ENTRY:.*:]]
5485 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_ncdfinv_f32(float noundef [[X]]) #[[ATTR14]]
5486 // DEFAULT-NEXT: ret float [[CALL_I]]
5487 //
5488 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_normcdfinvf(
5489 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5490 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5491 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_ncdfinv_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
5492 // FINITEONLY-NEXT: ret float [[CALL_I]]
5493 //
5494 // APPROX-LABEL: define dso_local noundef float @test_normcdfinvf(
5495 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5496 // APPROX-NEXT: [[ENTRY:.*:]]
5497 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_ncdfinv_f32(float noundef [[X]]) #[[ATTR14]]
5498 // APPROX-NEXT: ret float [[CALL_I]]
5499 //
5500 // NCRDIV-LABEL: define dso_local noundef float @test_normcdfinvf(
5501 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5502 // NCRDIV-NEXT: [[ENTRY:.*:]]
5503 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_ncdfinv_f32(float noundef [[X]]) #[[ATTR14]]
5504 // NCRDIV-NEXT: ret float [[CALL_I]]
5505 //
5506 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_normcdfinvf(
5507 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
5508 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5509 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_ncdfinv_f32(float noundef [[X]]) #[[ATTR14]]
5510 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
5511 //
5512 extern "C" __device__ float test_normcdfinvf(float x) {
5513 return normcdfinvf(x);
5514 }
5515
5516 // DEFAULT-LABEL: define dso_local noundef double @test_normcdfinv(
5517 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5518 // DEFAULT-NEXT: [[ENTRY:.*:]]
5519 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_ncdfinv_f64(double noundef [[X]]) #[[ATTR14]]
5520 // DEFAULT-NEXT: ret double [[CALL_I]]
5521 //
5522 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_normcdfinv(
5523 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5524 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5525 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_ncdfinv_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
5526 // FINITEONLY-NEXT: ret double [[CALL_I]]
5527 //
5528 // APPROX-LABEL: define dso_local noundef double @test_normcdfinv(
5529 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5530 // APPROX-NEXT: [[ENTRY:.*:]]
5531 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_ncdfinv_f64(double noundef [[X]]) #[[ATTR14]]
5532 // APPROX-NEXT: ret double [[CALL_I]]
5533 //
5534 // NCRDIV-LABEL: define dso_local noundef double @test_normcdfinv(
5535 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5536 // NCRDIV-NEXT: [[ENTRY:.*:]]
5537 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_ncdfinv_f64(double noundef [[X]]) #[[ATTR14]]
5538 // NCRDIV-NEXT: ret double [[CALL_I]]
5539 //
5540 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_normcdfinv(
5541 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
5542 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5543 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_ncdfinv_f64(double noundef [[X]]) #[[ATTR14]]
5544 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
5545 //
5546 extern "C" __device__ double test_normcdfinv(double x) {
5547 return normcdfinv(x);
5548 }
5549
5550 // DEFAULT-LABEL: define dso_local float @test_normf(
5551 // DEFAULT-SAME: i32 noundef [[X:%.*]], ptr noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR2]] {
5552 // DEFAULT-NEXT: [[ENTRY:.*]]:
5553 // DEFAULT-NEXT: [[TOBOOL_NOT_I1:%.*]] = icmp eq i32 [[X]], 0
5554 // DEFAULT-NEXT: br i1 [[TOBOOL_NOT_I1]], label %[[_ZL5NORMFIPKF_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
5555 // DEFAULT: [[WHILE_BODY_I]]:
5556 // DEFAULT-NEXT: [[__R_0_I4:%.*]] = phi float [ [[ADD_I:%.*]], %[[WHILE_BODY_I]] ], [ 0.000000e+00, %[[ENTRY]] ]
5557 // DEFAULT-NEXT: [[__A_ADDR_0_I3:%.*]] = phi ptr [ [[INCDEC_PTR_I:%.*]], %[[WHILE_BODY_I]] ], [ [[Y]], %[[ENTRY]] ]
5558 // DEFAULT-NEXT: [[__DIM_ADDR_0_I2:%.*]] = phi i32 [ [[DEC_I:%.*]], %[[WHILE_BODY_I]] ], [ [[X]], %[[ENTRY]] ]
5559 // DEFAULT-NEXT: [[DEC_I]] = add nsw i32 [[__DIM_ADDR_0_I2]], -1
5560 // DEFAULT-NEXT: [[TMP0:%.*]] = load float, ptr [[__A_ADDR_0_I3]], align 4, !tbaa [[FLOAT_TBAA16]]
5561 // DEFAULT-NEXT: [[MUL_I:%.*]] = fmul contract float [[TMP0]], [[TMP0]]
5562 // DEFAULT-NEXT: [[ADD_I]] = fadd contract float [[__R_0_I4]], [[MUL_I]]
5563 // DEFAULT-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr [[__A_ADDR_0_I3]], i64 4
5564 // DEFAULT-NEXT: [[TOBOOL_NOT_I:%.*]] = icmp eq i32 [[DEC_I]], 0
5565 // DEFAULT-NEXT: br i1 [[TOBOOL_NOT_I]], label %[[_ZL5NORMFIPKF_EXIT_LOOPEXIT:.*]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP20:![0-9]+]]
5566 // DEFAULT: [[_ZL5NORMFIPKF_EXIT_LOOPEXIT]]:
5567 // DEFAULT-NEXT: [[TMP1:%.*]] = tail call contract float @llvm.sqrt.f32(float [[ADD_I]])
5568 // DEFAULT-NEXT: br label %[[_ZL5NORMFIPKF_EXIT]]
5569 // DEFAULT: [[_ZL5NORMFIPKF_EXIT]]:
5570 // DEFAULT-NEXT: [[__R_0_I_LCSSA:%.*]] = phi float [ 0.000000e+00, %[[ENTRY]] ], [ [[TMP1]], %[[_ZL5NORMFIPKF_EXIT_LOOPEXIT]] ]
5571 // DEFAULT-NEXT: ret float [[__R_0_I_LCSSA]]
5572 //
5573 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) float @test_normf(
5574 // FINITEONLY-SAME: i32 noundef [[X:%.*]], ptr noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR2]] {
5575 // FINITEONLY-NEXT: [[ENTRY:.*]]:
5576 // FINITEONLY-NEXT: [[TOBOOL_NOT_I1:%.*]] = icmp eq i32 [[X]], 0
5577 // FINITEONLY-NEXT: br i1 [[TOBOOL_NOT_I1]], label %[[_ZL5NORMFIPKF_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
5578 // FINITEONLY: [[WHILE_BODY_I]]:
5579 // FINITEONLY-NEXT: [[__R_0_I4:%.*]] = phi float [ [[ADD_I:%.*]], %[[WHILE_BODY_I]] ], [ 0.000000e+00, %[[ENTRY]] ]
5580 // FINITEONLY-NEXT: [[__A_ADDR_0_I3:%.*]] = phi ptr [ [[INCDEC_PTR_I:%.*]], %[[WHILE_BODY_I]] ], [ [[Y]], %[[ENTRY]] ]
5581 // FINITEONLY-NEXT: [[__DIM_ADDR_0_I2:%.*]] = phi i32 [ [[DEC_I:%.*]], %[[WHILE_BODY_I]] ], [ [[X]], %[[ENTRY]] ]
5582 // FINITEONLY-NEXT: [[DEC_I]] = add nsw i32 [[__DIM_ADDR_0_I2]], -1
5583 // FINITEONLY-NEXT: [[TMP0:%.*]] = load float, ptr [[__A_ADDR_0_I3]], align 4, !tbaa [[FLOAT_TBAA16]]
5584 // FINITEONLY-NEXT: [[MUL_I:%.*]] = fmul nnan ninf contract float [[TMP0]], [[TMP0]]
5585 // FINITEONLY-NEXT: [[ADD_I]] = fadd nnan ninf contract float [[__R_0_I4]], [[MUL_I]]
5586 // FINITEONLY-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr [[__A_ADDR_0_I3]], i64 4
5587 // FINITEONLY-NEXT: [[TOBOOL_NOT_I:%.*]] = icmp eq i32 [[DEC_I]], 0
5588 // FINITEONLY-NEXT: br i1 [[TOBOOL_NOT_I]], label %[[_ZL5NORMFIPKF_EXIT_LOOPEXIT:.*]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP20:![0-9]+]]
5589 // FINITEONLY: [[_ZL5NORMFIPKF_EXIT_LOOPEXIT]]:
5590 // FINITEONLY-NEXT: [[TMP1:%.*]] = tail call nnan ninf contract float @llvm.sqrt.f32(float [[ADD_I]])
5591 // FINITEONLY-NEXT: br label %[[_ZL5NORMFIPKF_EXIT]]
5592 // FINITEONLY: [[_ZL5NORMFIPKF_EXIT]]:
5593 // FINITEONLY-NEXT: [[__R_0_I_LCSSA:%.*]] = phi float [ 0.000000e+00, %[[ENTRY]] ], [ [[TMP1]], %[[_ZL5NORMFIPKF_EXIT_LOOPEXIT]] ]
5594 // FINITEONLY-NEXT: ret float [[__R_0_I_LCSSA]]
5595 //
5596 // APPROX-LABEL: define dso_local float @test_normf(
5597 // APPROX-SAME: i32 noundef [[X:%.*]], ptr noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR2]] {
5598 // APPROX-NEXT: [[ENTRY:.*]]:
5599 // APPROX-NEXT: [[TOBOOL_NOT_I1:%.*]] = icmp eq i32 [[X]], 0
5600 // APPROX-NEXT: br i1 [[TOBOOL_NOT_I1]], label %[[_ZL5NORMFIPKF_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
5601 // APPROX: [[WHILE_BODY_I]]:
5602 // APPROX-NEXT: [[__R_0_I4:%.*]] = phi float [ [[ADD_I:%.*]], %[[WHILE_BODY_I]] ], [ 0.000000e+00, %[[ENTRY]] ]
5603 // APPROX-NEXT: [[__A_ADDR_0_I3:%.*]] = phi ptr [ [[INCDEC_PTR_I:%.*]], %[[WHILE_BODY_I]] ], [ [[Y]], %[[ENTRY]] ]
5604 // APPROX-NEXT: [[__DIM_ADDR_0_I2:%.*]] = phi i32 [ [[DEC_I:%.*]], %[[WHILE_BODY_I]] ], [ [[X]], %[[ENTRY]] ]
5605 // APPROX-NEXT: [[DEC_I]] = add nsw i32 [[__DIM_ADDR_0_I2]], -1
5606 // APPROX-NEXT: [[TMP0:%.*]] = load float, ptr [[__A_ADDR_0_I3]], align 4, !tbaa [[FLOAT_TBAA16]]
5607 // APPROX-NEXT: [[MUL_I:%.*]] = fmul contract float [[TMP0]], [[TMP0]]
5608 // APPROX-NEXT: [[ADD_I]] = fadd contract float [[__R_0_I4]], [[MUL_I]]
5609 // APPROX-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr [[__A_ADDR_0_I3]], i64 4
5610 // APPROX-NEXT: [[TOBOOL_NOT_I:%.*]] = icmp eq i32 [[DEC_I]], 0
5611 // APPROX-NEXT: br i1 [[TOBOOL_NOT_I]], label %[[_ZL5NORMFIPKF_EXIT_LOOPEXIT:.*]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP20:![0-9]+]]
5612 // APPROX: [[_ZL5NORMFIPKF_EXIT_LOOPEXIT]]:
5613 // APPROX-NEXT: [[TMP1:%.*]] = tail call contract float @llvm.sqrt.f32(float [[ADD_I]])
5614 // APPROX-NEXT: br label %[[_ZL5NORMFIPKF_EXIT]]
5615 // APPROX: [[_ZL5NORMFIPKF_EXIT]]:
5616 // APPROX-NEXT: [[__R_0_I_LCSSA:%.*]] = phi float [ 0.000000e+00, %[[ENTRY]] ], [ [[TMP1]], %[[_ZL5NORMFIPKF_EXIT_LOOPEXIT]] ]
5617 // APPROX-NEXT: ret float [[__R_0_I_LCSSA]]
5618 //
5619 // NCRDIV-LABEL: define dso_local float @test_normf(
5620 // NCRDIV-SAME: i32 noundef [[X:%.*]], ptr noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR2]] {
5621 // NCRDIV-NEXT: [[ENTRY:.*]]:
5622 // NCRDIV-NEXT: [[TOBOOL_NOT_I1:%.*]] = icmp eq i32 [[X]], 0
5623 // NCRDIV-NEXT: br i1 [[TOBOOL_NOT_I1]], label %[[_ZL5NORMFIPKF_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
5624 // NCRDIV: [[WHILE_BODY_I]]:
5625 // NCRDIV-NEXT: [[__R_0_I4:%.*]] = phi float [ [[ADD_I:%.*]], %[[WHILE_BODY_I]] ], [ 0.000000e+00, %[[ENTRY]] ]
5626 // NCRDIV-NEXT: [[__A_ADDR_0_I3:%.*]] = phi ptr [ [[INCDEC_PTR_I:%.*]], %[[WHILE_BODY_I]] ], [ [[Y]], %[[ENTRY]] ]
5627 // NCRDIV-NEXT: [[__DIM_ADDR_0_I2:%.*]] = phi i32 [ [[DEC_I:%.*]], %[[WHILE_BODY_I]] ], [ [[X]], %[[ENTRY]] ]
5628 // NCRDIV-NEXT: [[DEC_I]] = add nsw i32 [[__DIM_ADDR_0_I2]], -1
5629 // NCRDIV-NEXT: [[TMP0:%.*]] = load float, ptr [[__A_ADDR_0_I3]], align 4, !tbaa [[FLOAT_TBAA17]]
5630 // NCRDIV-NEXT: [[MUL_I:%.*]] = fmul contract float [[TMP0]], [[TMP0]]
5631 // NCRDIV-NEXT: [[ADD_I]] = fadd contract float [[__R_0_I4]], [[MUL_I]]
5632 // NCRDIV-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr [[__A_ADDR_0_I3]], i64 4
5633 // NCRDIV-NEXT: [[TOBOOL_NOT_I:%.*]] = icmp eq i32 [[DEC_I]], 0
5634 // NCRDIV-NEXT: br i1 [[TOBOOL_NOT_I]], label %[[_ZL5NORMFIPKF_EXIT_LOOPEXIT:.*]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP21:![0-9]+]]
5635 // NCRDIV: [[_ZL5NORMFIPKF_EXIT_LOOPEXIT]]:
5636 // NCRDIV-NEXT: [[TMP1:%.*]] = tail call contract float @llvm.sqrt.f32(float [[ADD_I]])
5637 // NCRDIV-NEXT: br label %[[_ZL5NORMFIPKF_EXIT]]
5638 // NCRDIV: [[_ZL5NORMFIPKF_EXIT]]:
5639 // NCRDIV-NEXT: [[__R_0_I_LCSSA:%.*]] = phi float [ 0.000000e+00, %[[ENTRY]] ], [ [[TMP1]], %[[_ZL5NORMFIPKF_EXIT_LOOPEXIT]] ]
5640 // NCRDIV-NEXT: ret float [[__R_0_I_LCSSA]]
5641 //
5642 // AMDGCNSPIRV-LABEL: define spir_func float @test_normf(
5643 // AMDGCNSPIRV-SAME: i32 noundef [[X:%.*]], ptr addrspace(4) noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR2]] {
5644 // AMDGCNSPIRV-NEXT: [[ENTRY:.*]]:
5645 // AMDGCNSPIRV-NEXT: [[TOBOOL_NOT_I1:%.*]] = icmp eq i32 [[X]], 0
5646 // AMDGCNSPIRV-NEXT: br i1 [[TOBOOL_NOT_I1]], label %[[_ZL5NORMFIPKF_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
5647 // AMDGCNSPIRV: [[WHILE_BODY_I]]:
5648 // AMDGCNSPIRV-NEXT: [[__R_0_I4:%.*]] = phi float [ [[ADD_I:%.*]], %[[WHILE_BODY_I]] ], [ 0.000000e+00, %[[ENTRY]] ]
5649 // AMDGCNSPIRV-NEXT: [[__A_ADDR_0_I3:%.*]] = phi ptr addrspace(4) [ [[INCDEC_PTR_I:%.*]], %[[WHILE_BODY_I]] ], [ [[Y]], %[[ENTRY]] ]
5650 // AMDGCNSPIRV-NEXT: [[__DIM_ADDR_0_I2:%.*]] = phi i32 [ [[DEC_I:%.*]], %[[WHILE_BODY_I]] ], [ [[X]], %[[ENTRY]] ]
5651 // AMDGCNSPIRV-NEXT: [[DEC_I]] = add nsw i32 [[__DIM_ADDR_0_I2]], -1
5652 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = load float, ptr addrspace(4) [[__A_ADDR_0_I3]], align 4, !tbaa [[FLOAT_TBAA17]]
5653 // AMDGCNSPIRV-NEXT: [[MUL_I:%.*]] = fmul contract float [[TMP0]], [[TMP0]]
5654 // AMDGCNSPIRV-NEXT: [[ADD_I]] = fadd contract float [[__R_0_I4]], [[MUL_I]]
5655 // AMDGCNSPIRV-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr addrspace(4) [[__A_ADDR_0_I3]], i64 4
5656 // AMDGCNSPIRV-NEXT: [[TOBOOL_NOT_I:%.*]] = icmp eq i32 [[DEC_I]], 0
5657 // AMDGCNSPIRV-NEXT: br i1 [[TOBOOL_NOT_I]], label %[[_ZL5NORMFIPKF_EXIT_LOOPEXIT:.*]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP21:![0-9]+]]
5658 // AMDGCNSPIRV: [[_ZL5NORMFIPKF_EXIT_LOOPEXIT]]:
5659 // AMDGCNSPIRV-NEXT: [[TMP1:%.*]] = tail call contract addrspace(4) float @llvm.sqrt.f32(float [[ADD_I]])
5660 // AMDGCNSPIRV-NEXT: br label %[[_ZL5NORMFIPKF_EXIT]]
5661 // AMDGCNSPIRV: [[_ZL5NORMFIPKF_EXIT]]:
5662 // AMDGCNSPIRV-NEXT: [[__R_0_I_LCSSA:%.*]] = phi float [ 0.000000e+00, %[[ENTRY]] ], [ [[TMP1]], %[[_ZL5NORMFIPKF_EXIT_LOOPEXIT]] ]
5663 // AMDGCNSPIRV-NEXT: ret float [[__R_0_I_LCSSA]]
5664 //
5665 extern "C" __device__ float test_normf(int x, const float *y) {
5666 return normf(x, y);
5667 }
5668
5669 // DEFAULT-LABEL: define dso_local double @test_norm(
5670 // DEFAULT-SAME: i32 noundef [[X:%.*]], ptr noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR2]] {
5671 // DEFAULT-NEXT: [[ENTRY:.*]]:
5672 // DEFAULT-NEXT: [[TOBOOL_NOT_I1:%.*]] = icmp eq i32 [[X]], 0
5673 // DEFAULT-NEXT: br i1 [[TOBOOL_NOT_I1]], label %[[_ZL4NORMIPKD_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
5674 // DEFAULT: [[WHILE_BODY_I]]:
5675 // DEFAULT-NEXT: [[__R_0_I4:%.*]] = phi double [ [[ADD_I:%.*]], %[[WHILE_BODY_I]] ], [ 0.000000e+00, %[[ENTRY]] ]
5676 // DEFAULT-NEXT: [[__A_ADDR_0_I3:%.*]] = phi ptr [ [[INCDEC_PTR_I:%.*]], %[[WHILE_BODY_I]] ], [ [[Y]], %[[ENTRY]] ]
5677 // DEFAULT-NEXT: [[__DIM_ADDR_0_I2:%.*]] = phi i32 [ [[DEC_I:%.*]], %[[WHILE_BODY_I]] ], [ [[X]], %[[ENTRY]] ]
5678 // DEFAULT-NEXT: [[DEC_I]] = add nsw i32 [[__DIM_ADDR_0_I2]], -1
5679 // DEFAULT-NEXT: [[TMP0:%.*]] = load double, ptr [[__A_ADDR_0_I3]], align 8, !tbaa [[DOUBLE_TBAA18]]
5680 // DEFAULT-NEXT: [[MUL_I:%.*]] = fmul contract double [[TMP0]], [[TMP0]]
5681 // DEFAULT-NEXT: [[ADD_I]] = fadd contract double [[__R_0_I4]], [[MUL_I]]
5682 // DEFAULT-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr [[__A_ADDR_0_I3]], i64 8
5683 // DEFAULT-NEXT: [[TOBOOL_NOT_I:%.*]] = icmp eq i32 [[DEC_I]], 0
5684 // DEFAULT-NEXT: br i1 [[TOBOOL_NOT_I]], label %[[_ZL4NORMIPKD_EXIT_LOOPEXIT:.*]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP21:![0-9]+]]
5685 // DEFAULT: [[_ZL4NORMIPKD_EXIT_LOOPEXIT]]:
5686 // DEFAULT-NEXT: [[TMP1:%.*]] = tail call contract double @llvm.sqrt.f64(double [[ADD_I]])
5687 // DEFAULT-NEXT: br label %[[_ZL4NORMIPKD_EXIT]]
5688 // DEFAULT: [[_ZL4NORMIPKD_EXIT]]:
5689 // DEFAULT-NEXT: [[__R_0_I_LCSSA:%.*]] = phi double [ 0.000000e+00, %[[ENTRY]] ], [ [[TMP1]], %[[_ZL4NORMIPKD_EXIT_LOOPEXIT]] ]
5690 // DEFAULT-NEXT: ret double [[__R_0_I_LCSSA]]
5691 //
5692 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) double @test_norm(
5693 // FINITEONLY-SAME: i32 noundef [[X:%.*]], ptr noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR2]] {
5694 // FINITEONLY-NEXT: [[ENTRY:.*]]:
5695 // FINITEONLY-NEXT: [[TOBOOL_NOT_I1:%.*]] = icmp eq i32 [[X]], 0
5696 // FINITEONLY-NEXT: br i1 [[TOBOOL_NOT_I1]], label %[[_ZL4NORMIPKD_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
5697 // FINITEONLY: [[WHILE_BODY_I]]:
5698 // FINITEONLY-NEXT: [[__R_0_I4:%.*]] = phi double [ [[ADD_I:%.*]], %[[WHILE_BODY_I]] ], [ 0.000000e+00, %[[ENTRY]] ]
5699 // FINITEONLY-NEXT: [[__A_ADDR_0_I3:%.*]] = phi ptr [ [[INCDEC_PTR_I:%.*]], %[[WHILE_BODY_I]] ], [ [[Y]], %[[ENTRY]] ]
5700 // FINITEONLY-NEXT: [[__DIM_ADDR_0_I2:%.*]] = phi i32 [ [[DEC_I:%.*]], %[[WHILE_BODY_I]] ], [ [[X]], %[[ENTRY]] ]
5701 // FINITEONLY-NEXT: [[DEC_I]] = add nsw i32 [[__DIM_ADDR_0_I2]], -1
5702 // FINITEONLY-NEXT: [[TMP0:%.*]] = load double, ptr [[__A_ADDR_0_I3]], align 8, !tbaa [[DOUBLE_TBAA18]]
5703 // FINITEONLY-NEXT: [[MUL_I:%.*]] = fmul nnan ninf contract double [[TMP0]], [[TMP0]]
5704 // FINITEONLY-NEXT: [[ADD_I]] = fadd nnan ninf contract double [[__R_0_I4]], [[MUL_I]]
5705 // FINITEONLY-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr [[__A_ADDR_0_I3]], i64 8
5706 // FINITEONLY-NEXT: [[TOBOOL_NOT_I:%.*]] = icmp eq i32 [[DEC_I]], 0
5707 // FINITEONLY-NEXT: br i1 [[TOBOOL_NOT_I]], label %[[_ZL4NORMIPKD_EXIT_LOOPEXIT:.*]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP21:![0-9]+]]
5708 // FINITEONLY: [[_ZL4NORMIPKD_EXIT_LOOPEXIT]]:
5709 // FINITEONLY-NEXT: [[TMP1:%.*]] = tail call nnan ninf contract double @llvm.sqrt.f64(double [[ADD_I]])
5710 // FINITEONLY-NEXT: br label %[[_ZL4NORMIPKD_EXIT]]
5711 // FINITEONLY: [[_ZL4NORMIPKD_EXIT]]:
5712 // FINITEONLY-NEXT: [[__R_0_I_LCSSA:%.*]] = phi double [ 0.000000e+00, %[[ENTRY]] ], [ [[TMP1]], %[[_ZL4NORMIPKD_EXIT_LOOPEXIT]] ]
5713 // FINITEONLY-NEXT: ret double [[__R_0_I_LCSSA]]
5714 //
5715 // APPROX-LABEL: define dso_local double @test_norm(
5716 // APPROX-SAME: i32 noundef [[X:%.*]], ptr noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR2]] {
5717 // APPROX-NEXT: [[ENTRY:.*]]:
5718 // APPROX-NEXT: [[TOBOOL_NOT_I1:%.*]] = icmp eq i32 [[X]], 0
5719 // APPROX-NEXT: br i1 [[TOBOOL_NOT_I1]], label %[[_ZL4NORMIPKD_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
5720 // APPROX: [[WHILE_BODY_I]]:
5721 // APPROX-NEXT: [[__R_0_I4:%.*]] = phi double [ [[ADD_I:%.*]], %[[WHILE_BODY_I]] ], [ 0.000000e+00, %[[ENTRY]] ]
5722 // APPROX-NEXT: [[__A_ADDR_0_I3:%.*]] = phi ptr [ [[INCDEC_PTR_I:%.*]], %[[WHILE_BODY_I]] ], [ [[Y]], %[[ENTRY]] ]
5723 // APPROX-NEXT: [[__DIM_ADDR_0_I2:%.*]] = phi i32 [ [[DEC_I:%.*]], %[[WHILE_BODY_I]] ], [ [[X]], %[[ENTRY]] ]
5724 // APPROX-NEXT: [[DEC_I]] = add nsw i32 [[__DIM_ADDR_0_I2]], -1
5725 // APPROX-NEXT: [[TMP0:%.*]] = load double, ptr [[__A_ADDR_0_I3]], align 8, !tbaa [[DOUBLE_TBAA18]]
5726 // APPROX-NEXT: [[MUL_I:%.*]] = fmul contract double [[TMP0]], [[TMP0]]
5727 // APPROX-NEXT: [[ADD_I]] = fadd contract double [[__R_0_I4]], [[MUL_I]]
5728 // APPROX-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr [[__A_ADDR_0_I3]], i64 8
5729 // APPROX-NEXT: [[TOBOOL_NOT_I:%.*]] = icmp eq i32 [[DEC_I]], 0
5730 // APPROX-NEXT: br i1 [[TOBOOL_NOT_I]], label %[[_ZL4NORMIPKD_EXIT_LOOPEXIT:.*]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP21:![0-9]+]]
5731 // APPROX: [[_ZL4NORMIPKD_EXIT_LOOPEXIT]]:
5732 // APPROX-NEXT: [[TMP1:%.*]] = tail call contract double @llvm.sqrt.f64(double [[ADD_I]])
5733 // APPROX-NEXT: br label %[[_ZL4NORMIPKD_EXIT]]
5734 // APPROX: [[_ZL4NORMIPKD_EXIT]]:
5735 // APPROX-NEXT: [[__R_0_I_LCSSA:%.*]] = phi double [ 0.000000e+00, %[[ENTRY]] ], [ [[TMP1]], %[[_ZL4NORMIPKD_EXIT_LOOPEXIT]] ]
5736 // APPROX-NEXT: ret double [[__R_0_I_LCSSA]]
5737 //
5738 // NCRDIV-LABEL: define dso_local double @test_norm(
5739 // NCRDIV-SAME: i32 noundef [[X:%.*]], ptr noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR2]] {
5740 // NCRDIV-NEXT: [[ENTRY:.*]]:
5741 // NCRDIV-NEXT: [[TOBOOL_NOT_I1:%.*]] = icmp eq i32 [[X]], 0
5742 // NCRDIV-NEXT: br i1 [[TOBOOL_NOT_I1]], label %[[_ZL4NORMIPKD_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
5743 // NCRDIV: [[WHILE_BODY_I]]:
5744 // NCRDIV-NEXT: [[__R_0_I4:%.*]] = phi double [ [[ADD_I:%.*]], %[[WHILE_BODY_I]] ], [ 0.000000e+00, %[[ENTRY]] ]
5745 // NCRDIV-NEXT: [[__A_ADDR_0_I3:%.*]] = phi ptr [ [[INCDEC_PTR_I:%.*]], %[[WHILE_BODY_I]] ], [ [[Y]], %[[ENTRY]] ]
5746 // NCRDIV-NEXT: [[__DIM_ADDR_0_I2:%.*]] = phi i32 [ [[DEC_I:%.*]], %[[WHILE_BODY_I]] ], [ [[X]], %[[ENTRY]] ]
5747 // NCRDIV-NEXT: [[DEC_I]] = add nsw i32 [[__DIM_ADDR_0_I2]], -1
5748 // NCRDIV-NEXT: [[TMP0:%.*]] = load double, ptr [[__A_ADDR_0_I3]], align 8, !tbaa [[DOUBLE_TBAA19]]
5749 // NCRDIV-NEXT: [[MUL_I:%.*]] = fmul contract double [[TMP0]], [[TMP0]]
5750 // NCRDIV-NEXT: [[ADD_I]] = fadd contract double [[__R_0_I4]], [[MUL_I]]
5751 // NCRDIV-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr [[__A_ADDR_0_I3]], i64 8
5752 // NCRDIV-NEXT: [[TOBOOL_NOT_I:%.*]] = icmp eq i32 [[DEC_I]], 0
5753 // NCRDIV-NEXT: br i1 [[TOBOOL_NOT_I]], label %[[_ZL4NORMIPKD_EXIT_LOOPEXIT:.*]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP22:![0-9]+]]
5754 // NCRDIV: [[_ZL4NORMIPKD_EXIT_LOOPEXIT]]:
5755 // NCRDIV-NEXT: [[TMP1:%.*]] = tail call contract double @llvm.sqrt.f64(double [[ADD_I]])
5756 // NCRDIV-NEXT: br label %[[_ZL4NORMIPKD_EXIT]]
5757 // NCRDIV: [[_ZL4NORMIPKD_EXIT]]:
5758 // NCRDIV-NEXT: [[__R_0_I_LCSSA:%.*]] = phi double [ 0.000000e+00, %[[ENTRY]] ], [ [[TMP1]], %[[_ZL4NORMIPKD_EXIT_LOOPEXIT]] ]
5759 // NCRDIV-NEXT: ret double [[__R_0_I_LCSSA]]
5760 //
5761 // AMDGCNSPIRV-LABEL: define spir_func double @test_norm(
5762 // AMDGCNSPIRV-SAME: i32 noundef [[X:%.*]], ptr addrspace(4) noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR2]] {
5763 // AMDGCNSPIRV-NEXT: [[ENTRY:.*]]:
5764 // AMDGCNSPIRV-NEXT: [[TOBOOL_NOT_I1:%.*]] = icmp eq i32 [[X]], 0
5765 // AMDGCNSPIRV-NEXT: br i1 [[TOBOOL_NOT_I1]], label %[[_ZL4NORMIPKD_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
5766 // AMDGCNSPIRV: [[WHILE_BODY_I]]:
5767 // AMDGCNSPIRV-NEXT: [[__R_0_I4:%.*]] = phi double [ [[ADD_I:%.*]], %[[WHILE_BODY_I]] ], [ 0.000000e+00, %[[ENTRY]] ]
5768 // AMDGCNSPIRV-NEXT: [[__A_ADDR_0_I3:%.*]] = phi ptr addrspace(4) [ [[INCDEC_PTR_I:%.*]], %[[WHILE_BODY_I]] ], [ [[Y]], %[[ENTRY]] ]
5769 // AMDGCNSPIRV-NEXT: [[__DIM_ADDR_0_I2:%.*]] = phi i32 [ [[DEC_I:%.*]], %[[WHILE_BODY_I]] ], [ [[X]], %[[ENTRY]] ]
5770 // AMDGCNSPIRV-NEXT: [[DEC_I]] = add nsw i32 [[__DIM_ADDR_0_I2]], -1
5771 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = load double, ptr addrspace(4) [[__A_ADDR_0_I3]], align 8, !tbaa [[DOUBLE_TBAA19]]
5772 // AMDGCNSPIRV-NEXT: [[MUL_I:%.*]] = fmul contract double [[TMP0]], [[TMP0]]
5773 // AMDGCNSPIRV-NEXT: [[ADD_I]] = fadd contract double [[__R_0_I4]], [[MUL_I]]
5774 // AMDGCNSPIRV-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr addrspace(4) [[__A_ADDR_0_I3]], i64 8
5775 // AMDGCNSPIRV-NEXT: [[TOBOOL_NOT_I:%.*]] = icmp eq i32 [[DEC_I]], 0
5776 // AMDGCNSPIRV-NEXT: br i1 [[TOBOOL_NOT_I]], label %[[_ZL4NORMIPKD_EXIT_LOOPEXIT:.*]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP22:![0-9]+]]
5777 // AMDGCNSPIRV: [[_ZL4NORMIPKD_EXIT_LOOPEXIT]]:
5778 // AMDGCNSPIRV-NEXT: [[TMP1:%.*]] = tail call contract addrspace(4) double @llvm.sqrt.f64(double [[ADD_I]])
5779 // AMDGCNSPIRV-NEXT: br label %[[_ZL4NORMIPKD_EXIT]]
5780 // AMDGCNSPIRV: [[_ZL4NORMIPKD_EXIT]]:
5781 // AMDGCNSPIRV-NEXT: [[__R_0_I_LCSSA:%.*]] = phi double [ 0.000000e+00, %[[ENTRY]] ], [ [[TMP1]], %[[_ZL4NORMIPKD_EXIT_LOOPEXIT]] ]
5782 // AMDGCNSPIRV-NEXT: ret double [[__R_0_I_LCSSA]]
5783 //
5784 extern "C" __device__ double test_norm(int x, const double *y) {
5785 return norm(x, y);
5786 }
5787
5788 // DEFAULT-LABEL: define dso_local noundef float @test_powf(
5789 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
5790 // DEFAULT-NEXT: [[ENTRY:.*:]]
5791 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_pow_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR14]]
5792 // DEFAULT-NEXT: ret float [[CALL_I]]
5793 //
5794 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_powf(
5795 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
5796 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5797 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_pow_f32(float noundef nofpclass(nan inf) [[X]], float noundef nofpclass(nan inf) [[Y]]) #[[ATTR14]]
5798 // FINITEONLY-NEXT: ret float [[CALL_I]]
5799 //
5800 // APPROX-LABEL: define dso_local noundef float @test_powf(
5801 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
5802 // APPROX-NEXT: [[ENTRY:.*:]]
5803 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_pow_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR14]]
5804 // APPROX-NEXT: ret float [[CALL_I]]
5805 //
5806 // NCRDIV-LABEL: define dso_local noundef float @test_powf(
5807 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
5808 // NCRDIV-NEXT: [[ENTRY:.*:]]
5809 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_pow_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR14]]
5810 // NCRDIV-NEXT: ret float [[CALL_I]]
5811 //
5812 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_powf(
5813 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
5814 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5815 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_pow_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR14]]
5816 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
5817 //
5818 extern "C" __device__ float test_powf(float x, float y) {
5819 return powf(x, y);
5820 }
5821
5822 // DEFAULT-LABEL: define dso_local noundef double @test_pow(
5823 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
5824 // DEFAULT-NEXT: [[ENTRY:.*:]]
5825 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_pow_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR14]]
5826 // DEFAULT-NEXT: ret double [[CALL_I]]
5827 //
5828 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_pow(
5829 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
5830 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5831 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_pow_f64(double noundef nofpclass(nan inf) [[X]], double noundef nofpclass(nan inf) [[Y]]) #[[ATTR14]]
5832 // FINITEONLY-NEXT: ret double [[CALL_I]]
5833 //
5834 // APPROX-LABEL: define dso_local noundef double @test_pow(
5835 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
5836 // APPROX-NEXT: [[ENTRY:.*:]]
5837 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_pow_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR14]]
5838 // APPROX-NEXT: ret double [[CALL_I]]
5839 //
5840 // NCRDIV-LABEL: define dso_local noundef double @test_pow(
5841 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
5842 // NCRDIV-NEXT: [[ENTRY:.*:]]
5843 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_pow_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR14]]
5844 // NCRDIV-NEXT: ret double [[CALL_I]]
5845 //
5846 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_pow(
5847 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
5848 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5849 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_pow_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR14]]
5850 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
5851 //
5852 extern "C" __device__ double test_pow(double x, double y) {
5853 return pow(x, y);
5854 }
5855
5856 // DEFAULT-LABEL: define dso_local noundef float @test_powif(
5857 // DEFAULT-SAME: float noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
5858 // DEFAULT-NEXT: [[ENTRY:.*:]]
5859 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_pown_f32(float noundef [[X]], i32 noundef [[Y]]) #[[ATTR14]]
5860 // DEFAULT-NEXT: ret float [[CALL_I]]
5861 //
5862 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_powif(
5863 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
5864 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5865 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_pown_f32(float noundef nofpclass(nan inf) [[X]], i32 noundef [[Y]]) #[[ATTR14]]
5866 // FINITEONLY-NEXT: ret float [[CALL_I]]
5867 //
5868 // APPROX-LABEL: define dso_local noundef float @test_powif(
5869 // APPROX-SAME: float noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
5870 // APPROX-NEXT: [[ENTRY:.*:]]
5871 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_pown_f32(float noundef [[X]], i32 noundef [[Y]]) #[[ATTR14]]
5872 // APPROX-NEXT: ret float [[CALL_I]]
5873 //
5874 // NCRDIV-LABEL: define dso_local noundef float @test_powif(
5875 // NCRDIV-SAME: float noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
5876 // NCRDIV-NEXT: [[ENTRY:.*:]]
5877 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_pown_f32(float noundef [[X]], i32 noundef [[Y]]) #[[ATTR14]]
5878 // NCRDIV-NEXT: ret float [[CALL_I]]
5879 //
5880 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_powif(
5881 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
5882 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5883 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_pown_f32(float noundef [[X]], i32 noundef [[Y]]) #[[ATTR14]]
5884 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
5885 //
5886 extern "C" __device__ float test_powif(float x, int y) {
5887 return powif(x, y);
5888 }
5889
5890 // DEFAULT-LABEL: define dso_local noundef double @test_powi(
5891 // DEFAULT-SAME: double noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
5892 // DEFAULT-NEXT: [[ENTRY:.*:]]
5893 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_pown_f64(double noundef [[X]], i32 noundef [[Y]]) #[[ATTR14]]
5894 // DEFAULT-NEXT: ret double [[CALL_I]]
5895 //
5896 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_powi(
5897 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
5898 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5899 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_pown_f64(double noundef nofpclass(nan inf) [[X]], i32 noundef [[Y]]) #[[ATTR14]]
5900 // FINITEONLY-NEXT: ret double [[CALL_I]]
5901 //
5902 // APPROX-LABEL: define dso_local noundef double @test_powi(
5903 // APPROX-SAME: double noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
5904 // APPROX-NEXT: [[ENTRY:.*:]]
5905 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_pown_f64(double noundef [[X]], i32 noundef [[Y]]) #[[ATTR14]]
5906 // APPROX-NEXT: ret double [[CALL_I]]
5907 //
5908 // NCRDIV-LABEL: define dso_local noundef double @test_powi(
5909 // NCRDIV-SAME: double noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
5910 // NCRDIV-NEXT: [[ENTRY:.*:]]
5911 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_pown_f64(double noundef [[X]], i32 noundef [[Y]]) #[[ATTR14]]
5912 // NCRDIV-NEXT: ret double [[CALL_I]]
5913 //
5914 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_powi(
5915 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
5916 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5917 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_pown_f64(double noundef [[X]], i32 noundef [[Y]]) #[[ATTR14]]
5918 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
5919 //
5920 extern "C" __device__ double test_powi(double x, int y) {
5921 return powi(x, y);
5922 }
5923
5924 // DEFAULT-LABEL: define dso_local noundef float @test_rcbrtf(
5925 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5926 // DEFAULT-NEXT: [[ENTRY:.*:]]
5927 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_rcbrt_f32(float noundef [[X]]) #[[ATTR14]]
5928 // DEFAULT-NEXT: ret float [[CALL_I]]
5929 //
5930 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_rcbrtf(
5931 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5932 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5933 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_rcbrt_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
5934 // FINITEONLY-NEXT: ret float [[CALL_I]]
5935 //
5936 // APPROX-LABEL: define dso_local noundef float @test_rcbrtf(
5937 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5938 // APPROX-NEXT: [[ENTRY:.*:]]
5939 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_rcbrt_f32(float noundef [[X]]) #[[ATTR14]]
5940 // APPROX-NEXT: ret float [[CALL_I]]
5941 //
5942 // NCRDIV-LABEL: define dso_local noundef float @test_rcbrtf(
5943 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5944 // NCRDIV-NEXT: [[ENTRY:.*:]]
5945 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_rcbrt_f32(float noundef [[X]]) #[[ATTR14]]
5946 // NCRDIV-NEXT: ret float [[CALL_I]]
5947 //
5948 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_rcbrtf(
5949 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
5950 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5951 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_rcbrt_f32(float noundef [[X]]) #[[ATTR14]]
5952 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
5953 //
5954 extern "C" __device__ float test_rcbrtf(float x) {
5955 return rcbrtf(x);
5956 }
5957
5958 // DEFAULT-LABEL: define dso_local noundef double @test_rcbrt(
5959 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5960 // DEFAULT-NEXT: [[ENTRY:.*:]]
5961 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_rcbrt_f64(double noundef [[X]]) #[[ATTR14]]
5962 // DEFAULT-NEXT: ret double [[CALL_I]]
5963 //
5964 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_rcbrt(
5965 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5966 // FINITEONLY-NEXT: [[ENTRY:.*:]]
5967 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_rcbrt_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
5968 // FINITEONLY-NEXT: ret double [[CALL_I]]
5969 //
5970 // APPROX-LABEL: define dso_local noundef double @test_rcbrt(
5971 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5972 // APPROX-NEXT: [[ENTRY:.*:]]
5973 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_rcbrt_f64(double noundef [[X]]) #[[ATTR14]]
5974 // APPROX-NEXT: ret double [[CALL_I]]
5975 //
5976 // NCRDIV-LABEL: define dso_local noundef double @test_rcbrt(
5977 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
5978 // NCRDIV-NEXT: [[ENTRY:.*:]]
5979 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_rcbrt_f64(double noundef [[X]]) #[[ATTR14]]
5980 // NCRDIV-NEXT: ret double [[CALL_I]]
5981 //
5982 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_rcbrt(
5983 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
5984 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
5985 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_rcbrt_f64(double noundef [[X]]) #[[ATTR14]]
5986 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
5987 //
5988 extern "C" __device__ double test_rcbrt(double x) {
5989 return rcbrt(x);
5990 }
5991
5992 // DEFAULT-LABEL: define dso_local noundef float @test_remainderf(
5993 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
5994 // DEFAULT-NEXT: [[ENTRY:.*:]]
5995 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_remainder_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
5996 // DEFAULT-NEXT: ret float [[CALL_I]]
5997 //
5998 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_remainderf(
5999 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
6000 // FINITEONLY-NEXT: [[ENTRY:.*:]]
6001 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_remainder_f32(float noundef nofpclass(nan inf) [[X]], float noundef nofpclass(nan inf) [[Y]]) #[[ATTR13]]
6002 // FINITEONLY-NEXT: ret float [[CALL_I]]
6003 //
6004 // APPROX-LABEL: define dso_local noundef float @test_remainderf(
6005 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
6006 // APPROX-NEXT: [[ENTRY:.*:]]
6007 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_remainder_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
6008 // APPROX-NEXT: ret float [[CALL_I]]
6009 //
6010 // NCRDIV-LABEL: define dso_local noundef float @test_remainderf(
6011 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
6012 // NCRDIV-NEXT: [[ENTRY:.*:]]
6013 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_remainder_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
6014 // NCRDIV-NEXT: ret float [[CALL_I]]
6015 //
6016 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_remainderf(
6017 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
6018 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
6019 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_remainder_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
6020 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
6021 //
6022 extern "C" __device__ float test_remainderf(float x, float y) {
6023 return remainderf(x, y);
6024 }
6025
6026 // DEFAULT-LABEL: define dso_local noundef double @test_remainder(
6027 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
6028 // DEFAULT-NEXT: [[ENTRY:.*:]]
6029 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_remainder_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
6030 // DEFAULT-NEXT: ret double [[CALL_I]]
6031 //
6032 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_remainder(
6033 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
6034 // FINITEONLY-NEXT: [[ENTRY:.*:]]
6035 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_remainder_f64(double noundef nofpclass(nan inf) [[X]], double noundef nofpclass(nan inf) [[Y]]) #[[ATTR13]]
6036 // FINITEONLY-NEXT: ret double [[CALL_I]]
6037 //
6038 // APPROX-LABEL: define dso_local noundef double @test_remainder(
6039 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
6040 // APPROX-NEXT: [[ENTRY:.*:]]
6041 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_remainder_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
6042 // APPROX-NEXT: ret double [[CALL_I]]
6043 //
6044 // NCRDIV-LABEL: define dso_local noundef double @test_remainder(
6045 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
6046 // NCRDIV-NEXT: [[ENTRY:.*:]]
6047 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_remainder_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
6048 // NCRDIV-NEXT: ret double [[CALL_I]]
6049 //
6050 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_remainder(
6051 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
6052 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
6053 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_remainder_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
6054 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
6055 //
6056 extern "C" __device__ double test_remainder(double x, double y) {
6057 return remainder(x, y);
6058 }
6059
6060 // DEFAULT-LABEL: define dso_local noundef float @test_remquof(
6061 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
6062 // DEFAULT-NEXT: [[ENTRY:.*:]]
6063 // DEFAULT-NEXT: [[__TMP_I:%.*]] = alloca i32, align 4, addrspace(5)
6064 // DEFAULT-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
6065 // DEFAULT-NEXT: [[CALL_I:%.*]] = call contract noundef float @__ocml_remquo_f32(float noundef [[X]], float noundef [[Y]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
6066 // DEFAULT-NEXT: [[TMP0:%.*]] = load i32, ptr addrspace(5) [[__TMP_I]], align 4, !tbaa [[INT_TBAA4]]
6067 // DEFAULT-NEXT: store i32 [[TMP0]], ptr [[Z]], align 4, !tbaa [[INT_TBAA4]]
6068 // DEFAULT-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
6069 // DEFAULT-NEXT: ret float [[CALL_I]]
6070 //
6071 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_remquof(
6072 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
6073 // FINITEONLY-NEXT: [[ENTRY:.*:]]
6074 // FINITEONLY-NEXT: [[__TMP_I:%.*]] = alloca i32, align 4, addrspace(5)
6075 // FINITEONLY-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
6076 // FINITEONLY-NEXT: [[CALL_I:%.*]] = call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_remquo_f32(float noundef nofpclass(nan inf) [[X]], float noundef nofpclass(nan inf) [[Y]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
6077 // FINITEONLY-NEXT: [[TMP0:%.*]] = load i32, ptr addrspace(5) [[__TMP_I]], align 4, !tbaa [[INT_TBAA4]]
6078 // FINITEONLY-NEXT: store i32 [[TMP0]], ptr [[Z]], align 4, !tbaa [[INT_TBAA4]]
6079 // FINITEONLY-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
6080 // FINITEONLY-NEXT: ret float [[CALL_I]]
6081 //
6082 // APPROX-LABEL: define dso_local noundef float @test_remquof(
6083 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
6084 // APPROX-NEXT: [[ENTRY:.*:]]
6085 // APPROX-NEXT: [[__TMP_I:%.*]] = alloca i32, align 4, addrspace(5)
6086 // APPROX-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
6087 // APPROX-NEXT: [[CALL_I:%.*]] = call contract noundef float @__ocml_remquo_f32(float noundef [[X]], float noundef [[Y]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
6088 // APPROX-NEXT: [[TMP0:%.*]] = load i32, ptr addrspace(5) [[__TMP_I]], align 4, !tbaa [[INT_TBAA4]]
6089 // APPROX-NEXT: store i32 [[TMP0]], ptr [[Z]], align 4, !tbaa [[INT_TBAA4]]
6090 // APPROX-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
6091 // APPROX-NEXT: ret float [[CALL_I]]
6092 //
6093 // NCRDIV-LABEL: define dso_local noundef float @test_remquof(
6094 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
6095 // NCRDIV-NEXT: [[ENTRY:.*:]]
6096 // NCRDIV-NEXT: [[__TMP_I:%.*]] = alloca i32, align 4, addrspace(5)
6097 // NCRDIV-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
6098 // NCRDIV-NEXT: [[CALL_I:%.*]] = call contract noundef float @__ocml_remquo_f32(float noundef [[X]], float noundef [[Y]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
6099 // NCRDIV-NEXT: [[TMP0:%.*]] = load i32, ptr addrspace(5) [[__TMP_I]], align 4, !tbaa [[INT_TBAA4]]
6100 // NCRDIV-NEXT: store i32 [[TMP0]], ptr [[Z]], align 4, !tbaa [[INT_TBAA4]]
6101 // NCRDIV-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
6102 // NCRDIV-NEXT: ret float [[CALL_I]]
6103 //
6104 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_remquof(
6105 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], ptr addrspace(4) noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
6106 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
6107 // AMDGCNSPIRV-NEXT: [[__TMP_I:%.*]] = alloca i32, align 4
6108 // AMDGCNSPIRV-NEXT: [[__TMP_ASCAST_I:%.*]] = addrspacecast ptr [[__TMP_I]] to ptr addrspace(4)
6109 // AMDGCNSPIRV-NEXT: call addrspace(4) void @llvm.lifetime.start.p0(ptr nonnull [[__TMP_I]]) #[[ATTR16]]
6110 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = call contract spir_func noundef addrspace(4) float @__ocml_remquo_f32(float noundef [[X]], float noundef [[Y]], ptr noundef nonnull [[__TMP_I]]) #[[ATTR15]]
6111 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = load i32, ptr addrspace(4) [[__TMP_ASCAST_I]], align 4, !tbaa [[INT_TBAA5]]
6112 // AMDGCNSPIRV-NEXT: store i32 [[TMP0]], ptr addrspace(4) [[Z]], align 4, !tbaa [[INT_TBAA5]]
6113 // AMDGCNSPIRV-NEXT: call addrspace(4) void @llvm.lifetime.end.p0(ptr nonnull [[__TMP_I]]) #[[ATTR16]]
6114 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
6115 //
6116 extern "C" __device__ float test_remquof(float x, float y, int* z) {
6117 return remquof(x, y, z);
6118 }
6119
6120 // DEFAULT-LABEL: define dso_local noundef double @test_remquo(
6121 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
6122 // DEFAULT-NEXT: [[ENTRY:.*:]]
6123 // DEFAULT-NEXT: [[__TMP_I:%.*]] = alloca i32, align 4, addrspace(5)
6124 // DEFAULT-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
6125 // DEFAULT-NEXT: [[CALL_I:%.*]] = call contract noundef double @__ocml_remquo_f64(double noundef [[X]], double noundef [[Y]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
6126 // DEFAULT-NEXT: [[TMP0:%.*]] = load i32, ptr addrspace(5) [[__TMP_I]], align 4, !tbaa [[INT_TBAA4]]
6127 // DEFAULT-NEXT: store i32 [[TMP0]], ptr [[Z]], align 4, !tbaa [[INT_TBAA4]]
6128 // DEFAULT-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
6129 // DEFAULT-NEXT: ret double [[CALL_I]]
6130 //
6131 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_remquo(
6132 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
6133 // FINITEONLY-NEXT: [[ENTRY:.*:]]
6134 // FINITEONLY-NEXT: [[__TMP_I:%.*]] = alloca i32, align 4, addrspace(5)
6135 // FINITEONLY-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
6136 // FINITEONLY-NEXT: [[CALL_I:%.*]] = call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_remquo_f64(double noundef nofpclass(nan inf) [[X]], double noundef nofpclass(nan inf) [[Y]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
6137 // FINITEONLY-NEXT: [[TMP0:%.*]] = load i32, ptr addrspace(5) [[__TMP_I]], align 4, !tbaa [[INT_TBAA4]]
6138 // FINITEONLY-NEXT: store i32 [[TMP0]], ptr [[Z]], align 4, !tbaa [[INT_TBAA4]]
6139 // FINITEONLY-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
6140 // FINITEONLY-NEXT: ret double [[CALL_I]]
6141 //
6142 // APPROX-LABEL: define dso_local noundef double @test_remquo(
6143 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
6144 // APPROX-NEXT: [[ENTRY:.*:]]
6145 // APPROX-NEXT: [[__TMP_I:%.*]] = alloca i32, align 4, addrspace(5)
6146 // APPROX-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
6147 // APPROX-NEXT: [[CALL_I:%.*]] = call contract noundef double @__ocml_remquo_f64(double noundef [[X]], double noundef [[Y]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
6148 // APPROX-NEXT: [[TMP0:%.*]] = load i32, ptr addrspace(5) [[__TMP_I]], align 4, !tbaa [[INT_TBAA4]]
6149 // APPROX-NEXT: store i32 [[TMP0]], ptr [[Z]], align 4, !tbaa [[INT_TBAA4]]
6150 // APPROX-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
6151 // APPROX-NEXT: ret double [[CALL_I]]
6152 //
6153 // NCRDIV-LABEL: define dso_local noundef double @test_remquo(
6154 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
6155 // NCRDIV-NEXT: [[ENTRY:.*:]]
6156 // NCRDIV-NEXT: [[__TMP_I:%.*]] = alloca i32, align 4, addrspace(5)
6157 // NCRDIV-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
6158 // NCRDIV-NEXT: [[CALL_I:%.*]] = call contract noundef double @__ocml_remquo_f64(double noundef [[X]], double noundef [[Y]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
6159 // NCRDIV-NEXT: [[TMP0:%.*]] = load i32, ptr addrspace(5) [[__TMP_I]], align 4, !tbaa [[INT_TBAA4]]
6160 // NCRDIV-NEXT: store i32 [[TMP0]], ptr [[Z]], align 4, !tbaa [[INT_TBAA4]]
6161 // NCRDIV-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
6162 // NCRDIV-NEXT: ret double [[CALL_I]]
6163 //
6164 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_remquo(
6165 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], ptr addrspace(4) noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
6166 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
6167 // AMDGCNSPIRV-NEXT: [[__TMP_I:%.*]] = alloca i32, align 4
6168 // AMDGCNSPIRV-NEXT: [[__TMP_ASCAST_I:%.*]] = addrspacecast ptr [[__TMP_I]] to ptr addrspace(4)
6169 // AMDGCNSPIRV-NEXT: call addrspace(4) void @llvm.lifetime.start.p0(ptr nonnull [[__TMP_I]]) #[[ATTR16]]
6170 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = call contract spir_func noundef addrspace(4) double @__ocml_remquo_f64(double noundef [[X]], double noundef [[Y]], ptr noundef nonnull [[__TMP_I]]) #[[ATTR15]]
6171 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = load i32, ptr addrspace(4) [[__TMP_ASCAST_I]], align 4, !tbaa [[INT_TBAA5]]
6172 // AMDGCNSPIRV-NEXT: store i32 [[TMP0]], ptr addrspace(4) [[Z]], align 4, !tbaa [[INT_TBAA5]]
6173 // AMDGCNSPIRV-NEXT: call addrspace(4) void @llvm.lifetime.end.p0(ptr nonnull [[__TMP_I]]) #[[ATTR16]]
6174 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
6175 //
6176 extern "C" __device__ double test_remquo(double x, double y, int* z) {
6177 return remquo(x, y, z);
6178 }
6179
6180 // DEFAULT-LABEL: define dso_local noundef float @test_rhypotf(
6181 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
6182 // DEFAULT-NEXT: [[ENTRY:.*:]]
6183 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_rhypot_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
6184 // DEFAULT-NEXT: ret float [[CALL_I]]
6185 //
6186 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_rhypotf(
6187 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
6188 // FINITEONLY-NEXT: [[ENTRY:.*:]]
6189 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_rhypot_f32(float noundef nofpclass(nan inf) [[X]], float noundef nofpclass(nan inf) [[Y]]) #[[ATTR13]]
6190 // FINITEONLY-NEXT: ret float [[CALL_I]]
6191 //
6192 // APPROX-LABEL: define dso_local noundef float @test_rhypotf(
6193 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
6194 // APPROX-NEXT: [[ENTRY:.*:]]
6195 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_rhypot_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
6196 // APPROX-NEXT: ret float [[CALL_I]]
6197 //
6198 // NCRDIV-LABEL: define dso_local noundef float @test_rhypotf(
6199 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
6200 // NCRDIV-NEXT: [[ENTRY:.*:]]
6201 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_rhypot_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
6202 // NCRDIV-NEXT: ret float [[CALL_I]]
6203 //
6204 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_rhypotf(
6205 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
6206 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
6207 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_rhypot_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR13]]
6208 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
6209 //
6210 extern "C" __device__ float test_rhypotf(float x, float y) {
6211 return rhypotf(x, y);
6212 }
6213
6214 // DEFAULT-LABEL: define dso_local noundef double @test_rhypot(
6215 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
6216 // DEFAULT-NEXT: [[ENTRY:.*:]]
6217 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_rhypot_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
6218 // DEFAULT-NEXT: ret double [[CALL_I]]
6219 //
6220 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_rhypot(
6221 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
6222 // FINITEONLY-NEXT: [[ENTRY:.*:]]
6223 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_rhypot_f64(double noundef nofpclass(nan inf) [[X]], double noundef nofpclass(nan inf) [[Y]]) #[[ATTR13]]
6224 // FINITEONLY-NEXT: ret double [[CALL_I]]
6225 //
6226 // APPROX-LABEL: define dso_local noundef double @test_rhypot(
6227 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
6228 // APPROX-NEXT: [[ENTRY:.*:]]
6229 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_rhypot_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
6230 // APPROX-NEXT: ret double [[CALL_I]]
6231 //
6232 // NCRDIV-LABEL: define dso_local noundef double @test_rhypot(
6233 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR4]] {
6234 // NCRDIV-NEXT: [[ENTRY:.*:]]
6235 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_rhypot_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
6236 // NCRDIV-NEXT: ret double [[CALL_I]]
6237 //
6238 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_rhypot(
6239 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
6240 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
6241 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_rhypot_f64(double noundef [[X]], double noundef [[Y]]) #[[ATTR13]]
6242 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
6243 //
6244 extern "C" __device__ double test_rhypot(double x, double y) {
6245 return rhypot(x, y);
6246 }
6247
6248 // DEFAULT-LABEL: define dso_local noundef float @test_rintf(
6249 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
6250 // DEFAULT-NEXT: [[ENTRY:.*:]]
6251 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.rint.f32(float [[X]])
6252 // DEFAULT-NEXT: ret float [[TMP0]]
6253 //
6254 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_rintf(
6255 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
6256 // FINITEONLY-NEXT: [[ENTRY:.*:]]
6257 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.rint.f32(float nofpclass(nan inf) [[X]])
6258 // FINITEONLY-NEXT: ret float [[TMP0]]
6259 //
6260 // APPROX-LABEL: define dso_local noundef float @test_rintf(
6261 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
6262 // APPROX-NEXT: [[ENTRY:.*:]]
6263 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.rint.f32(float [[X]])
6264 // APPROX-NEXT: ret float [[TMP0]]
6265 //
6266 // NCRDIV-LABEL: define dso_local noundef float @test_rintf(
6267 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
6268 // NCRDIV-NEXT: [[ENTRY:.*:]]
6269 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.rint.f32(float [[X]])
6270 // NCRDIV-NEXT: ret float [[TMP0]]
6271 //
6272 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_rintf(
6273 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
6274 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
6275 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.rint.f32(float [[X]])
6276 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
6277 //
6278 extern "C" __device__ float test_rintf(float x) {
6279 return rintf(x);
6280 }
6281
6282 // DEFAULT-LABEL: define dso_local noundef double @test_rint(
6283 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
6284 // DEFAULT-NEXT: [[ENTRY:.*:]]
6285 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.rint.f64(double [[X]])
6286 // DEFAULT-NEXT: ret double [[TMP0]]
6287 //
6288 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_rint(
6289 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
6290 // FINITEONLY-NEXT: [[ENTRY:.*:]]
6291 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef double @llvm.rint.f64(double nofpclass(nan inf) [[X]])
6292 // FINITEONLY-NEXT: ret double [[TMP0]]
6293 //
6294 // APPROX-LABEL: define dso_local noundef double @test_rint(
6295 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
6296 // APPROX-NEXT: [[ENTRY:.*:]]
6297 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.rint.f64(double [[X]])
6298 // APPROX-NEXT: ret double [[TMP0]]
6299 //
6300 // NCRDIV-LABEL: define dso_local noundef double @test_rint(
6301 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
6302 // NCRDIV-NEXT: [[ENTRY:.*:]]
6303 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.rint.f64(double [[X]])
6304 // NCRDIV-NEXT: ret double [[TMP0]]
6305 //
6306 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_rint(
6307 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
6308 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
6309 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) double @llvm.rint.f64(double [[X]])
6310 // AMDGCNSPIRV-NEXT: ret double [[TMP0]]
6311 //
6312 extern "C" __device__ double test_rint(double x) {
6313 return rint(x);
6314 }
6315
6316 // DEFAULT-LABEL: define dso_local noundef float @test_rnormf(
6317 // DEFAULT-SAME: i32 noundef [[X:%.*]], ptr noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
6318 // DEFAULT-NEXT: [[ENTRY:.*]]:
6319 // DEFAULT-NEXT: [[TOBOOL_NOT_I1:%.*]] = icmp eq i32 [[X]], 0
6320 // DEFAULT-NEXT: br i1 [[TOBOOL_NOT_I1]], label %[[_ZL6RNORMFIPKF_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
6321 // DEFAULT: [[WHILE_BODY_I]]:
6322 // DEFAULT-NEXT: [[__R_0_I4:%.*]] = phi float [ [[ADD_I:%.*]], %[[WHILE_BODY_I]] ], [ 0.000000e+00, %[[ENTRY]] ]
6323 // DEFAULT-NEXT: [[__A_ADDR_0_I3:%.*]] = phi ptr [ [[INCDEC_PTR_I:%.*]], %[[WHILE_BODY_I]] ], [ [[Y]], %[[ENTRY]] ]
6324 // DEFAULT-NEXT: [[__DIM_ADDR_0_I2:%.*]] = phi i32 [ [[DEC_I:%.*]], %[[WHILE_BODY_I]] ], [ [[X]], %[[ENTRY]] ]
6325 // DEFAULT-NEXT: [[DEC_I]] = add nsw i32 [[__DIM_ADDR_0_I2]], -1
6326 // DEFAULT-NEXT: [[TMP0:%.*]] = load float, ptr [[__A_ADDR_0_I3]], align 4, !tbaa [[FLOAT_TBAA16]]
6327 // DEFAULT-NEXT: [[MUL_I:%.*]] = fmul contract float [[TMP0]], [[TMP0]]
6328 // DEFAULT-NEXT: [[ADD_I]] = fadd contract float [[__R_0_I4]], [[MUL_I]]
6329 // DEFAULT-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr [[__A_ADDR_0_I3]], i64 4
6330 // DEFAULT-NEXT: [[TOBOOL_NOT_I:%.*]] = icmp eq i32 [[DEC_I]], 0
6331 // DEFAULT-NEXT: br i1 [[TOBOOL_NOT_I]], label %[[_ZL6RNORMFIPKF_EXIT]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP22:![0-9]+]]
6332 // DEFAULT: [[_ZL6RNORMFIPKF_EXIT]]:
6333 // DEFAULT-NEXT: [[__R_0_I_LCSSA:%.*]] = phi float [ 0.000000e+00, %[[ENTRY]] ], [ [[ADD_I]], %[[WHILE_BODY_I]] ]
6334 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_rsqrt_f32(float noundef [[__R_0_I_LCSSA]]) #[[ATTR14]]
6335 // DEFAULT-NEXT: ret float [[CALL_I]]
6336 //
6337 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_rnormf(
6338 // FINITEONLY-SAME: i32 noundef [[X:%.*]], ptr noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
6339 // FINITEONLY-NEXT: [[ENTRY:.*]]:
6340 // FINITEONLY-NEXT: [[TOBOOL_NOT_I1:%.*]] = icmp eq i32 [[X]], 0
6341 // FINITEONLY-NEXT: br i1 [[TOBOOL_NOT_I1]], label %[[_ZL6RNORMFIPKF_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
6342 // FINITEONLY: [[WHILE_BODY_I]]:
6343 // FINITEONLY-NEXT: [[__R_0_I4:%.*]] = phi float [ [[ADD_I:%.*]], %[[WHILE_BODY_I]] ], [ 0.000000e+00, %[[ENTRY]] ]
6344 // FINITEONLY-NEXT: [[__A_ADDR_0_I3:%.*]] = phi ptr [ [[INCDEC_PTR_I:%.*]], %[[WHILE_BODY_I]] ], [ [[Y]], %[[ENTRY]] ]
6345 // FINITEONLY-NEXT: [[__DIM_ADDR_0_I2:%.*]] = phi i32 [ [[DEC_I:%.*]], %[[WHILE_BODY_I]] ], [ [[X]], %[[ENTRY]] ]
6346 // FINITEONLY-NEXT: [[DEC_I]] = add nsw i32 [[__DIM_ADDR_0_I2]], -1
6347 // FINITEONLY-NEXT: [[TMP0:%.*]] = load float, ptr [[__A_ADDR_0_I3]], align 4, !tbaa [[FLOAT_TBAA16]]
6348 // FINITEONLY-NEXT: [[MUL_I:%.*]] = fmul nnan ninf contract float [[TMP0]], [[TMP0]]
6349 // FINITEONLY-NEXT: [[ADD_I]] = fadd nnan ninf contract float [[__R_0_I4]], [[MUL_I]]
6350 // FINITEONLY-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr [[__A_ADDR_0_I3]], i64 4
6351 // FINITEONLY-NEXT: [[TOBOOL_NOT_I:%.*]] = icmp eq i32 [[DEC_I]], 0
6352 // FINITEONLY-NEXT: br i1 [[TOBOOL_NOT_I]], label %[[_ZL6RNORMFIPKF_EXIT]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP22:![0-9]+]]
6353 // FINITEONLY: [[_ZL6RNORMFIPKF_EXIT]]:
6354 // FINITEONLY-NEXT: [[__R_0_I_LCSSA:%.*]] = phi float [ 0.000000e+00, %[[ENTRY]] ], [ [[ADD_I]], %[[WHILE_BODY_I]] ]
6355 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_rsqrt_f32(float noundef nofpclass(nan inf) [[__R_0_I_LCSSA]]) #[[ATTR14]]
6356 // FINITEONLY-NEXT: ret float [[CALL_I]]
6357 //
6358 // APPROX-LABEL: define dso_local noundef float @test_rnormf(
6359 // APPROX-SAME: i32 noundef [[X:%.*]], ptr noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
6360 // APPROX-NEXT: [[ENTRY:.*]]:
6361 // APPROX-NEXT: [[TOBOOL_NOT_I1:%.*]] = icmp eq i32 [[X]], 0
6362 // APPROX-NEXT: br i1 [[TOBOOL_NOT_I1]], label %[[_ZL6RNORMFIPKF_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
6363 // APPROX: [[WHILE_BODY_I]]:
6364 // APPROX-NEXT: [[__R_0_I4:%.*]] = phi float [ [[ADD_I:%.*]], %[[WHILE_BODY_I]] ], [ 0.000000e+00, %[[ENTRY]] ]
6365 // APPROX-NEXT: [[__A_ADDR_0_I3:%.*]] = phi ptr [ [[INCDEC_PTR_I:%.*]], %[[WHILE_BODY_I]] ], [ [[Y]], %[[ENTRY]] ]
6366 // APPROX-NEXT: [[__DIM_ADDR_0_I2:%.*]] = phi i32 [ [[DEC_I:%.*]], %[[WHILE_BODY_I]] ], [ [[X]], %[[ENTRY]] ]
6367 // APPROX-NEXT: [[DEC_I]] = add nsw i32 [[__DIM_ADDR_0_I2]], -1
6368 // APPROX-NEXT: [[TMP0:%.*]] = load float, ptr [[__A_ADDR_0_I3]], align 4, !tbaa [[FLOAT_TBAA16]]
6369 // APPROX-NEXT: [[MUL_I:%.*]] = fmul contract float [[TMP0]], [[TMP0]]
6370 // APPROX-NEXT: [[ADD_I]] = fadd contract float [[__R_0_I4]], [[MUL_I]]
6371 // APPROX-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr [[__A_ADDR_0_I3]], i64 4
6372 // APPROX-NEXT: [[TOBOOL_NOT_I:%.*]] = icmp eq i32 [[DEC_I]], 0
6373 // APPROX-NEXT: br i1 [[TOBOOL_NOT_I]], label %[[_ZL6RNORMFIPKF_EXIT]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP22:![0-9]+]]
6374 // APPROX: [[_ZL6RNORMFIPKF_EXIT]]:
6375 // APPROX-NEXT: [[__R_0_I_LCSSA:%.*]] = phi float [ 0.000000e+00, %[[ENTRY]] ], [ [[ADD_I]], %[[WHILE_BODY_I]] ]
6376 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_rsqrt_f32(float noundef [[__R_0_I_LCSSA]]) #[[ATTR14]]
6377 // APPROX-NEXT: ret float [[CALL_I]]
6378 //
6379 // NCRDIV-LABEL: define dso_local noundef float @test_rnormf(
6380 // NCRDIV-SAME: i32 noundef [[X:%.*]], ptr noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
6381 // NCRDIV-NEXT: [[ENTRY:.*]]:
6382 // NCRDIV-NEXT: [[TOBOOL_NOT_I1:%.*]] = icmp eq i32 [[X]], 0
6383 // NCRDIV-NEXT: br i1 [[TOBOOL_NOT_I1]], label %[[_ZL6RNORMFIPKF_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
6384 // NCRDIV: [[WHILE_BODY_I]]:
6385 // NCRDIV-NEXT: [[__R_0_I4:%.*]] = phi float [ [[ADD_I:%.*]], %[[WHILE_BODY_I]] ], [ 0.000000e+00, %[[ENTRY]] ]
6386 // NCRDIV-NEXT: [[__A_ADDR_0_I3:%.*]] = phi ptr [ [[INCDEC_PTR_I:%.*]], %[[WHILE_BODY_I]] ], [ [[Y]], %[[ENTRY]] ]
6387 // NCRDIV-NEXT: [[__DIM_ADDR_0_I2:%.*]] = phi i32 [ [[DEC_I:%.*]], %[[WHILE_BODY_I]] ], [ [[X]], %[[ENTRY]] ]
6388 // NCRDIV-NEXT: [[DEC_I]] = add nsw i32 [[__DIM_ADDR_0_I2]], -1
6389 // NCRDIV-NEXT: [[TMP0:%.*]] = load float, ptr [[__A_ADDR_0_I3]], align 4, !tbaa [[FLOAT_TBAA17]]
6390 // NCRDIV-NEXT: [[MUL_I:%.*]] = fmul contract float [[TMP0]], [[TMP0]]
6391 // NCRDIV-NEXT: [[ADD_I]] = fadd contract float [[__R_0_I4]], [[MUL_I]]
6392 // NCRDIV-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr [[__A_ADDR_0_I3]], i64 4
6393 // NCRDIV-NEXT: [[TOBOOL_NOT_I:%.*]] = icmp eq i32 [[DEC_I]], 0
6394 // NCRDIV-NEXT: br i1 [[TOBOOL_NOT_I]], label %[[_ZL6RNORMFIPKF_EXIT]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP23:![0-9]+]]
6395 // NCRDIV: [[_ZL6RNORMFIPKF_EXIT]]:
6396 // NCRDIV-NEXT: [[__R_0_I_LCSSA:%.*]] = phi float [ 0.000000e+00, %[[ENTRY]] ], [ [[ADD_I]], %[[WHILE_BODY_I]] ]
6397 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_rsqrt_f32(float noundef [[__R_0_I_LCSSA]]) #[[ATTR14]]
6398 // NCRDIV-NEXT: ret float [[CALL_I]]
6399 //
6400 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_rnormf(
6401 // AMDGCNSPIRV-SAME: i32 noundef [[X:%.*]], ptr addrspace(4) noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
6402 // AMDGCNSPIRV-NEXT: [[ENTRY:.*]]:
6403 // AMDGCNSPIRV-NEXT: [[TOBOOL_NOT_I1:%.*]] = icmp eq i32 [[X]], 0
6404 // AMDGCNSPIRV-NEXT: br i1 [[TOBOOL_NOT_I1]], label %[[_ZL6RNORMFIPKF_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
6405 // AMDGCNSPIRV: [[WHILE_BODY_I]]:
6406 // AMDGCNSPIRV-NEXT: [[__R_0_I4:%.*]] = phi float [ [[ADD_I:%.*]], %[[WHILE_BODY_I]] ], [ 0.000000e+00, %[[ENTRY]] ]
6407 // AMDGCNSPIRV-NEXT: [[__A_ADDR_0_I3:%.*]] = phi ptr addrspace(4) [ [[INCDEC_PTR_I:%.*]], %[[WHILE_BODY_I]] ], [ [[Y]], %[[ENTRY]] ]
6408 // AMDGCNSPIRV-NEXT: [[__DIM_ADDR_0_I2:%.*]] = phi i32 [ [[DEC_I:%.*]], %[[WHILE_BODY_I]] ], [ [[X]], %[[ENTRY]] ]
6409 // AMDGCNSPIRV-NEXT: [[DEC_I]] = add nsw i32 [[__DIM_ADDR_0_I2]], -1
6410 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = load float, ptr addrspace(4) [[__A_ADDR_0_I3]], align 4, !tbaa [[FLOAT_TBAA17]]
6411 // AMDGCNSPIRV-NEXT: [[MUL_I:%.*]] = fmul contract float [[TMP0]], [[TMP0]]
6412 // AMDGCNSPIRV-NEXT: [[ADD_I]] = fadd contract float [[__R_0_I4]], [[MUL_I]]
6413 // AMDGCNSPIRV-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr addrspace(4) [[__A_ADDR_0_I3]], i64 4
6414 // AMDGCNSPIRV-NEXT: [[TOBOOL_NOT_I:%.*]] = icmp eq i32 [[DEC_I]], 0
6415 // AMDGCNSPIRV-NEXT: br i1 [[TOBOOL_NOT_I]], label %[[_ZL6RNORMFIPKF_EXIT]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP23:![0-9]+]]
6416 // AMDGCNSPIRV: [[_ZL6RNORMFIPKF_EXIT]]:
6417 // AMDGCNSPIRV-NEXT: [[__R_0_I_LCSSA:%.*]] = phi float [ 0.000000e+00, %[[ENTRY]] ], [ [[ADD_I]], %[[WHILE_BODY_I]] ]
6418 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_rsqrt_f32(float noundef [[__R_0_I_LCSSA]]) #[[ATTR14]]
6419 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
6420 //
6421 extern "C" __device__ float test_rnormf(int x, const float* y) {
6422 return rnormf(x, y);
6423 }
6424
6425 // DEFAULT-LABEL: define dso_local noundef double @test_rnorm(
6426 // DEFAULT-SAME: i32 noundef [[X:%.*]], ptr noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
6427 // DEFAULT-NEXT: [[ENTRY:.*]]:
6428 // DEFAULT-NEXT: [[TOBOOL_NOT_I1:%.*]] = icmp eq i32 [[X]], 0
6429 // DEFAULT-NEXT: br i1 [[TOBOOL_NOT_I1]], label %[[_ZL5RNORMIPKD_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
6430 // DEFAULT: [[WHILE_BODY_I]]:
6431 // DEFAULT-NEXT: [[__R_0_I4:%.*]] = phi double [ [[ADD_I:%.*]], %[[WHILE_BODY_I]] ], [ 0.000000e+00, %[[ENTRY]] ]
6432 // DEFAULT-NEXT: [[__A_ADDR_0_I3:%.*]] = phi ptr [ [[INCDEC_PTR_I:%.*]], %[[WHILE_BODY_I]] ], [ [[Y]], %[[ENTRY]] ]
6433 // DEFAULT-NEXT: [[__DIM_ADDR_0_I2:%.*]] = phi i32 [ [[DEC_I:%.*]], %[[WHILE_BODY_I]] ], [ [[X]], %[[ENTRY]] ]
6434 // DEFAULT-NEXT: [[DEC_I]] = add nsw i32 [[__DIM_ADDR_0_I2]], -1
6435 // DEFAULT-NEXT: [[TMP0:%.*]] = load double, ptr [[__A_ADDR_0_I3]], align 8, !tbaa [[DOUBLE_TBAA18]]
6436 // DEFAULT-NEXT: [[MUL_I:%.*]] = fmul contract double [[TMP0]], [[TMP0]]
6437 // DEFAULT-NEXT: [[ADD_I]] = fadd contract double [[__R_0_I4]], [[MUL_I]]
6438 // DEFAULT-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr [[__A_ADDR_0_I3]], i64 8
6439 // DEFAULT-NEXT: [[TOBOOL_NOT_I:%.*]] = icmp eq i32 [[DEC_I]], 0
6440 // DEFAULT-NEXT: br i1 [[TOBOOL_NOT_I]], label %[[_ZL5RNORMIPKD_EXIT]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP23:![0-9]+]]
6441 // DEFAULT: [[_ZL5RNORMIPKD_EXIT]]:
6442 // DEFAULT-NEXT: [[__R_0_I_LCSSA:%.*]] = phi double [ 0.000000e+00, %[[ENTRY]] ], [ [[ADD_I]], %[[WHILE_BODY_I]] ]
6443 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_rsqrt_f64(double noundef [[__R_0_I_LCSSA]]) #[[ATTR14]]
6444 // DEFAULT-NEXT: ret double [[CALL_I]]
6445 //
6446 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_rnorm(
6447 // FINITEONLY-SAME: i32 noundef [[X:%.*]], ptr noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
6448 // FINITEONLY-NEXT: [[ENTRY:.*]]:
6449 // FINITEONLY-NEXT: [[TOBOOL_NOT_I1:%.*]] = icmp eq i32 [[X]], 0
6450 // FINITEONLY-NEXT: br i1 [[TOBOOL_NOT_I1]], label %[[_ZL5RNORMIPKD_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
6451 // FINITEONLY: [[WHILE_BODY_I]]:
6452 // FINITEONLY-NEXT: [[__R_0_I4:%.*]] = phi double [ [[ADD_I:%.*]], %[[WHILE_BODY_I]] ], [ 0.000000e+00, %[[ENTRY]] ]
6453 // FINITEONLY-NEXT: [[__A_ADDR_0_I3:%.*]] = phi ptr [ [[INCDEC_PTR_I:%.*]], %[[WHILE_BODY_I]] ], [ [[Y]], %[[ENTRY]] ]
6454 // FINITEONLY-NEXT: [[__DIM_ADDR_0_I2:%.*]] = phi i32 [ [[DEC_I:%.*]], %[[WHILE_BODY_I]] ], [ [[X]], %[[ENTRY]] ]
6455 // FINITEONLY-NEXT: [[DEC_I]] = add nsw i32 [[__DIM_ADDR_0_I2]], -1
6456 // FINITEONLY-NEXT: [[TMP0:%.*]] = load double, ptr [[__A_ADDR_0_I3]], align 8, !tbaa [[DOUBLE_TBAA18]]
6457 // FINITEONLY-NEXT: [[MUL_I:%.*]] = fmul nnan ninf contract double [[TMP0]], [[TMP0]]
6458 // FINITEONLY-NEXT: [[ADD_I]] = fadd nnan ninf contract double [[__R_0_I4]], [[MUL_I]]
6459 // FINITEONLY-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr [[__A_ADDR_0_I3]], i64 8
6460 // FINITEONLY-NEXT: [[TOBOOL_NOT_I:%.*]] = icmp eq i32 [[DEC_I]], 0
6461 // FINITEONLY-NEXT: br i1 [[TOBOOL_NOT_I]], label %[[_ZL5RNORMIPKD_EXIT]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP23:![0-9]+]]
6462 // FINITEONLY: [[_ZL5RNORMIPKD_EXIT]]:
6463 // FINITEONLY-NEXT: [[__R_0_I_LCSSA:%.*]] = phi double [ 0.000000e+00, %[[ENTRY]] ], [ [[ADD_I]], %[[WHILE_BODY_I]] ]
6464 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_rsqrt_f64(double noundef nofpclass(nan inf) [[__R_0_I_LCSSA]]) #[[ATTR14]]
6465 // FINITEONLY-NEXT: ret double [[CALL_I]]
6466 //
6467 // APPROX-LABEL: define dso_local noundef double @test_rnorm(
6468 // APPROX-SAME: i32 noundef [[X:%.*]], ptr noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
6469 // APPROX-NEXT: [[ENTRY:.*]]:
6470 // APPROX-NEXT: [[TOBOOL_NOT_I1:%.*]] = icmp eq i32 [[X]], 0
6471 // APPROX-NEXT: br i1 [[TOBOOL_NOT_I1]], label %[[_ZL5RNORMIPKD_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
6472 // APPROX: [[WHILE_BODY_I]]:
6473 // APPROX-NEXT: [[__R_0_I4:%.*]] = phi double [ [[ADD_I:%.*]], %[[WHILE_BODY_I]] ], [ 0.000000e+00, %[[ENTRY]] ]
6474 // APPROX-NEXT: [[__A_ADDR_0_I3:%.*]] = phi ptr [ [[INCDEC_PTR_I:%.*]], %[[WHILE_BODY_I]] ], [ [[Y]], %[[ENTRY]] ]
6475 // APPROX-NEXT: [[__DIM_ADDR_0_I2:%.*]] = phi i32 [ [[DEC_I:%.*]], %[[WHILE_BODY_I]] ], [ [[X]], %[[ENTRY]] ]
6476 // APPROX-NEXT: [[DEC_I]] = add nsw i32 [[__DIM_ADDR_0_I2]], -1
6477 // APPROX-NEXT: [[TMP0:%.*]] = load double, ptr [[__A_ADDR_0_I3]], align 8, !tbaa [[DOUBLE_TBAA18]]
6478 // APPROX-NEXT: [[MUL_I:%.*]] = fmul contract double [[TMP0]], [[TMP0]]
6479 // APPROX-NEXT: [[ADD_I]] = fadd contract double [[__R_0_I4]], [[MUL_I]]
6480 // APPROX-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr [[__A_ADDR_0_I3]], i64 8
6481 // APPROX-NEXT: [[TOBOOL_NOT_I:%.*]] = icmp eq i32 [[DEC_I]], 0
6482 // APPROX-NEXT: br i1 [[TOBOOL_NOT_I]], label %[[_ZL5RNORMIPKD_EXIT]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP23:![0-9]+]]
6483 // APPROX: [[_ZL5RNORMIPKD_EXIT]]:
6484 // APPROX-NEXT: [[__R_0_I_LCSSA:%.*]] = phi double [ 0.000000e+00, %[[ENTRY]] ], [ [[ADD_I]], %[[WHILE_BODY_I]] ]
6485 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_rsqrt_f64(double noundef [[__R_0_I_LCSSA]]) #[[ATTR14]]
6486 // APPROX-NEXT: ret double [[CALL_I]]
6487 //
6488 // NCRDIV-LABEL: define dso_local noundef double @test_rnorm(
6489 // NCRDIV-SAME: i32 noundef [[X:%.*]], ptr noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
6490 // NCRDIV-NEXT: [[ENTRY:.*]]:
6491 // NCRDIV-NEXT: [[TOBOOL_NOT_I1:%.*]] = icmp eq i32 [[X]], 0
6492 // NCRDIV-NEXT: br i1 [[TOBOOL_NOT_I1]], label %[[_ZL5RNORMIPKD_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
6493 // NCRDIV: [[WHILE_BODY_I]]:
6494 // NCRDIV-NEXT: [[__R_0_I4:%.*]] = phi double [ [[ADD_I:%.*]], %[[WHILE_BODY_I]] ], [ 0.000000e+00, %[[ENTRY]] ]
6495 // NCRDIV-NEXT: [[__A_ADDR_0_I3:%.*]] = phi ptr [ [[INCDEC_PTR_I:%.*]], %[[WHILE_BODY_I]] ], [ [[Y]], %[[ENTRY]] ]
6496 // NCRDIV-NEXT: [[__DIM_ADDR_0_I2:%.*]] = phi i32 [ [[DEC_I:%.*]], %[[WHILE_BODY_I]] ], [ [[X]], %[[ENTRY]] ]
6497 // NCRDIV-NEXT: [[DEC_I]] = add nsw i32 [[__DIM_ADDR_0_I2]], -1
6498 // NCRDIV-NEXT: [[TMP0:%.*]] = load double, ptr [[__A_ADDR_0_I3]], align 8, !tbaa [[DOUBLE_TBAA19]]
6499 // NCRDIV-NEXT: [[MUL_I:%.*]] = fmul contract double [[TMP0]], [[TMP0]]
6500 // NCRDIV-NEXT: [[ADD_I]] = fadd contract double [[__R_0_I4]], [[MUL_I]]
6501 // NCRDIV-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr [[__A_ADDR_0_I3]], i64 8
6502 // NCRDIV-NEXT: [[TOBOOL_NOT_I:%.*]] = icmp eq i32 [[DEC_I]], 0
6503 // NCRDIV-NEXT: br i1 [[TOBOOL_NOT_I]], label %[[_ZL5RNORMIPKD_EXIT]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP24:![0-9]+]]
6504 // NCRDIV: [[_ZL5RNORMIPKD_EXIT]]:
6505 // NCRDIV-NEXT: [[__R_0_I_LCSSA:%.*]] = phi double [ 0.000000e+00, %[[ENTRY]] ], [ [[ADD_I]], %[[WHILE_BODY_I]] ]
6506 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_rsqrt_f64(double noundef [[__R_0_I_LCSSA]]) #[[ATTR14]]
6507 // NCRDIV-NEXT: ret double [[CALL_I]]
6508 //
6509 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_rnorm(
6510 // AMDGCNSPIRV-SAME: i32 noundef [[X:%.*]], ptr addrspace(4) noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
6511 // AMDGCNSPIRV-NEXT: [[ENTRY:.*]]:
6512 // AMDGCNSPIRV-NEXT: [[TOBOOL_NOT_I1:%.*]] = icmp eq i32 [[X]], 0
6513 // AMDGCNSPIRV-NEXT: br i1 [[TOBOOL_NOT_I1]], label %[[_ZL5RNORMIPKD_EXIT:.*]], label %[[WHILE_BODY_I:.*]]
6514 // AMDGCNSPIRV: [[WHILE_BODY_I]]:
6515 // AMDGCNSPIRV-NEXT: [[__R_0_I4:%.*]] = phi double [ [[ADD_I:%.*]], %[[WHILE_BODY_I]] ], [ 0.000000e+00, %[[ENTRY]] ]
6516 // AMDGCNSPIRV-NEXT: [[__A_ADDR_0_I3:%.*]] = phi ptr addrspace(4) [ [[INCDEC_PTR_I:%.*]], %[[WHILE_BODY_I]] ], [ [[Y]], %[[ENTRY]] ]
6517 // AMDGCNSPIRV-NEXT: [[__DIM_ADDR_0_I2:%.*]] = phi i32 [ [[DEC_I:%.*]], %[[WHILE_BODY_I]] ], [ [[X]], %[[ENTRY]] ]
6518 // AMDGCNSPIRV-NEXT: [[DEC_I]] = add nsw i32 [[__DIM_ADDR_0_I2]], -1
6519 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = load double, ptr addrspace(4) [[__A_ADDR_0_I3]], align 8, !tbaa [[DOUBLE_TBAA19]]
6520 // AMDGCNSPIRV-NEXT: [[MUL_I:%.*]] = fmul contract double [[TMP0]], [[TMP0]]
6521 // AMDGCNSPIRV-NEXT: [[ADD_I]] = fadd contract double [[__R_0_I4]], [[MUL_I]]
6522 // AMDGCNSPIRV-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds nuw i8, ptr addrspace(4) [[__A_ADDR_0_I3]], i64 8
6523 // AMDGCNSPIRV-NEXT: [[TOBOOL_NOT_I:%.*]] = icmp eq i32 [[DEC_I]], 0
6524 // AMDGCNSPIRV-NEXT: br i1 [[TOBOOL_NOT_I]], label %[[_ZL5RNORMIPKD_EXIT]], label %[[WHILE_BODY_I]], !llvm.loop [[LOOP24:![0-9]+]]
6525 // AMDGCNSPIRV: [[_ZL5RNORMIPKD_EXIT]]:
6526 // AMDGCNSPIRV-NEXT: [[__R_0_I_LCSSA:%.*]] = phi double [ 0.000000e+00, %[[ENTRY]] ], [ [[ADD_I]], %[[WHILE_BODY_I]] ]
6527 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_rsqrt_f64(double noundef [[__R_0_I_LCSSA]]) #[[ATTR14]]
6528 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
6529 //
6530 extern "C" __device__ double test_rnorm(int x, const double* y) {
6531 return rnorm(x, y);
6532 }
6533
6534 // DEFAULT-LABEL: define dso_local noundef float @test_rnorm3df(
6535 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR4]] {
6536 // DEFAULT-NEXT: [[ENTRY:.*:]]
6537 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_rlen3_f32(float noundef [[X]], float noundef [[Y]], float noundef [[Z]]) #[[ATTR13]]
6538 // DEFAULT-NEXT: ret float [[CALL_I]]
6539 //
6540 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_rnorm3df(
6541 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]], float noundef nofpclass(nan inf) [[Z:%.*]]) local_unnamed_addr #[[ATTR4]] {
6542 // FINITEONLY-NEXT: [[ENTRY:.*:]]
6543 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_rlen3_f32(float noundef nofpclass(nan inf) [[X]], float noundef nofpclass(nan inf) [[Y]], float noundef nofpclass(nan inf) [[Z]]) #[[ATTR13]]
6544 // FINITEONLY-NEXT: ret float [[CALL_I]]
6545 //
6546 // APPROX-LABEL: define dso_local noundef float @test_rnorm3df(
6547 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR4]] {
6548 // APPROX-NEXT: [[ENTRY:.*:]]
6549 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_rlen3_f32(float noundef [[X]], float noundef [[Y]], float noundef [[Z]]) #[[ATTR13]]
6550 // APPROX-NEXT: ret float [[CALL_I]]
6551 //
6552 // NCRDIV-LABEL: define dso_local noundef float @test_rnorm3df(
6553 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR4]] {
6554 // NCRDIV-NEXT: [[ENTRY:.*:]]
6555 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_rlen3_f32(float noundef [[X]], float noundef [[Y]], float noundef [[Z]]) #[[ATTR13]]
6556 // NCRDIV-NEXT: ret float [[CALL_I]]
6557 //
6558 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_rnorm3df(
6559 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
6560 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
6561 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_rlen3_f32(float noundef [[X]], float noundef [[Y]], float noundef [[Z]]) #[[ATTR13]]
6562 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
6563 //
6564 extern "C" __device__ float test_rnorm3df(float x, float y, float z) {
6565 return rnorm3df(x, y, z);
6566 }
6567
6568 // DEFAULT-LABEL: define dso_local noundef double @test_rnorm3d(
6569 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR4]] {
6570 // DEFAULT-NEXT: [[ENTRY:.*:]]
6571 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_rlen3_f64(double noundef [[X]], double noundef [[Y]], double noundef [[Z]]) #[[ATTR13]]
6572 // DEFAULT-NEXT: ret double [[CALL_I]]
6573 //
6574 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_rnorm3d(
6575 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]], double noundef nofpclass(nan inf) [[Z:%.*]]) local_unnamed_addr #[[ATTR4]] {
6576 // FINITEONLY-NEXT: [[ENTRY:.*:]]
6577 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_rlen3_f64(double noundef nofpclass(nan inf) [[X]], double noundef nofpclass(nan inf) [[Y]], double noundef nofpclass(nan inf) [[Z]]) #[[ATTR13]]
6578 // FINITEONLY-NEXT: ret double [[CALL_I]]
6579 //
6580 // APPROX-LABEL: define dso_local noundef double @test_rnorm3d(
6581 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR4]] {
6582 // APPROX-NEXT: [[ENTRY:.*:]]
6583 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_rlen3_f64(double noundef [[X]], double noundef [[Y]], double noundef [[Z]]) #[[ATTR13]]
6584 // APPROX-NEXT: ret double [[CALL_I]]
6585 //
6586 // NCRDIV-LABEL: define dso_local noundef double @test_rnorm3d(
6587 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR4]] {
6588 // NCRDIV-NEXT: [[ENTRY:.*:]]
6589 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_rlen3_f64(double noundef [[X]], double noundef [[Y]], double noundef [[Z]]) #[[ATTR13]]
6590 // NCRDIV-NEXT: ret double [[CALL_I]]
6591 //
6592 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_rnorm3d(
6593 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
6594 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
6595 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_rlen3_f64(double noundef [[X]], double noundef [[Y]], double noundef [[Z]]) #[[ATTR13]]
6596 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
6597 //
6598 extern "C" __device__ double test_rnorm3d(double x, double y, double z) {
6599 return rnorm3d(x, y, z);
6600 }
6601
6602 // DEFAULT-LABEL: define dso_local noundef float @test_rnorm4df(
6603 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]], float noundef [[W:%.*]]) local_unnamed_addr #[[ATTR4]] {
6604 // DEFAULT-NEXT: [[ENTRY:.*:]]
6605 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_rlen4_f32(float noundef [[X]], float noundef [[Y]], float noundef [[Z]], float noundef [[W]]) #[[ATTR13]]
6606 // DEFAULT-NEXT: ret float [[CALL_I]]
6607 //
6608 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_rnorm4df(
6609 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]], float noundef nofpclass(nan inf) [[Z:%.*]], float noundef nofpclass(nan inf) [[W:%.*]]) local_unnamed_addr #[[ATTR4]] {
6610 // FINITEONLY-NEXT: [[ENTRY:.*:]]
6611 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_rlen4_f32(float noundef nofpclass(nan inf) [[X]], float noundef nofpclass(nan inf) [[Y]], float noundef nofpclass(nan inf) [[Z]], float noundef nofpclass(nan inf) [[W]]) #[[ATTR13]]
6612 // FINITEONLY-NEXT: ret float [[CALL_I]]
6613 //
6614 // APPROX-LABEL: define dso_local noundef float @test_rnorm4df(
6615 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]], float noundef [[W:%.*]]) local_unnamed_addr #[[ATTR4]] {
6616 // APPROX-NEXT: [[ENTRY:.*:]]
6617 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_rlen4_f32(float noundef [[X]], float noundef [[Y]], float noundef [[Z]], float noundef [[W]]) #[[ATTR13]]
6618 // APPROX-NEXT: ret float [[CALL_I]]
6619 //
6620 // NCRDIV-LABEL: define dso_local noundef float @test_rnorm4df(
6621 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]], float noundef [[W:%.*]]) local_unnamed_addr #[[ATTR4]] {
6622 // NCRDIV-NEXT: [[ENTRY:.*:]]
6623 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_rlen4_f32(float noundef [[X]], float noundef [[Y]], float noundef [[Z]], float noundef [[W]]) #[[ATTR13]]
6624 // NCRDIV-NEXT: ret float [[CALL_I]]
6625 //
6626 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_rnorm4df(
6627 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]], float noundef [[W:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
6628 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
6629 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_rlen4_f32(float noundef [[X]], float noundef [[Y]], float noundef [[Z]], float noundef [[W]]) #[[ATTR13]]
6630 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
6631 //
6632 extern "C" __device__ float test_rnorm4df(float x, float y, float z, float w) {
6633 return rnorm4df(x, y, z, w);
6634 }
6635
6636 // DEFAULT-LABEL: define dso_local noundef double @test_rnorm4d(
6637 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]], double noundef [[W:%.*]]) local_unnamed_addr #[[ATTR4]] {
6638 // DEFAULT-NEXT: [[ENTRY:.*:]]
6639 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_rlen4_f64(double noundef [[X]], double noundef [[Y]], double noundef [[Z]], double noundef [[W]]) #[[ATTR13]]
6640 // DEFAULT-NEXT: ret double [[CALL_I]]
6641 //
6642 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_rnorm4d(
6643 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]], double noundef nofpclass(nan inf) [[Z:%.*]], double noundef nofpclass(nan inf) [[W:%.*]]) local_unnamed_addr #[[ATTR4]] {
6644 // FINITEONLY-NEXT: [[ENTRY:.*:]]
6645 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_rlen4_f64(double noundef nofpclass(nan inf) [[X]], double noundef nofpclass(nan inf) [[Y]], double noundef nofpclass(nan inf) [[Z]], double noundef nofpclass(nan inf) [[W]]) #[[ATTR13]]
6646 // FINITEONLY-NEXT: ret double [[CALL_I]]
6647 //
6648 // APPROX-LABEL: define dso_local noundef double @test_rnorm4d(
6649 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]], double noundef [[W:%.*]]) local_unnamed_addr #[[ATTR4]] {
6650 // APPROX-NEXT: [[ENTRY:.*:]]
6651 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_rlen4_f64(double noundef [[X]], double noundef [[Y]], double noundef [[Z]], double noundef [[W]]) #[[ATTR13]]
6652 // APPROX-NEXT: ret double [[CALL_I]]
6653 //
6654 // NCRDIV-LABEL: define dso_local noundef double @test_rnorm4d(
6655 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]], double noundef [[W:%.*]]) local_unnamed_addr #[[ATTR4]] {
6656 // NCRDIV-NEXT: [[ENTRY:.*:]]
6657 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_rlen4_f64(double noundef [[X]], double noundef [[Y]], double noundef [[Z]], double noundef [[W]]) #[[ATTR13]]
6658 // NCRDIV-NEXT: ret double [[CALL_I]]
6659 //
6660 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_rnorm4d(
6661 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]], double noundef [[W:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
6662 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
6663 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_rlen4_f64(double noundef [[X]], double noundef [[Y]], double noundef [[Z]], double noundef [[W]]) #[[ATTR13]]
6664 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
6665 //
6666 extern "C" __device__ double test_rnorm4d(double x, double y, double z, double w) {
6667 return rnorm4d(x, y, z, w);
6668 }
6669
6670 // DEFAULT-LABEL: define dso_local noundef float @test_roundf(
6671 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
6672 // DEFAULT-NEXT: [[ENTRY:.*:]]
6673 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.round.f32(float [[X]])
6674 // DEFAULT-NEXT: ret float [[TMP0]]
6675 //
6676 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_roundf(
6677 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
6678 // FINITEONLY-NEXT: [[ENTRY:.*:]]
6679 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.round.f32(float nofpclass(nan inf) [[X]])
6680 // FINITEONLY-NEXT: ret float [[TMP0]]
6681 //
6682 // APPROX-LABEL: define dso_local noundef float @test_roundf(
6683 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
6684 // APPROX-NEXT: [[ENTRY:.*:]]
6685 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.round.f32(float [[X]])
6686 // APPROX-NEXT: ret float [[TMP0]]
6687 //
6688 // NCRDIV-LABEL: define dso_local noundef float @test_roundf(
6689 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
6690 // NCRDIV-NEXT: [[ENTRY:.*:]]
6691 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.round.f32(float [[X]])
6692 // NCRDIV-NEXT: ret float [[TMP0]]
6693 //
6694 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_roundf(
6695 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
6696 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
6697 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.round.f32(float [[X]])
6698 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
6699 //
6700 extern "C" __device__ float test_roundf(float x) {
6701 return roundf(x);
6702 }
6703
6704 // DEFAULT-LABEL: define dso_local noundef double @test_round(
6705 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
6706 // DEFAULT-NEXT: [[ENTRY:.*:]]
6707 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.round.f64(double [[X]])
6708 // DEFAULT-NEXT: ret double [[TMP0]]
6709 //
6710 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_round(
6711 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
6712 // FINITEONLY-NEXT: [[ENTRY:.*:]]
6713 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef double @llvm.round.f64(double nofpclass(nan inf) [[X]])
6714 // FINITEONLY-NEXT: ret double [[TMP0]]
6715 //
6716 // APPROX-LABEL: define dso_local noundef double @test_round(
6717 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
6718 // APPROX-NEXT: [[ENTRY:.*:]]
6719 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.round.f64(double [[X]])
6720 // APPROX-NEXT: ret double [[TMP0]]
6721 //
6722 // NCRDIV-LABEL: define dso_local noundef double @test_round(
6723 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
6724 // NCRDIV-NEXT: [[ENTRY:.*:]]
6725 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.round.f64(double [[X]])
6726 // NCRDIV-NEXT: ret double [[TMP0]]
6727 //
6728 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_round(
6729 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
6730 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
6731 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) double @llvm.round.f64(double [[X]])
6732 // AMDGCNSPIRV-NEXT: ret double [[TMP0]]
6733 //
6734 extern "C" __device__ double test_round(double x) {
6735 return round(x);
6736 }
6737
6738 // DEFAULT-LABEL: define dso_local noundef float @test_rsqrtf(
6739 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
6740 // DEFAULT-NEXT: [[ENTRY:.*:]]
6741 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_rsqrt_f32(float noundef [[X]]) #[[ATTR14]]
6742 // DEFAULT-NEXT: ret float [[CALL_I]]
6743 //
6744 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_rsqrtf(
6745 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
6746 // FINITEONLY-NEXT: [[ENTRY:.*:]]
6747 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_rsqrt_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
6748 // FINITEONLY-NEXT: ret float [[CALL_I]]
6749 //
6750 // APPROX-LABEL: define dso_local noundef float @test_rsqrtf(
6751 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
6752 // APPROX-NEXT: [[ENTRY:.*:]]
6753 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_rsqrt_f32(float noundef [[X]]) #[[ATTR14]]
6754 // APPROX-NEXT: ret float [[CALL_I]]
6755 //
6756 // NCRDIV-LABEL: define dso_local noundef float @test_rsqrtf(
6757 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
6758 // NCRDIV-NEXT: [[ENTRY:.*:]]
6759 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_rsqrt_f32(float noundef [[X]]) #[[ATTR14]]
6760 // NCRDIV-NEXT: ret float [[CALL_I]]
6761 //
6762 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_rsqrtf(
6763 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
6764 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
6765 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_rsqrt_f32(float noundef [[X]]) #[[ATTR14]]
6766 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
6767 //
6768 extern "C" __device__ float test_rsqrtf(float x) {
6769 return rsqrtf(x);
6770 }
6771
6772 // DEFAULT-LABEL: define dso_local noundef double @test_rsqrt(
6773 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
6774 // DEFAULT-NEXT: [[ENTRY:.*:]]
6775 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_rsqrt_f64(double noundef [[X]]) #[[ATTR14]]
6776 // DEFAULT-NEXT: ret double [[CALL_I]]
6777 //
6778 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_rsqrt(
6779 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
6780 // FINITEONLY-NEXT: [[ENTRY:.*:]]
6781 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_rsqrt_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
6782 // FINITEONLY-NEXT: ret double [[CALL_I]]
6783 //
6784 // APPROX-LABEL: define dso_local noundef double @test_rsqrt(
6785 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
6786 // APPROX-NEXT: [[ENTRY:.*:]]
6787 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_rsqrt_f64(double noundef [[X]]) #[[ATTR14]]
6788 // APPROX-NEXT: ret double [[CALL_I]]
6789 //
6790 // NCRDIV-LABEL: define dso_local noundef double @test_rsqrt(
6791 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
6792 // NCRDIV-NEXT: [[ENTRY:.*:]]
6793 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_rsqrt_f64(double noundef [[X]]) #[[ATTR14]]
6794 // NCRDIV-NEXT: ret double [[CALL_I]]
6795 //
6796 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_rsqrt(
6797 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
6798 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
6799 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_rsqrt_f64(double noundef [[X]]) #[[ATTR14]]
6800 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
6801 //
6802 extern "C" __device__ double test_rsqrt(double x) {
6803 return rsqrt(x);
6804 }
6805
6806 // DEFAULT-LABEL: define dso_local noundef float @test_scalblnf(
6807 // DEFAULT-SAME: float noundef [[X:%.*]], i64 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
6808 // DEFAULT-NEXT: [[ENTRY:.*:]]
6809 // DEFAULT-NEXT: [[SPEC_STORE_SELECT_I:%.*]] = tail call i64 @llvm.smax.i64(i64 [[Y]], i64 -2147483648)
6810 // DEFAULT-NEXT: [[CONV_I:%.*]] = trunc i64 [[SPEC_STORE_SELECT_I]] to i32
6811 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.ldexp.f32.i32(float [[X]], i32 [[CONV_I]])
6812 // DEFAULT-NEXT: ret float [[TMP0]]
6813 //
6814 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_scalblnf(
6815 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], i64 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
6816 // FINITEONLY-NEXT: [[ENTRY:.*:]]
6817 // FINITEONLY-NEXT: [[SPEC_STORE_SELECT_I:%.*]] = tail call i64 @llvm.smax.i64(i64 [[Y]], i64 -2147483648)
6818 // FINITEONLY-NEXT: [[CONV_I:%.*]] = trunc i64 [[SPEC_STORE_SELECT_I]] to i32
6819 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.ldexp.f32.i32(float nofpclass(nan inf) [[X]], i32 [[CONV_I]])
6820 // FINITEONLY-NEXT: ret float [[TMP0]]
6821 //
6822 // APPROX-LABEL: define dso_local noundef float @test_scalblnf(
6823 // APPROX-SAME: float noundef [[X:%.*]], i64 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
6824 // APPROX-NEXT: [[ENTRY:.*:]]
6825 // APPROX-NEXT: [[SPEC_STORE_SELECT_I:%.*]] = tail call i64 @llvm.smax.i64(i64 [[Y]], i64 -2147483648)
6826 // APPROX-NEXT: [[CONV_I:%.*]] = trunc i64 [[SPEC_STORE_SELECT_I]] to i32
6827 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.ldexp.f32.i32(float [[X]], i32 [[CONV_I]])
6828 // APPROX-NEXT: ret float [[TMP0]]
6829 //
6830 // NCRDIV-LABEL: define dso_local noundef float @test_scalblnf(
6831 // NCRDIV-SAME: float noundef [[X:%.*]], i64 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
6832 // NCRDIV-NEXT: [[ENTRY:.*:]]
6833 // NCRDIV-NEXT: [[SPEC_STORE_SELECT_I:%.*]] = tail call i64 @llvm.smax.i64(i64 [[Y]], i64 -2147483648)
6834 // NCRDIV-NEXT: [[CONV_I:%.*]] = trunc i64 [[SPEC_STORE_SELECT_I]] to i32
6835 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.ldexp.f32.i32(float [[X]], i32 [[CONV_I]])
6836 // NCRDIV-NEXT: ret float [[TMP0]]
6837 //
6838 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_scalblnf(
6839 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], i64 noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
6840 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
6841 // AMDGCNSPIRV-NEXT: [[SPEC_STORE_SELECT_I:%.*]] = tail call addrspace(4) i64 @llvm.smax.i64(i64 [[Y]], i64 -2147483648)
6842 // AMDGCNSPIRV-NEXT: [[CONV_I:%.*]] = trunc i64 [[SPEC_STORE_SELECT_I]] to i32
6843 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.ldexp.f32.i32(float [[X]], i32 [[CONV_I]])
6844 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
6845 //
6846 extern "C" __device__ float test_scalblnf(float x, long int y) {
6847 return scalblnf(x, y);
6848 }
6849
6850 // DEFAULT-LABEL: define dso_local noundef double @test_scalbln(
6851 // DEFAULT-SAME: double noundef [[X:%.*]], i64 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
6852 // DEFAULT-NEXT: [[ENTRY:.*:]]
6853 // DEFAULT-NEXT: [[SPEC_STORE_SELECT_I:%.*]] = tail call i64 @llvm.smax.i64(i64 [[Y]], i64 -2147483648)
6854 // DEFAULT-NEXT: [[CONV_I:%.*]] = trunc i64 [[SPEC_STORE_SELECT_I]] to i32
6855 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.ldexp.f64.i32(double [[X]], i32 [[CONV_I]])
6856 // DEFAULT-NEXT: ret double [[TMP0]]
6857 //
6858 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_scalbln(
6859 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], i64 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
6860 // FINITEONLY-NEXT: [[ENTRY:.*:]]
6861 // FINITEONLY-NEXT: [[SPEC_STORE_SELECT_I:%.*]] = tail call i64 @llvm.smax.i64(i64 [[Y]], i64 -2147483648)
6862 // FINITEONLY-NEXT: [[CONV_I:%.*]] = trunc i64 [[SPEC_STORE_SELECT_I]] to i32
6863 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef double @llvm.ldexp.f64.i32(double nofpclass(nan inf) [[X]], i32 [[CONV_I]])
6864 // FINITEONLY-NEXT: ret double [[TMP0]]
6865 //
6866 // APPROX-LABEL: define dso_local noundef double @test_scalbln(
6867 // APPROX-SAME: double noundef [[X:%.*]], i64 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
6868 // APPROX-NEXT: [[ENTRY:.*:]]
6869 // APPROX-NEXT: [[SPEC_STORE_SELECT_I:%.*]] = tail call i64 @llvm.smax.i64(i64 [[Y]], i64 -2147483648)
6870 // APPROX-NEXT: [[CONV_I:%.*]] = trunc i64 [[SPEC_STORE_SELECT_I]] to i32
6871 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.ldexp.f64.i32(double [[X]], i32 [[CONV_I]])
6872 // APPROX-NEXT: ret double [[TMP0]]
6873 //
6874 // NCRDIV-LABEL: define dso_local noundef double @test_scalbln(
6875 // NCRDIV-SAME: double noundef [[X:%.*]], i64 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
6876 // NCRDIV-NEXT: [[ENTRY:.*:]]
6877 // NCRDIV-NEXT: [[SPEC_STORE_SELECT_I:%.*]] = tail call i64 @llvm.smax.i64(i64 [[Y]], i64 -2147483648)
6878 // NCRDIV-NEXT: [[CONV_I:%.*]] = trunc i64 [[SPEC_STORE_SELECT_I]] to i32
6879 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.ldexp.f64.i32(double [[X]], i32 [[CONV_I]])
6880 // NCRDIV-NEXT: ret double [[TMP0]]
6881 //
6882 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_scalbln(
6883 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], i64 noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
6884 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
6885 // AMDGCNSPIRV-NEXT: [[SPEC_STORE_SELECT_I:%.*]] = tail call addrspace(4) i64 @llvm.smax.i64(i64 [[Y]], i64 -2147483648)
6886 // AMDGCNSPIRV-NEXT: [[CONV_I:%.*]] = trunc i64 [[SPEC_STORE_SELECT_I]] to i32
6887 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) double @llvm.ldexp.f64.i32(double [[X]], i32 [[CONV_I]])
6888 // AMDGCNSPIRV-NEXT: ret double [[TMP0]]
6889 //
6890 extern "C" __device__ double test_scalbln(double x, long int y) {
6891 return scalbln(x, y);
6892 }
6893
6894 // DEFAULT-LABEL: define dso_local noundef float @test_scalbnf(
6895 // DEFAULT-SAME: float noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
6896 // DEFAULT-NEXT: [[ENTRY:.*:]]
6897 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.ldexp.f32.i32(float [[X]], i32 [[Y]])
6898 // DEFAULT-NEXT: ret float [[TMP0]]
6899 //
6900 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_scalbnf(
6901 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
6902 // FINITEONLY-NEXT: [[ENTRY:.*:]]
6903 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.ldexp.f32.i32(float nofpclass(nan inf) [[X]], i32 [[Y]])
6904 // FINITEONLY-NEXT: ret float [[TMP0]]
6905 //
6906 // APPROX-LABEL: define dso_local noundef float @test_scalbnf(
6907 // APPROX-SAME: float noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
6908 // APPROX-NEXT: [[ENTRY:.*:]]
6909 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.ldexp.f32.i32(float [[X]], i32 [[Y]])
6910 // APPROX-NEXT: ret float [[TMP0]]
6911 //
6912 // NCRDIV-LABEL: define dso_local noundef float @test_scalbnf(
6913 // NCRDIV-SAME: float noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
6914 // NCRDIV-NEXT: [[ENTRY:.*:]]
6915 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.ldexp.f32.i32(float [[X]], i32 [[Y]])
6916 // NCRDIV-NEXT: ret float [[TMP0]]
6917 //
6918 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_scalbnf(
6919 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
6920 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
6921 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.ldexp.f32.i32(float [[X]], i32 [[Y]])
6922 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
6923 //
6924 extern "C" __device__ float test_scalbnf(float x, int y) {
6925 return scalbnf(x, y);
6926 }
6927
6928 // DEFAULT-LABEL: define dso_local noundef double @test_scalbn(
6929 // DEFAULT-SAME: double noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
6930 // DEFAULT-NEXT: [[ENTRY:.*:]]
6931 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.ldexp.f64.i32(double [[X]], i32 [[Y]])
6932 // DEFAULT-NEXT: ret double [[TMP0]]
6933 //
6934 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_scalbn(
6935 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
6936 // FINITEONLY-NEXT: [[ENTRY:.*:]]
6937 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef double @llvm.ldexp.f64.i32(double nofpclass(nan inf) [[X]], i32 [[Y]])
6938 // FINITEONLY-NEXT: ret double [[TMP0]]
6939 //
6940 // APPROX-LABEL: define dso_local noundef double @test_scalbn(
6941 // APPROX-SAME: double noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
6942 // APPROX-NEXT: [[ENTRY:.*:]]
6943 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.ldexp.f64.i32(double [[X]], i32 [[Y]])
6944 // APPROX-NEXT: ret double [[TMP0]]
6945 //
6946 // NCRDIV-LABEL: define dso_local noundef double @test_scalbn(
6947 // NCRDIV-SAME: double noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
6948 // NCRDIV-NEXT: [[ENTRY:.*:]]
6949 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.ldexp.f64.i32(double [[X]], i32 [[Y]])
6950 // NCRDIV-NEXT: ret double [[TMP0]]
6951 //
6952 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_scalbn(
6953 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
6954 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
6955 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) double @llvm.ldexp.f64.i32(double [[X]], i32 [[Y]])
6956 // AMDGCNSPIRV-NEXT: ret double [[TMP0]]
6957 //
6958 extern "C" __device__ double test_scalbn(double x, int y) {
6959 return scalbn(x, y);
6960 }
6961
6962 // DEFAULT-LABEL: define dso_local noundef range(i32 0, 2) i32 @test___signbitf(
6963 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
6964 // DEFAULT-NEXT: [[ENTRY:.*:]]
6965 // DEFAULT-NEXT: [[TMP0:%.*]] = bitcast float [[X]] to i32
6966 // DEFAULT-NEXT: [[DOTLOBIT:%.*]] = lshr i32 [[TMP0]], 31
6967 // DEFAULT-NEXT: ret i32 [[DOTLOBIT]]
6968 //
6969 // FINITEONLY-LABEL: define dso_local noundef range(i32 0, 2) i32 @test___signbitf(
6970 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
6971 // FINITEONLY-NEXT: [[ENTRY:.*:]]
6972 // FINITEONLY-NEXT: [[TMP0:%.*]] = bitcast float [[X]] to i32
6973 // FINITEONLY-NEXT: [[DOTLOBIT:%.*]] = lshr i32 [[TMP0]], 31
6974 // FINITEONLY-NEXT: ret i32 [[DOTLOBIT]]
6975 //
6976 // APPROX-LABEL: define dso_local noundef range(i32 0, 2) i32 @test___signbitf(
6977 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
6978 // APPROX-NEXT: [[ENTRY:.*:]]
6979 // APPROX-NEXT: [[TMP0:%.*]] = bitcast float [[X]] to i32
6980 // APPROX-NEXT: [[DOTLOBIT:%.*]] = lshr i32 [[TMP0]], 31
6981 // APPROX-NEXT: ret i32 [[DOTLOBIT]]
6982 //
6983 // NCRDIV-LABEL: define dso_local noundef range(i32 0, 2) i32 @test___signbitf(
6984 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
6985 // NCRDIV-NEXT: [[ENTRY:.*:]]
6986 // NCRDIV-NEXT: [[TMP0:%.*]] = bitcast float [[X]] to i32
6987 // NCRDIV-NEXT: [[DOTLOBIT:%.*]] = lshr i32 [[TMP0]], 31
6988 // NCRDIV-NEXT: ret i32 [[DOTLOBIT]]
6989 //
6990 // AMDGCNSPIRV-LABEL: define spir_func noundef range(i32 0, 2) i32 @test___signbitf(
6991 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
6992 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
6993 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = bitcast float [[X]] to i32
6994 // AMDGCNSPIRV-NEXT: [[DOTLOBIT:%.*]] = lshr i32 [[TMP0]], 31
6995 // AMDGCNSPIRV-NEXT: ret i32 [[DOTLOBIT]]
6996 //
6997 extern "C" __device__ BOOL_TYPE test___signbitf(float x) {
6998 return __signbitf(x);
6999 }
7000
7001 // DEFAULT-LABEL: define dso_local range(i32 0, 2) i32 @test___signbit(
7002 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
7003 // DEFAULT-NEXT: [[ENTRY:.*:]]
7004 // DEFAULT-NEXT: [[TMP0:%.*]] = bitcast double [[X]] to i64
7005 // DEFAULT-NEXT: [[DOTLOBIT:%.*]] = lshr i64 [[TMP0]], 63
7006 // DEFAULT-NEXT: [[CONV:%.*]] = trunc nuw nsw i64 [[DOTLOBIT]] to i32
7007 // DEFAULT-NEXT: ret i32 [[CONV]]
7008 //
7009 // FINITEONLY-LABEL: define dso_local range(i32 0, 2) i32 @test___signbit(
7010 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
7011 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7012 // FINITEONLY-NEXT: [[TMP0:%.*]] = bitcast double [[X]] to i64
7013 // FINITEONLY-NEXT: [[DOTLOBIT:%.*]] = lshr i64 [[TMP0]], 63
7014 // FINITEONLY-NEXT: [[CONV:%.*]] = trunc nuw nsw i64 [[DOTLOBIT]] to i32
7015 // FINITEONLY-NEXT: ret i32 [[CONV]]
7016 //
7017 // APPROX-LABEL: define dso_local range(i32 0, 2) i32 @test___signbit(
7018 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
7019 // APPROX-NEXT: [[ENTRY:.*:]]
7020 // APPROX-NEXT: [[TMP0:%.*]] = bitcast double [[X]] to i64
7021 // APPROX-NEXT: [[DOTLOBIT:%.*]] = lshr i64 [[TMP0]], 63
7022 // APPROX-NEXT: [[CONV:%.*]] = trunc nuw nsw i64 [[DOTLOBIT]] to i32
7023 // APPROX-NEXT: ret i32 [[CONV]]
7024 //
7025 // NCRDIV-LABEL: define dso_local range(i32 0, 2) i32 @test___signbit(
7026 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
7027 // NCRDIV-NEXT: [[ENTRY:.*:]]
7028 // NCRDIV-NEXT: [[TMP0:%.*]] = bitcast double [[X]] to i64
7029 // NCRDIV-NEXT: [[DOTLOBIT:%.*]] = lshr i64 [[TMP0]], 63
7030 // NCRDIV-NEXT: [[CONV:%.*]] = trunc nuw nsw i64 [[DOTLOBIT]] to i32
7031 // NCRDIV-NEXT: ret i32 [[CONV]]
7032 //
7033 // AMDGCNSPIRV-LABEL: define spir_func range(i32 0, 2) i32 @test___signbit(
7034 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
7035 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7036 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = bitcast double [[X]] to i64
7037 // AMDGCNSPIRV-NEXT: [[DOTLOBIT:%.*]] = lshr i64 [[TMP0]], 63
7038 // AMDGCNSPIRV-NEXT: [[CONV:%.*]] = trunc nuw nsw i64 [[DOTLOBIT]] to i32
7039 // AMDGCNSPIRV-NEXT: ret i32 [[CONV]]
7040 //
7041 extern "C" __device__ BOOL_TYPE test___signbit(double x) {
7042 return __signbit(x);
7043 }
7044
7045 // DEFAULT-LABEL: define dso_local void @test_sincosf(
7046 // DEFAULT-SAME: float noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
7047 // DEFAULT-NEXT: [[ENTRY:.*:]]
7048 // DEFAULT-NEXT: [[__TMP_I:%.*]] = alloca float, align 4, addrspace(5)
7049 // DEFAULT-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7050 // DEFAULT-NEXT: [[CALL_I:%.*]] = call contract float @__ocml_sincos_f32(float noundef [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
7051 // DEFAULT-NEXT: store float [[CALL_I]], ptr [[Y]], align 4, !tbaa [[FLOAT_TBAA16]]
7052 // DEFAULT-NEXT: [[TMP0:%.*]] = load float, ptr addrspace(5) [[__TMP_I]], align 4, !tbaa [[FLOAT_TBAA16]]
7053 // DEFAULT-NEXT: store float [[TMP0]], ptr [[Z]], align 4, !tbaa [[FLOAT_TBAA16]]
7054 // DEFAULT-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7055 // DEFAULT-NEXT: ret void
7056 //
7057 // FINITEONLY-LABEL: define dso_local void @test_sincosf(
7058 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
7059 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7060 // FINITEONLY-NEXT: [[__TMP_I:%.*]] = alloca float, align 4, addrspace(5)
7061 // FINITEONLY-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7062 // FINITEONLY-NEXT: [[CALL_I:%.*]] = call nnan ninf contract nofpclass(nan inf) float @__ocml_sincos_f32(float noundef nofpclass(nan inf) [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
7063 // FINITEONLY-NEXT: store float [[CALL_I]], ptr [[Y]], align 4, !tbaa [[FLOAT_TBAA16]]
7064 // FINITEONLY-NEXT: [[TMP0:%.*]] = load float, ptr addrspace(5) [[__TMP_I]], align 4, !tbaa [[FLOAT_TBAA16]]
7065 // FINITEONLY-NEXT: store float [[TMP0]], ptr [[Z]], align 4, !tbaa [[FLOAT_TBAA16]]
7066 // FINITEONLY-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7067 // FINITEONLY-NEXT: ret void
7068 //
7069 // APPROX-LABEL: define dso_local void @test_sincosf(
7070 // APPROX-SAME: float noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
7071 // APPROX-NEXT: [[ENTRY:.*:]]
7072 // APPROX-NEXT: [[__TMP_I:%.*]] = alloca float, align 4, addrspace(5)
7073 // APPROX-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7074 // APPROX-NEXT: [[CALL_I:%.*]] = call contract float @__ocml_sincos_f32(float noundef [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
7075 // APPROX-NEXT: store float [[CALL_I]], ptr [[Y]], align 4, !tbaa [[FLOAT_TBAA16]]
7076 // APPROX-NEXT: [[TMP0:%.*]] = load float, ptr addrspace(5) [[__TMP_I]], align 4, !tbaa [[FLOAT_TBAA16]]
7077 // APPROX-NEXT: store float [[TMP0]], ptr [[Z]], align 4, !tbaa [[FLOAT_TBAA16]]
7078 // APPROX-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7079 // APPROX-NEXT: ret void
7080 //
7081 // NCRDIV-LABEL: define dso_local void @test_sincosf(
7082 // NCRDIV-SAME: float noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
7083 // NCRDIV-NEXT: [[ENTRY:.*:]]
7084 // NCRDIV-NEXT: [[__TMP_I:%.*]] = alloca float, align 4, addrspace(5)
7085 // NCRDIV-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7086 // NCRDIV-NEXT: [[CALL_I:%.*]] = call contract float @__ocml_sincos_f32(float noundef [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
7087 // NCRDIV-NEXT: store float [[CALL_I]], ptr [[Y]], align 4, !tbaa [[FLOAT_TBAA17]]
7088 // NCRDIV-NEXT: [[TMP0:%.*]] = load float, ptr addrspace(5) [[__TMP_I]], align 4, !tbaa [[FLOAT_TBAA17]]
7089 // NCRDIV-NEXT: store float [[TMP0]], ptr [[Z]], align 4, !tbaa [[FLOAT_TBAA17]]
7090 // NCRDIV-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7091 // NCRDIV-NEXT: ret void
7092 //
7093 // AMDGCNSPIRV-LABEL: define spir_func void @test_sincosf(
7094 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], ptr addrspace(4) noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]], ptr addrspace(4) noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
7095 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7096 // AMDGCNSPIRV-NEXT: [[__TMP_I:%.*]] = alloca float, align 4
7097 // AMDGCNSPIRV-NEXT: [[__TMP_ASCAST_I:%.*]] = addrspacecast ptr [[__TMP_I]] to ptr addrspace(4)
7098 // AMDGCNSPIRV-NEXT: call addrspace(4) void @llvm.lifetime.start.p0(ptr nonnull [[__TMP_I]]) #[[ATTR16]]
7099 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = call contract spir_func addrspace(4) float @__ocml_sincos_f32(float noundef [[X]], ptr noundef nonnull [[__TMP_I]]) #[[ATTR15]]
7100 // AMDGCNSPIRV-NEXT: store float [[CALL_I]], ptr addrspace(4) [[Y]], align 4, !tbaa [[FLOAT_TBAA17]]
7101 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = load float, ptr addrspace(4) [[__TMP_ASCAST_I]], align 4, !tbaa [[FLOAT_TBAA17]]
7102 // AMDGCNSPIRV-NEXT: store float [[TMP0]], ptr addrspace(4) [[Z]], align 4, !tbaa [[FLOAT_TBAA17]]
7103 // AMDGCNSPIRV-NEXT: call addrspace(4) void @llvm.lifetime.end.p0(ptr nonnull [[__TMP_I]]) #[[ATTR16]]
7104 // AMDGCNSPIRV-NEXT: ret void
7105 //
7106 extern "C" __device__ void test_sincosf(float x, float *y, float *z) {
7107 sincosf(x, y, z);
7108 }
7109
7110 // DEFAULT-LABEL: define dso_local void @test_sincos(
7111 // DEFAULT-SAME: double noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
7112 // DEFAULT-NEXT: [[ENTRY:.*:]]
7113 // DEFAULT-NEXT: [[__TMP_I:%.*]] = alloca double, align 8, addrspace(5)
7114 // DEFAULT-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7115 // DEFAULT-NEXT: [[CALL_I:%.*]] = call contract double @__ocml_sincos_f64(double noundef [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
7116 // DEFAULT-NEXT: store double [[CALL_I]], ptr [[Y]], align 8, !tbaa [[DOUBLE_TBAA18]]
7117 // DEFAULT-NEXT: [[TMP0:%.*]] = load double, ptr addrspace(5) [[__TMP_I]], align 8, !tbaa [[DOUBLE_TBAA18]]
7118 // DEFAULT-NEXT: store double [[TMP0]], ptr [[Z]], align 8, !tbaa [[DOUBLE_TBAA18]]
7119 // DEFAULT-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7120 // DEFAULT-NEXT: ret void
7121 //
7122 // FINITEONLY-LABEL: define dso_local void @test_sincos(
7123 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
7124 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7125 // FINITEONLY-NEXT: [[__TMP_I:%.*]] = alloca double, align 8, addrspace(5)
7126 // FINITEONLY-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7127 // FINITEONLY-NEXT: [[CALL_I:%.*]] = call nnan ninf contract nofpclass(nan inf) double @__ocml_sincos_f64(double noundef nofpclass(nan inf) [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
7128 // FINITEONLY-NEXT: store double [[CALL_I]], ptr [[Y]], align 8, !tbaa [[DOUBLE_TBAA18]]
7129 // FINITEONLY-NEXT: [[TMP0:%.*]] = load double, ptr addrspace(5) [[__TMP_I]], align 8, !tbaa [[DOUBLE_TBAA18]]
7130 // FINITEONLY-NEXT: store double [[TMP0]], ptr [[Z]], align 8, !tbaa [[DOUBLE_TBAA18]]
7131 // FINITEONLY-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7132 // FINITEONLY-NEXT: ret void
7133 //
7134 // APPROX-LABEL: define dso_local void @test_sincos(
7135 // APPROX-SAME: double noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
7136 // APPROX-NEXT: [[ENTRY:.*:]]
7137 // APPROX-NEXT: [[__TMP_I:%.*]] = alloca double, align 8, addrspace(5)
7138 // APPROX-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7139 // APPROX-NEXT: [[CALL_I:%.*]] = call contract double @__ocml_sincos_f64(double noundef [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
7140 // APPROX-NEXT: store double [[CALL_I]], ptr [[Y]], align 8, !tbaa [[DOUBLE_TBAA18]]
7141 // APPROX-NEXT: [[TMP0:%.*]] = load double, ptr addrspace(5) [[__TMP_I]], align 8, !tbaa [[DOUBLE_TBAA18]]
7142 // APPROX-NEXT: store double [[TMP0]], ptr [[Z]], align 8, !tbaa [[DOUBLE_TBAA18]]
7143 // APPROX-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7144 // APPROX-NEXT: ret void
7145 //
7146 // NCRDIV-LABEL: define dso_local void @test_sincos(
7147 // NCRDIV-SAME: double noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
7148 // NCRDIV-NEXT: [[ENTRY:.*:]]
7149 // NCRDIV-NEXT: [[__TMP_I:%.*]] = alloca double, align 8, addrspace(5)
7150 // NCRDIV-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7151 // NCRDIV-NEXT: [[CALL_I:%.*]] = call contract double @__ocml_sincos_f64(double noundef [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
7152 // NCRDIV-NEXT: store double [[CALL_I]], ptr [[Y]], align 8, !tbaa [[DOUBLE_TBAA19]]
7153 // NCRDIV-NEXT: [[TMP0:%.*]] = load double, ptr addrspace(5) [[__TMP_I]], align 8, !tbaa [[DOUBLE_TBAA19]]
7154 // NCRDIV-NEXT: store double [[TMP0]], ptr [[Z]], align 8, !tbaa [[DOUBLE_TBAA19]]
7155 // NCRDIV-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7156 // NCRDIV-NEXT: ret void
7157 //
7158 // AMDGCNSPIRV-LABEL: define spir_func void @test_sincos(
7159 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], ptr addrspace(4) noundef writeonly captures(none) initializes((0, 8)) [[Y:%.*]], ptr addrspace(4) noundef writeonly captures(none) initializes((0, 8)) [[Z:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
7160 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7161 // AMDGCNSPIRV-NEXT: [[__TMP_I:%.*]] = alloca double, align 8
7162 // AMDGCNSPIRV-NEXT: [[__TMP_ASCAST_I:%.*]] = addrspacecast ptr [[__TMP_I]] to ptr addrspace(4)
7163 // AMDGCNSPIRV-NEXT: call addrspace(4) void @llvm.lifetime.start.p0(ptr nonnull [[__TMP_I]]) #[[ATTR16]]
7164 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = call contract spir_func addrspace(4) double @__ocml_sincos_f64(double noundef [[X]], ptr noundef nonnull [[__TMP_I]]) #[[ATTR15]]
7165 // AMDGCNSPIRV-NEXT: store double [[CALL_I]], ptr addrspace(4) [[Y]], align 8, !tbaa [[DOUBLE_TBAA19]]
7166 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = load double, ptr addrspace(4) [[__TMP_ASCAST_I]], align 8, !tbaa [[DOUBLE_TBAA19]]
7167 // AMDGCNSPIRV-NEXT: store double [[TMP0]], ptr addrspace(4) [[Z]], align 8, !tbaa [[DOUBLE_TBAA19]]
7168 // AMDGCNSPIRV-NEXT: call addrspace(4) void @llvm.lifetime.end.p0(ptr nonnull [[__TMP_I]]) #[[ATTR16]]
7169 // AMDGCNSPIRV-NEXT: ret void
7170 //
7171 extern "C" __device__ void test_sincos(double x, double *y, double *z) {
7172 sincos(x, y, z);
7173 }
7174
7175 // DEFAULT-LABEL: define dso_local void @test_sincospif(
7176 // DEFAULT-SAME: float noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
7177 // DEFAULT-NEXT: [[ENTRY:.*:]]
7178 // DEFAULT-NEXT: [[__TMP_I:%.*]] = alloca float, align 4, addrspace(5)
7179 // DEFAULT-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7180 // DEFAULT-NEXT: [[CALL_I:%.*]] = call contract float @__ocml_sincospi_f32(float noundef [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
7181 // DEFAULT-NEXT: store float [[CALL_I]], ptr [[Y]], align 4, !tbaa [[FLOAT_TBAA16]]
7182 // DEFAULT-NEXT: [[TMP0:%.*]] = load float, ptr addrspace(5) [[__TMP_I]], align 4, !tbaa [[FLOAT_TBAA16]]
7183 // DEFAULT-NEXT: store float [[TMP0]], ptr [[Z]], align 4, !tbaa [[FLOAT_TBAA16]]
7184 // DEFAULT-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7185 // DEFAULT-NEXT: ret void
7186 //
7187 // FINITEONLY-LABEL: define dso_local void @test_sincospif(
7188 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
7189 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7190 // FINITEONLY-NEXT: [[__TMP_I:%.*]] = alloca float, align 4, addrspace(5)
7191 // FINITEONLY-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7192 // FINITEONLY-NEXT: [[CALL_I:%.*]] = call nnan ninf contract nofpclass(nan inf) float @__ocml_sincospi_f32(float noundef nofpclass(nan inf) [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
7193 // FINITEONLY-NEXT: store float [[CALL_I]], ptr [[Y]], align 4, !tbaa [[FLOAT_TBAA16]]
7194 // FINITEONLY-NEXT: [[TMP0:%.*]] = load float, ptr addrspace(5) [[__TMP_I]], align 4, !tbaa [[FLOAT_TBAA16]]
7195 // FINITEONLY-NEXT: store float [[TMP0]], ptr [[Z]], align 4, !tbaa [[FLOAT_TBAA16]]
7196 // FINITEONLY-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7197 // FINITEONLY-NEXT: ret void
7198 //
7199 // APPROX-LABEL: define dso_local void @test_sincospif(
7200 // APPROX-SAME: float noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
7201 // APPROX-NEXT: [[ENTRY:.*:]]
7202 // APPROX-NEXT: [[__TMP_I:%.*]] = alloca float, align 4, addrspace(5)
7203 // APPROX-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7204 // APPROX-NEXT: [[CALL_I:%.*]] = call contract float @__ocml_sincospi_f32(float noundef [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
7205 // APPROX-NEXT: store float [[CALL_I]], ptr [[Y]], align 4, !tbaa [[FLOAT_TBAA16]]
7206 // APPROX-NEXT: [[TMP0:%.*]] = load float, ptr addrspace(5) [[__TMP_I]], align 4, !tbaa [[FLOAT_TBAA16]]
7207 // APPROX-NEXT: store float [[TMP0]], ptr [[Z]], align 4, !tbaa [[FLOAT_TBAA16]]
7208 // APPROX-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7209 // APPROX-NEXT: ret void
7210 //
7211 // NCRDIV-LABEL: define dso_local void @test_sincospif(
7212 // NCRDIV-SAME: float noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
7213 // NCRDIV-NEXT: [[ENTRY:.*:]]
7214 // NCRDIV-NEXT: [[__TMP_I:%.*]] = alloca float, align 4, addrspace(5)
7215 // NCRDIV-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7216 // NCRDIV-NEXT: [[CALL_I:%.*]] = call contract float @__ocml_sincospi_f32(float noundef [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
7217 // NCRDIV-NEXT: store float [[CALL_I]], ptr [[Y]], align 4, !tbaa [[FLOAT_TBAA17]]
7218 // NCRDIV-NEXT: [[TMP0:%.*]] = load float, ptr addrspace(5) [[__TMP_I]], align 4, !tbaa [[FLOAT_TBAA17]]
7219 // NCRDIV-NEXT: store float [[TMP0]], ptr [[Z]], align 4, !tbaa [[FLOAT_TBAA17]]
7220 // NCRDIV-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7221 // NCRDIV-NEXT: ret void
7222 //
7223 // AMDGCNSPIRV-LABEL: define spir_func void @test_sincospif(
7224 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], ptr addrspace(4) noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]], ptr addrspace(4) noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
7225 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7226 // AMDGCNSPIRV-NEXT: [[__TMP_I:%.*]] = alloca float, align 4
7227 // AMDGCNSPIRV-NEXT: [[__TMP_ASCAST_I:%.*]] = addrspacecast ptr [[__TMP_I]] to ptr addrspace(4)
7228 // AMDGCNSPIRV-NEXT: call addrspace(4) void @llvm.lifetime.start.p0(ptr nonnull [[__TMP_I]]) #[[ATTR16]]
7229 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = call contract spir_func addrspace(4) float @__ocml_sincospi_f32(float noundef [[X]], ptr noundef nonnull [[__TMP_I]]) #[[ATTR15]]
7230 // AMDGCNSPIRV-NEXT: store float [[CALL_I]], ptr addrspace(4) [[Y]], align 4, !tbaa [[FLOAT_TBAA17]]
7231 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = load float, ptr addrspace(4) [[__TMP_ASCAST_I]], align 4, !tbaa [[FLOAT_TBAA17]]
7232 // AMDGCNSPIRV-NEXT: store float [[TMP0]], ptr addrspace(4) [[Z]], align 4, !tbaa [[FLOAT_TBAA17]]
7233 // AMDGCNSPIRV-NEXT: call addrspace(4) void @llvm.lifetime.end.p0(ptr nonnull [[__TMP_I]]) #[[ATTR16]]
7234 // AMDGCNSPIRV-NEXT: ret void
7235 //
7236 extern "C" __device__ void test_sincospif(float x, float *y, float *z) {
7237 sincospif(x, y, z);
7238 }
7239
7240 // DEFAULT-LABEL: define dso_local void @test_sincospi(
7241 // DEFAULT-SAME: double noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
7242 // DEFAULT-NEXT: [[ENTRY:.*:]]
7243 // DEFAULT-NEXT: [[__TMP_I:%.*]] = alloca double, align 8, addrspace(5)
7244 // DEFAULT-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7245 // DEFAULT-NEXT: [[CALL_I:%.*]] = call contract double @__ocml_sincospi_f64(double noundef [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
7246 // DEFAULT-NEXT: store double [[CALL_I]], ptr [[Y]], align 8, !tbaa [[DOUBLE_TBAA18]]
7247 // DEFAULT-NEXT: [[TMP0:%.*]] = load double, ptr addrspace(5) [[__TMP_I]], align 8, !tbaa [[DOUBLE_TBAA18]]
7248 // DEFAULT-NEXT: store double [[TMP0]], ptr [[Z]], align 8, !tbaa [[DOUBLE_TBAA18]]
7249 // DEFAULT-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7250 // DEFAULT-NEXT: ret void
7251 //
7252 // FINITEONLY-LABEL: define dso_local void @test_sincospi(
7253 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
7254 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7255 // FINITEONLY-NEXT: [[__TMP_I:%.*]] = alloca double, align 8, addrspace(5)
7256 // FINITEONLY-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7257 // FINITEONLY-NEXT: [[CALL_I:%.*]] = call nnan ninf contract nofpclass(nan inf) double @__ocml_sincospi_f64(double noundef nofpclass(nan inf) [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
7258 // FINITEONLY-NEXT: store double [[CALL_I]], ptr [[Y]], align 8, !tbaa [[DOUBLE_TBAA18]]
7259 // FINITEONLY-NEXT: [[TMP0:%.*]] = load double, ptr addrspace(5) [[__TMP_I]], align 8, !tbaa [[DOUBLE_TBAA18]]
7260 // FINITEONLY-NEXT: store double [[TMP0]], ptr [[Z]], align 8, !tbaa [[DOUBLE_TBAA18]]
7261 // FINITEONLY-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7262 // FINITEONLY-NEXT: ret void
7263 //
7264 // APPROX-LABEL: define dso_local void @test_sincospi(
7265 // APPROX-SAME: double noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
7266 // APPROX-NEXT: [[ENTRY:.*:]]
7267 // APPROX-NEXT: [[__TMP_I:%.*]] = alloca double, align 8, addrspace(5)
7268 // APPROX-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7269 // APPROX-NEXT: [[CALL_I:%.*]] = call contract double @__ocml_sincospi_f64(double noundef [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
7270 // APPROX-NEXT: store double [[CALL_I]], ptr [[Y]], align 8, !tbaa [[DOUBLE_TBAA18]]
7271 // APPROX-NEXT: [[TMP0:%.*]] = load double, ptr addrspace(5) [[__TMP_I]], align 8, !tbaa [[DOUBLE_TBAA18]]
7272 // APPROX-NEXT: store double [[TMP0]], ptr [[Z]], align 8, !tbaa [[DOUBLE_TBAA18]]
7273 // APPROX-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7274 // APPROX-NEXT: ret void
7275 //
7276 // NCRDIV-LABEL: define dso_local void @test_sincospi(
7277 // NCRDIV-SAME: double noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
7278 // NCRDIV-NEXT: [[ENTRY:.*:]]
7279 // NCRDIV-NEXT: [[__TMP_I:%.*]] = alloca double, align 8, addrspace(5)
7280 // NCRDIV-NEXT: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7281 // NCRDIV-NEXT: [[CALL_I:%.*]] = call contract double @__ocml_sincospi_f64(double noundef [[X]], ptr addrspace(5) noundef [[__TMP_I]]) #[[ATTR15]]
7282 // NCRDIV-NEXT: store double [[CALL_I]], ptr [[Y]], align 8, !tbaa [[DOUBLE_TBAA19]]
7283 // NCRDIV-NEXT: [[TMP0:%.*]] = load double, ptr addrspace(5) [[__TMP_I]], align 8, !tbaa [[DOUBLE_TBAA19]]
7284 // NCRDIV-NEXT: store double [[TMP0]], ptr [[Z]], align 8, !tbaa [[DOUBLE_TBAA19]]
7285 // NCRDIV-NEXT: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[__TMP_I]]) #[[ATTR16]]
7286 // NCRDIV-NEXT: ret void
7287 //
7288 // AMDGCNSPIRV-LABEL: define spir_func void @test_sincospi(
7289 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], ptr addrspace(4) noundef writeonly captures(none) initializes((0, 8)) [[Y:%.*]], ptr addrspace(4) noundef writeonly captures(none) initializes((0, 8)) [[Z:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
7290 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7291 // AMDGCNSPIRV-NEXT: [[__TMP_I:%.*]] = alloca double, align 8
7292 // AMDGCNSPIRV-NEXT: [[__TMP_ASCAST_I:%.*]] = addrspacecast ptr [[__TMP_I]] to ptr addrspace(4)
7293 // AMDGCNSPIRV-NEXT: call addrspace(4) void @llvm.lifetime.start.p0(ptr nonnull [[__TMP_I]]) #[[ATTR16]]
7294 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = call contract spir_func addrspace(4) double @__ocml_sincospi_f64(double noundef [[X]], ptr noundef nonnull [[__TMP_I]]) #[[ATTR15]]
7295 // AMDGCNSPIRV-NEXT: store double [[CALL_I]], ptr addrspace(4) [[Y]], align 8, !tbaa [[DOUBLE_TBAA19]]
7296 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = load double, ptr addrspace(4) [[__TMP_ASCAST_I]], align 8, !tbaa [[DOUBLE_TBAA19]]
7297 // AMDGCNSPIRV-NEXT: store double [[TMP0]], ptr addrspace(4) [[Z]], align 8, !tbaa [[DOUBLE_TBAA19]]
7298 // AMDGCNSPIRV-NEXT: call addrspace(4) void @llvm.lifetime.end.p0(ptr nonnull [[__TMP_I]]) #[[ATTR16]]
7299 // AMDGCNSPIRV-NEXT: ret void
7300 //
7301 extern "C" __device__ void test_sincospi(double x, double *y, double *z) {
7302 sincospi(x, y, z);
7303 }
7304
7305 // DEFAULT-LABEL: define dso_local noundef float @test_sinf(
7306 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7307 // DEFAULT-NEXT: [[ENTRY:.*:]]
7308 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_sin_f32(float noundef [[X]]) #[[ATTR15]]
7309 // DEFAULT-NEXT: ret float [[CALL_I]]
7310 //
7311 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_sinf(
7312 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7313 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7314 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_sin_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
7315 // FINITEONLY-NEXT: ret float [[CALL_I]]
7316 //
7317 // APPROX-LABEL: define dso_local noundef float @test_sinf(
7318 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7319 // APPROX-NEXT: [[ENTRY:.*:]]
7320 // APPROX-NEXT: [[CALL_I1:%.*]] = tail call contract noundef float @__ocml_native_sin_f32(float noundef [[X]]) #[[ATTR15]]
7321 // APPROX-NEXT: ret float [[CALL_I1]]
7322 //
7323 // NCRDIV-LABEL: define dso_local noundef float @test_sinf(
7324 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7325 // NCRDIV-NEXT: [[ENTRY:.*:]]
7326 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_sin_f32(float noundef [[X]]) #[[ATTR15]]
7327 // NCRDIV-NEXT: ret float [[CALL_I]]
7328 //
7329 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_sinf(
7330 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
7331 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7332 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_sin_f32(float noundef [[X]]) #[[ATTR15]]
7333 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
7334 //
7335 extern "C" __device__ float test_sinf(float x) {
7336 return sinf(x);
7337 }
7338
7339 // DEFAULT-LABEL: define dso_local noundef double @test_sin(
7340 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7341 // DEFAULT-NEXT: [[ENTRY:.*:]]
7342 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_sin_f64(double noundef [[X]]) #[[ATTR15]]
7343 // DEFAULT-NEXT: ret double [[CALL_I]]
7344 //
7345 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_sin(
7346 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7347 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7348 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_sin_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
7349 // FINITEONLY-NEXT: ret double [[CALL_I]]
7350 //
7351 // APPROX-LABEL: define dso_local noundef double @test_sin(
7352 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7353 // APPROX-NEXT: [[ENTRY:.*:]]
7354 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_sin_f64(double noundef [[X]]) #[[ATTR15]]
7355 // APPROX-NEXT: ret double [[CALL_I]]
7356 //
7357 // NCRDIV-LABEL: define dso_local noundef double @test_sin(
7358 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7359 // NCRDIV-NEXT: [[ENTRY:.*:]]
7360 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_sin_f64(double noundef [[X]]) #[[ATTR15]]
7361 // NCRDIV-NEXT: ret double [[CALL_I]]
7362 //
7363 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_sin(
7364 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
7365 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7366 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_sin_f64(double noundef [[X]]) #[[ATTR15]]
7367 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
7368 //
7369 extern "C" __device__ double test_sin(double x) {
7370 return sin(x);
7371 }
7372
7373 // DEFAULT-LABEL: define dso_local noundef float @test_sinpif(
7374 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7375 // DEFAULT-NEXT: [[ENTRY:.*:]]
7376 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_sinpi_f32(float noundef [[X]]) #[[ATTR15]]
7377 // DEFAULT-NEXT: ret float [[CALL_I]]
7378 //
7379 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_sinpif(
7380 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7381 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7382 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_sinpi_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
7383 // FINITEONLY-NEXT: ret float [[CALL_I]]
7384 //
7385 // APPROX-LABEL: define dso_local noundef float @test_sinpif(
7386 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7387 // APPROX-NEXT: [[ENTRY:.*:]]
7388 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_sinpi_f32(float noundef [[X]]) #[[ATTR15]]
7389 // APPROX-NEXT: ret float [[CALL_I]]
7390 //
7391 // NCRDIV-LABEL: define dso_local noundef float @test_sinpif(
7392 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7393 // NCRDIV-NEXT: [[ENTRY:.*:]]
7394 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_sinpi_f32(float noundef [[X]]) #[[ATTR15]]
7395 // NCRDIV-NEXT: ret float [[CALL_I]]
7396 //
7397 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_sinpif(
7398 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
7399 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7400 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_sinpi_f32(float noundef [[X]]) #[[ATTR15]]
7401 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
7402 //
7403 extern "C" __device__ float test_sinpif(float x) {
7404 return sinpif(x);
7405 }
7406
7407 // DEFAULT-LABEL: define dso_local noundef double @test_sinpi(
7408 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7409 // DEFAULT-NEXT: [[ENTRY:.*:]]
7410 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_sinpi_f64(double noundef [[X]]) #[[ATTR15]]
7411 // DEFAULT-NEXT: ret double [[CALL_I]]
7412 //
7413 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_sinpi(
7414 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7415 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7416 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_sinpi_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
7417 // FINITEONLY-NEXT: ret double [[CALL_I]]
7418 //
7419 // APPROX-LABEL: define dso_local noundef double @test_sinpi(
7420 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7421 // APPROX-NEXT: [[ENTRY:.*:]]
7422 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_sinpi_f64(double noundef [[X]]) #[[ATTR15]]
7423 // APPROX-NEXT: ret double [[CALL_I]]
7424 //
7425 // NCRDIV-LABEL: define dso_local noundef double @test_sinpi(
7426 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7427 // NCRDIV-NEXT: [[ENTRY:.*:]]
7428 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_sinpi_f64(double noundef [[X]]) #[[ATTR15]]
7429 // NCRDIV-NEXT: ret double [[CALL_I]]
7430 //
7431 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_sinpi(
7432 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
7433 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7434 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_sinpi_f64(double noundef [[X]]) #[[ATTR15]]
7435 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
7436 //
7437 extern "C" __device__ double test_sinpi(double x) {
7438 return sinpi(x);
7439 }
7440
7441 // DEFAULT-LABEL: define dso_local noundef float @test_sqrtf(
7442 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
7443 // DEFAULT-NEXT: [[ENTRY:.*:]]
7444 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.sqrt.f32(float [[X]])
7445 // DEFAULT-NEXT: ret float [[TMP0]]
7446 //
7447 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_sqrtf(
7448 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
7449 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7450 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.sqrt.f32(float nofpclass(nan inf) [[X]])
7451 // FINITEONLY-NEXT: ret float [[TMP0]]
7452 //
7453 // APPROX-LABEL: define dso_local noundef float @test_sqrtf(
7454 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
7455 // APPROX-NEXT: [[ENTRY:.*:]]
7456 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.sqrt.f32(float [[X]])
7457 // APPROX-NEXT: ret float [[TMP0]]
7458 //
7459 // NCRDIV-LABEL: define dso_local noundef float @test_sqrtf(
7460 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
7461 // NCRDIV-NEXT: [[ENTRY:.*:]]
7462 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.sqrt.f32(float [[X]]), !fpmath [[META25:![0-9]+]]
7463 // NCRDIV-NEXT: ret float [[TMP0]]
7464 //
7465 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_sqrtf(
7466 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
7467 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7468 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.sqrt.f32(float [[X]])
7469 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
7470 //
7471 extern "C" __device__ float test_sqrtf(float x) {
7472 return sqrtf(x);
7473 }
7474
7475 // DEFAULT-LABEL: define dso_local noundef double @test_sqrt(
7476 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
7477 // DEFAULT-NEXT: [[ENTRY:.*:]]
7478 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.sqrt.f64(double [[X]])
7479 // DEFAULT-NEXT: ret double [[TMP0]]
7480 //
7481 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_sqrt(
7482 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
7483 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7484 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef double @llvm.sqrt.f64(double nofpclass(nan inf) [[X]])
7485 // FINITEONLY-NEXT: ret double [[TMP0]]
7486 //
7487 // APPROX-LABEL: define dso_local noundef double @test_sqrt(
7488 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
7489 // APPROX-NEXT: [[ENTRY:.*:]]
7490 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.sqrt.f64(double [[X]])
7491 // APPROX-NEXT: ret double [[TMP0]]
7492 //
7493 // NCRDIV-LABEL: define dso_local noundef double @test_sqrt(
7494 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
7495 // NCRDIV-NEXT: [[ENTRY:.*:]]
7496 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.sqrt.f64(double [[X]])
7497 // NCRDIV-NEXT: ret double [[TMP0]]
7498 //
7499 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_sqrt(
7500 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
7501 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7502 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) double @llvm.sqrt.f64(double [[X]])
7503 // AMDGCNSPIRV-NEXT: ret double [[TMP0]]
7504 //
7505 extern "C" __device__ double test_sqrt(double x) {
7506 return sqrt(x);
7507 }
7508
7509 // DEFAULT-LABEL: define dso_local noundef float @test_tanf(
7510 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7511 // DEFAULT-NEXT: [[ENTRY:.*:]]
7512 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_tan_f32(float noundef [[X]]) #[[ATTR15]]
7513 // DEFAULT-NEXT: ret float [[CALL_I]]
7514 //
7515 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_tanf(
7516 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7517 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7518 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_tan_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
7519 // FINITEONLY-NEXT: ret float [[CALL_I]]
7520 //
7521 // APPROX-LABEL: define dso_local noundef float @test_tanf(
7522 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7523 // APPROX-NEXT: [[ENTRY:.*:]]
7524 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_tan_f32(float noundef [[X]]) #[[ATTR15]]
7525 // APPROX-NEXT: ret float [[CALL_I]]
7526 //
7527 // NCRDIV-LABEL: define dso_local noundef float @test_tanf(
7528 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7529 // NCRDIV-NEXT: [[ENTRY:.*:]]
7530 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_tan_f32(float noundef [[X]]) #[[ATTR15]]
7531 // NCRDIV-NEXT: ret float [[CALL_I]]
7532 //
7533 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_tanf(
7534 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
7535 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7536 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_tan_f32(float noundef [[X]]) #[[ATTR15]]
7537 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
7538 //
7539 extern "C" __device__ float test_tanf(float x) {
7540 return tanf(x);
7541 }
7542
7543 // DEFAULT-LABEL: define dso_local noundef double @test_tan(
7544 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7545 // DEFAULT-NEXT: [[ENTRY:.*:]]
7546 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_tan_f64(double noundef [[X]]) #[[ATTR15]]
7547 // DEFAULT-NEXT: ret double [[CALL_I]]
7548 //
7549 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_tan(
7550 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7551 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7552 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_tan_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
7553 // FINITEONLY-NEXT: ret double [[CALL_I]]
7554 //
7555 // APPROX-LABEL: define dso_local noundef double @test_tan(
7556 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7557 // APPROX-NEXT: [[ENTRY:.*:]]
7558 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_tan_f64(double noundef [[X]]) #[[ATTR15]]
7559 // APPROX-NEXT: ret double [[CALL_I]]
7560 //
7561 // NCRDIV-LABEL: define dso_local noundef double @test_tan(
7562 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7563 // NCRDIV-NEXT: [[ENTRY:.*:]]
7564 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_tan_f64(double noundef [[X]]) #[[ATTR15]]
7565 // NCRDIV-NEXT: ret double [[CALL_I]]
7566 //
7567 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_tan(
7568 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
7569 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7570 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_tan_f64(double noundef [[X]]) #[[ATTR15]]
7571 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
7572 //
7573 extern "C" __device__ double test_tan(double x) {
7574 return tan(x);
7575 }
7576
7577 // DEFAULT-LABEL: define dso_local noundef float @test_tanhf(
7578 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
7579 // DEFAULT-NEXT: [[ENTRY:.*:]]
7580 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_tanh_f32(float noundef [[X]]) #[[ATTR14]]
7581 // DEFAULT-NEXT: ret float [[CALL_I]]
7582 //
7583 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_tanhf(
7584 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
7585 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7586 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_tanh_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
7587 // FINITEONLY-NEXT: ret float [[CALL_I]]
7588 //
7589 // APPROX-LABEL: define dso_local noundef float @test_tanhf(
7590 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
7591 // APPROX-NEXT: [[ENTRY:.*:]]
7592 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_tanh_f32(float noundef [[X]]) #[[ATTR14]]
7593 // APPROX-NEXT: ret float [[CALL_I]]
7594 //
7595 // NCRDIV-LABEL: define dso_local noundef float @test_tanhf(
7596 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
7597 // NCRDIV-NEXT: [[ENTRY:.*:]]
7598 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_tanh_f32(float noundef [[X]]) #[[ATTR14]]
7599 // NCRDIV-NEXT: ret float [[CALL_I]]
7600 //
7601 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_tanhf(
7602 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
7603 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7604 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_tanh_f32(float noundef [[X]]) #[[ATTR14]]
7605 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
7606 //
7607 extern "C" __device__ float test_tanhf(float x) {
7608 return tanhf(x);
7609 }
7610
7611 // DEFAULT-LABEL: define dso_local noundef double @test_tanh(
7612 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
7613 // DEFAULT-NEXT: [[ENTRY:.*:]]
7614 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_tanh_f64(double noundef [[X]]) #[[ATTR14]]
7615 // DEFAULT-NEXT: ret double [[CALL_I]]
7616 //
7617 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_tanh(
7618 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
7619 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7620 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_tanh_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR14]]
7621 // FINITEONLY-NEXT: ret double [[CALL_I]]
7622 //
7623 // APPROX-LABEL: define dso_local noundef double @test_tanh(
7624 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
7625 // APPROX-NEXT: [[ENTRY:.*:]]
7626 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_tanh_f64(double noundef [[X]]) #[[ATTR14]]
7627 // APPROX-NEXT: ret double [[CALL_I]]
7628 //
7629 // NCRDIV-LABEL: define dso_local noundef double @test_tanh(
7630 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR5]] {
7631 // NCRDIV-NEXT: [[ENTRY:.*:]]
7632 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_tanh_f64(double noundef [[X]]) #[[ATTR14]]
7633 // NCRDIV-NEXT: ret double [[CALL_I]]
7634 //
7635 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_tanh(
7636 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
7637 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7638 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_tanh_f64(double noundef [[X]]) #[[ATTR14]]
7639 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
7640 //
7641 extern "C" __device__ double test_tanh(double x) {
7642 return tanh(x);
7643 }
7644
7645 // DEFAULT-LABEL: define dso_local noundef float @test_tgammaf(
7646 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7647 // DEFAULT-NEXT: [[ENTRY:.*:]]
7648 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_tgamma_f32(float noundef [[X]]) #[[ATTR15]]
7649 // DEFAULT-NEXT: ret float [[CALL_I]]
7650 //
7651 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_tgammaf(
7652 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7653 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7654 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_tgamma_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
7655 // FINITEONLY-NEXT: ret float [[CALL_I]]
7656 //
7657 // APPROX-LABEL: define dso_local noundef float @test_tgammaf(
7658 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7659 // APPROX-NEXT: [[ENTRY:.*:]]
7660 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_tgamma_f32(float noundef [[X]]) #[[ATTR15]]
7661 // APPROX-NEXT: ret float [[CALL_I]]
7662 //
7663 // NCRDIV-LABEL: define dso_local noundef float @test_tgammaf(
7664 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7665 // NCRDIV-NEXT: [[ENTRY:.*:]]
7666 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_tgamma_f32(float noundef [[X]]) #[[ATTR15]]
7667 // NCRDIV-NEXT: ret float [[CALL_I]]
7668 //
7669 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_tgammaf(
7670 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
7671 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7672 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_tgamma_f32(float noundef [[X]]) #[[ATTR15]]
7673 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
7674 //
7675 extern "C" __device__ float test_tgammaf(float x) {
7676 return tgammaf(x);
7677 }
7678
7679 // DEFAULT-LABEL: define dso_local noundef double @test_tgamma(
7680 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7681 // DEFAULT-NEXT: [[ENTRY:.*:]]
7682 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_tgamma_f64(double noundef [[X]]) #[[ATTR15]]
7683 // DEFAULT-NEXT: ret double [[CALL_I]]
7684 //
7685 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_tgamma(
7686 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7687 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7688 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_tgamma_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
7689 // FINITEONLY-NEXT: ret double [[CALL_I]]
7690 //
7691 // APPROX-LABEL: define dso_local noundef double @test_tgamma(
7692 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7693 // APPROX-NEXT: [[ENTRY:.*:]]
7694 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_tgamma_f64(double noundef [[X]]) #[[ATTR15]]
7695 // APPROX-NEXT: ret double [[CALL_I]]
7696 //
7697 // NCRDIV-LABEL: define dso_local noundef double @test_tgamma(
7698 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7699 // NCRDIV-NEXT: [[ENTRY:.*:]]
7700 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_tgamma_f64(double noundef [[X]]) #[[ATTR15]]
7701 // NCRDIV-NEXT: ret double [[CALL_I]]
7702 //
7703 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_tgamma(
7704 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
7705 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7706 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_tgamma_f64(double noundef [[X]]) #[[ATTR15]]
7707 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
7708 //
7709 extern "C" __device__ double test_tgamma(double x) {
7710 return tgamma(x);
7711 }
7712
7713 // DEFAULT-LABEL: define dso_local noundef float @test_truncf(
7714 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
7715 // DEFAULT-NEXT: [[ENTRY:.*:]]
7716 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.trunc.f32(float [[X]])
7717 // DEFAULT-NEXT: ret float [[TMP0]]
7718 //
7719 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_truncf(
7720 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
7721 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7722 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.trunc.f32(float nofpclass(nan inf) [[X]])
7723 // FINITEONLY-NEXT: ret float [[TMP0]]
7724 //
7725 // APPROX-LABEL: define dso_local noundef float @test_truncf(
7726 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
7727 // APPROX-NEXT: [[ENTRY:.*:]]
7728 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.trunc.f32(float [[X]])
7729 // APPROX-NEXT: ret float [[TMP0]]
7730 //
7731 // NCRDIV-LABEL: define dso_local noundef float @test_truncf(
7732 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
7733 // NCRDIV-NEXT: [[ENTRY:.*:]]
7734 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.trunc.f32(float [[X]])
7735 // NCRDIV-NEXT: ret float [[TMP0]]
7736 //
7737 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_truncf(
7738 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
7739 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7740 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.trunc.f32(float [[X]])
7741 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
7742 //
7743 extern "C" __device__ float test_truncf(float x) {
7744 return truncf(x);
7745 }
7746
7747 // DEFAULT-LABEL: define dso_local noundef double @test_trunc(
7748 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
7749 // DEFAULT-NEXT: [[ENTRY:.*:]]
7750 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.trunc.f64(double [[X]])
7751 // DEFAULT-NEXT: ret double [[TMP0]]
7752 //
7753 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_trunc(
7754 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
7755 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7756 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef double @llvm.trunc.f64(double nofpclass(nan inf) [[X]])
7757 // FINITEONLY-NEXT: ret double [[TMP0]]
7758 //
7759 // APPROX-LABEL: define dso_local noundef double @test_trunc(
7760 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
7761 // APPROX-NEXT: [[ENTRY:.*:]]
7762 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.trunc.f64(double [[X]])
7763 // APPROX-NEXT: ret double [[TMP0]]
7764 //
7765 // NCRDIV-LABEL: define dso_local noundef double @test_trunc(
7766 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
7767 // NCRDIV-NEXT: [[ENTRY:.*:]]
7768 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.trunc.f64(double [[X]])
7769 // NCRDIV-NEXT: ret double [[TMP0]]
7770 //
7771 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_trunc(
7772 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
7773 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7774 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) double @llvm.trunc.f64(double [[X]])
7775 // AMDGCNSPIRV-NEXT: ret double [[TMP0]]
7776 //
7777 extern "C" __device__ double test_trunc(double x) {
7778 return trunc(x);
7779 }
7780
7781 // DEFAULT-LABEL: define dso_local noundef float @test_y0f(
7782 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7783 // DEFAULT-NEXT: [[ENTRY:.*:]]
7784 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_y0_f32(float noundef [[X]]) #[[ATTR15]]
7785 // DEFAULT-NEXT: ret float [[CALL_I]]
7786 //
7787 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_y0f(
7788 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7789 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7790 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_y0_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
7791 // FINITEONLY-NEXT: ret float [[CALL_I]]
7792 //
7793 // APPROX-LABEL: define dso_local noundef float @test_y0f(
7794 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7795 // APPROX-NEXT: [[ENTRY:.*:]]
7796 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_y0_f32(float noundef [[X]]) #[[ATTR15]]
7797 // APPROX-NEXT: ret float [[CALL_I]]
7798 //
7799 // NCRDIV-LABEL: define dso_local noundef float @test_y0f(
7800 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7801 // NCRDIV-NEXT: [[ENTRY:.*:]]
7802 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_y0_f32(float noundef [[X]]) #[[ATTR15]]
7803 // NCRDIV-NEXT: ret float [[CALL_I]]
7804 //
7805 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_y0f(
7806 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
7807 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7808 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_y0_f32(float noundef [[X]]) #[[ATTR15]]
7809 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
7810 //
7811 extern "C" __device__ float test_y0f(float x) {
7812 return y0f(x);
7813 }
7814
7815 // DEFAULT-LABEL: define dso_local noundef double @test_y0(
7816 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7817 // DEFAULT-NEXT: [[ENTRY:.*:]]
7818 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_y0_f64(double noundef [[X]]) #[[ATTR15]]
7819 // DEFAULT-NEXT: ret double [[CALL_I]]
7820 //
7821 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_y0(
7822 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7823 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7824 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_y0_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
7825 // FINITEONLY-NEXT: ret double [[CALL_I]]
7826 //
7827 // APPROX-LABEL: define dso_local noundef double @test_y0(
7828 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7829 // APPROX-NEXT: [[ENTRY:.*:]]
7830 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_y0_f64(double noundef [[X]]) #[[ATTR15]]
7831 // APPROX-NEXT: ret double [[CALL_I]]
7832 //
7833 // NCRDIV-LABEL: define dso_local noundef double @test_y0(
7834 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7835 // NCRDIV-NEXT: [[ENTRY:.*:]]
7836 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_y0_f64(double noundef [[X]]) #[[ATTR15]]
7837 // NCRDIV-NEXT: ret double [[CALL_I]]
7838 //
7839 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_y0(
7840 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
7841 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7842 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_y0_f64(double noundef [[X]]) #[[ATTR15]]
7843 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
7844 //
7845 extern "C" __device__ double test_y0(double x) {
7846 return y0(x);
7847 }
7848
7849 // DEFAULT-LABEL: define dso_local noundef float @test_y1f(
7850 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7851 // DEFAULT-NEXT: [[ENTRY:.*:]]
7852 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_y1_f32(float noundef [[X]]) #[[ATTR15]]
7853 // DEFAULT-NEXT: ret float [[CALL_I]]
7854 //
7855 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_y1f(
7856 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7857 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7858 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_y1_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
7859 // FINITEONLY-NEXT: ret float [[CALL_I]]
7860 //
7861 // APPROX-LABEL: define dso_local noundef float @test_y1f(
7862 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7863 // APPROX-NEXT: [[ENTRY:.*:]]
7864 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_y1_f32(float noundef [[X]]) #[[ATTR15]]
7865 // APPROX-NEXT: ret float [[CALL_I]]
7866 //
7867 // NCRDIV-LABEL: define dso_local noundef float @test_y1f(
7868 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7869 // NCRDIV-NEXT: [[ENTRY:.*:]]
7870 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_y1_f32(float noundef [[X]]) #[[ATTR15]]
7871 // NCRDIV-NEXT: ret float [[CALL_I]]
7872 //
7873 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_y1f(
7874 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
7875 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7876 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_y1_f32(float noundef [[X]]) #[[ATTR15]]
7877 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
7878 //
7879 extern "C" __device__ float test_y1f(float x) {
7880 return y1f(x);
7881 }
7882
7883 // DEFAULT-LABEL: define dso_local noundef double @test_y1(
7884 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7885 // DEFAULT-NEXT: [[ENTRY:.*:]]
7886 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_y1_f64(double noundef [[X]]) #[[ATTR15]]
7887 // DEFAULT-NEXT: ret double [[CALL_I]]
7888 //
7889 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_y1(
7890 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7891 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7892 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_y1_f64(double noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
7893 // FINITEONLY-NEXT: ret double [[CALL_I]]
7894 //
7895 // APPROX-LABEL: define dso_local noundef double @test_y1(
7896 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7897 // APPROX-NEXT: [[ENTRY:.*:]]
7898 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_y1_f64(double noundef [[X]]) #[[ATTR15]]
7899 // APPROX-NEXT: ret double [[CALL_I]]
7900 //
7901 // NCRDIV-LABEL: define dso_local noundef double @test_y1(
7902 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
7903 // NCRDIV-NEXT: [[ENTRY:.*:]]
7904 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef double @__ocml_y1_f64(double noundef [[X]]) #[[ATTR15]]
7905 // NCRDIV-NEXT: ret double [[CALL_I]]
7906 //
7907 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_y1(
7908 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
7909 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
7910 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_y1_f64(double noundef [[X]]) #[[ATTR15]]
7911 // AMDGCNSPIRV-NEXT: ret double [[CALL_I]]
7912 //
7913 extern "C" __device__ double test_y1(double x) {
7914 return y1(x);
7915 }
7916
7917 // DEFAULT-LABEL: define dso_local float @test_ynf(
7918 // DEFAULT-SAME: i32 noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
7919 // DEFAULT-NEXT: [[ENTRY:.*:]]
7920 // DEFAULT-NEXT: switch i32 [[X]], label %[[IF_END4_I:.*]] [
7921 // DEFAULT-NEXT: i32 0, label %[[IF_THEN_I:.*]]
7922 // DEFAULT-NEXT: i32 1, label %[[IF_THEN2_I:.*]]
7923 // DEFAULT-NEXT: ]
7924 // DEFAULT: [[IF_THEN_I]]:
7925 // DEFAULT-NEXT: [[CALL_I20_I:%.*]] = tail call contract noundef float @__ocml_y0_f32(float noundef [[Y]]) #[[ATTR15]]
7926 // DEFAULT-NEXT: br label %[[_ZL3YNFIF_EXIT:.*]]
7927 // DEFAULT: [[IF_THEN2_I]]:
7928 // DEFAULT-NEXT: [[CALL_I22_I:%.*]] = tail call contract noundef float @__ocml_y1_f32(float noundef [[Y]]) #[[ATTR15]]
7929 // DEFAULT-NEXT: br label %[[_ZL3YNFIF_EXIT]]
7930 // DEFAULT: [[IF_END4_I]]:
7931 // DEFAULT-NEXT: [[CALL_I_I:%.*]] = tail call contract noundef float @__ocml_y0_f32(float noundef [[Y]]) #[[ATTR15]]
7932 // DEFAULT-NEXT: [[CALL_I21_I:%.*]] = tail call contract noundef float @__ocml_y1_f32(float noundef [[Y]]) #[[ATTR15]]
7933 // DEFAULT-NEXT: [[CMP7_I1:%.*]] = icmp sgt i32 [[X]], 1
7934 // DEFAULT-NEXT: br i1 [[CMP7_I1]], label %[[FOR_BODY_I:.*]], label %[[_ZL3YNFIF_EXIT]]
7935 // DEFAULT: [[FOR_BODY_I]]:
7936 // DEFAULT-NEXT: [[__I_0_I4:%.*]] = phi i32 [ [[INC_I:%.*]], %[[FOR_BODY_I]] ], [ 1, %[[IF_END4_I]] ]
7937 // DEFAULT-NEXT: [[__X1_0_I3:%.*]] = phi float [ [[SUB_I:%.*]], %[[FOR_BODY_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ]
7938 // DEFAULT-NEXT: [[__X0_0_I2:%.*]] = phi float [ [[__X1_0_I3]], %[[FOR_BODY_I]] ], [ [[CALL_I_I]], %[[IF_END4_I]] ]
7939 // DEFAULT-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
7940 // DEFAULT-NEXT: [[CONV_I:%.*]] = uitofp nneg i32 [[MUL_I]] to float
7941 // DEFAULT-NEXT: [[DIV_I:%.*]] = fdiv contract float [[CONV_I]], [[Y]]
7942 // DEFAULT-NEXT: [[MUL8_I:%.*]] = fmul contract float [[__X1_0_I3]], [[DIV_I]]
7943 // DEFAULT-NEXT: [[SUB_I]] = fsub contract float [[MUL8_I]], [[__X0_0_I2]]
7944 // DEFAULT-NEXT: [[INC_I]] = add nuw nsw i32 [[__I_0_I4]], 1
7945 // DEFAULT-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC_I]], [[X]]
7946 // DEFAULT-NEXT: br i1 [[EXITCOND_NOT]], label %[[_ZL3YNFIF_EXIT]], label %[[FOR_BODY_I]], !llvm.loop [[LOOP24:![0-9]+]]
7947 // DEFAULT: [[_ZL3YNFIF_EXIT]]:
7948 // DEFAULT-NEXT: [[RETVAL_0_I:%.*]] = phi float [ [[CALL_I20_I]], %[[IF_THEN_I]] ], [ [[CALL_I22_I]], %[[IF_THEN2_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ], [ [[SUB_I]], %[[FOR_BODY_I]] ]
7949 // DEFAULT-NEXT: ret float [[RETVAL_0_I]]
7950 //
7951 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) float @test_ynf(
7952 // FINITEONLY-SAME: i32 noundef [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
7953 // FINITEONLY-NEXT: [[ENTRY:.*:]]
7954 // FINITEONLY-NEXT: switch i32 [[X]], label %[[IF_END4_I:.*]] [
7955 // FINITEONLY-NEXT: i32 0, label %[[IF_THEN_I:.*]]
7956 // FINITEONLY-NEXT: i32 1, label %[[IF_THEN2_I:.*]]
7957 // FINITEONLY-NEXT: ]
7958 // FINITEONLY: [[IF_THEN_I]]:
7959 // FINITEONLY-NEXT: [[CALL_I20_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_y0_f32(float noundef nofpclass(nan inf) [[Y]]) #[[ATTR15]]
7960 // FINITEONLY-NEXT: br label %[[_ZL3YNFIF_EXIT:.*]]
7961 // FINITEONLY: [[IF_THEN2_I]]:
7962 // FINITEONLY-NEXT: [[CALL_I22_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_y1_f32(float noundef nofpclass(nan inf) [[Y]]) #[[ATTR15]]
7963 // FINITEONLY-NEXT: br label %[[_ZL3YNFIF_EXIT]]
7964 // FINITEONLY: [[IF_END4_I]]:
7965 // FINITEONLY-NEXT: [[CALL_I_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_y0_f32(float noundef nofpclass(nan inf) [[Y]]) #[[ATTR15]]
7966 // FINITEONLY-NEXT: [[CALL_I21_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_y1_f32(float noundef nofpclass(nan inf) [[Y]]) #[[ATTR15]]
7967 // FINITEONLY-NEXT: [[CMP7_I1:%.*]] = icmp sgt i32 [[X]], 1
7968 // FINITEONLY-NEXT: br i1 [[CMP7_I1]], label %[[FOR_BODY_I:.*]], label %[[_ZL3YNFIF_EXIT]]
7969 // FINITEONLY: [[FOR_BODY_I]]:
7970 // FINITEONLY-NEXT: [[__I_0_I4:%.*]] = phi i32 [ [[INC_I:%.*]], %[[FOR_BODY_I]] ], [ 1, %[[IF_END4_I]] ]
7971 // FINITEONLY-NEXT: [[__X1_0_I3:%.*]] = phi float [ [[SUB_I:%.*]], %[[FOR_BODY_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ]
7972 // FINITEONLY-NEXT: [[__X0_0_I2:%.*]] = phi float [ [[__X1_0_I3]], %[[FOR_BODY_I]] ], [ [[CALL_I_I]], %[[IF_END4_I]] ]
7973 // FINITEONLY-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
7974 // FINITEONLY-NEXT: [[CONV_I:%.*]] = uitofp nneg i32 [[MUL_I]] to float
7975 // FINITEONLY-NEXT: [[DIV_I:%.*]] = fdiv nnan ninf contract float [[CONV_I]], [[Y]]
7976 // FINITEONLY-NEXT: [[MUL8_I:%.*]] = fmul nnan ninf contract float [[__X1_0_I3]], [[DIV_I]]
7977 // FINITEONLY-NEXT: [[SUB_I]] = fsub nnan ninf contract float [[MUL8_I]], [[__X0_0_I2]]
7978 // FINITEONLY-NEXT: [[INC_I]] = add nuw nsw i32 [[__I_0_I4]], 1
7979 // FINITEONLY-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC_I]], [[X]]
7980 // FINITEONLY-NEXT: br i1 [[EXITCOND_NOT]], label %[[_ZL3YNFIF_EXIT]], label %[[FOR_BODY_I]], !llvm.loop [[LOOP24:![0-9]+]]
7981 // FINITEONLY: [[_ZL3YNFIF_EXIT]]:
7982 // FINITEONLY-NEXT: [[RETVAL_0_I:%.*]] = phi float [ [[CALL_I20_I]], %[[IF_THEN_I]] ], [ [[CALL_I22_I]], %[[IF_THEN2_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ], [ [[SUB_I]], %[[FOR_BODY_I]] ]
7983 // FINITEONLY-NEXT: ret float [[RETVAL_0_I]]
7984 //
7985 // APPROX-LABEL: define dso_local float @test_ynf(
7986 // APPROX-SAME: i32 noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
7987 // APPROX-NEXT: [[ENTRY:.*:]]
7988 // APPROX-NEXT: switch i32 [[X]], label %[[IF_END4_I:.*]] [
7989 // APPROX-NEXT: i32 0, label %[[IF_THEN_I:.*]]
7990 // APPROX-NEXT: i32 1, label %[[IF_THEN2_I:.*]]
7991 // APPROX-NEXT: ]
7992 // APPROX: [[IF_THEN_I]]:
7993 // APPROX-NEXT: [[CALL_I20_I:%.*]] = tail call contract noundef float @__ocml_y0_f32(float noundef [[Y]]) #[[ATTR15]]
7994 // APPROX-NEXT: br label %[[_ZL3YNFIF_EXIT:.*]]
7995 // APPROX: [[IF_THEN2_I]]:
7996 // APPROX-NEXT: [[CALL_I22_I:%.*]] = tail call contract noundef float @__ocml_y1_f32(float noundef [[Y]]) #[[ATTR15]]
7997 // APPROX-NEXT: br label %[[_ZL3YNFIF_EXIT]]
7998 // APPROX: [[IF_END4_I]]:
7999 // APPROX-NEXT: [[CALL_I_I:%.*]] = tail call contract noundef float @__ocml_y0_f32(float noundef [[Y]]) #[[ATTR15]]
8000 // APPROX-NEXT: [[CALL_I21_I:%.*]] = tail call contract noundef float @__ocml_y1_f32(float noundef [[Y]]) #[[ATTR15]]
8001 // APPROX-NEXT: [[CMP7_I1:%.*]] = icmp sgt i32 [[X]], 1
8002 // APPROX-NEXT: br i1 [[CMP7_I1]], label %[[FOR_BODY_I:.*]], label %[[_ZL3YNFIF_EXIT]]
8003 // APPROX: [[FOR_BODY_I]]:
8004 // APPROX-NEXT: [[__I_0_I4:%.*]] = phi i32 [ [[INC_I:%.*]], %[[FOR_BODY_I]] ], [ 1, %[[IF_END4_I]] ]
8005 // APPROX-NEXT: [[__X1_0_I3:%.*]] = phi float [ [[SUB_I:%.*]], %[[FOR_BODY_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ]
8006 // APPROX-NEXT: [[__X0_0_I2:%.*]] = phi float [ [[__X1_0_I3]], %[[FOR_BODY_I]] ], [ [[CALL_I_I]], %[[IF_END4_I]] ]
8007 // APPROX-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
8008 // APPROX-NEXT: [[CONV_I:%.*]] = uitofp nneg i32 [[MUL_I]] to float
8009 // APPROX-NEXT: [[DIV_I:%.*]] = fdiv contract float [[CONV_I]], [[Y]]
8010 // APPROX-NEXT: [[MUL8_I:%.*]] = fmul contract float [[__X1_0_I3]], [[DIV_I]]
8011 // APPROX-NEXT: [[SUB_I]] = fsub contract float [[MUL8_I]], [[__X0_0_I2]]
8012 // APPROX-NEXT: [[INC_I]] = add nuw nsw i32 [[__I_0_I4]], 1
8013 // APPROX-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC_I]], [[X]]
8014 // APPROX-NEXT: br i1 [[EXITCOND_NOT]], label %[[_ZL3YNFIF_EXIT]], label %[[FOR_BODY_I]], !llvm.loop [[LOOP24:![0-9]+]]
8015 // APPROX: [[_ZL3YNFIF_EXIT]]:
8016 // APPROX-NEXT: [[RETVAL_0_I:%.*]] = phi float [ [[CALL_I20_I]], %[[IF_THEN_I]] ], [ [[CALL_I22_I]], %[[IF_THEN2_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ], [ [[SUB_I]], %[[FOR_BODY_I]] ]
8017 // APPROX-NEXT: ret float [[RETVAL_0_I]]
8018 //
8019 // NCRDIV-LABEL: define dso_local float @test_ynf(
8020 // NCRDIV-SAME: i32 noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
8021 // NCRDIV-NEXT: [[ENTRY:.*:]]
8022 // NCRDIV-NEXT: switch i32 [[X]], label %[[IF_END4_I:.*]] [
8023 // NCRDIV-NEXT: i32 0, label %[[IF_THEN_I:.*]]
8024 // NCRDIV-NEXT: i32 1, label %[[IF_THEN2_I:.*]]
8025 // NCRDIV-NEXT: ]
8026 // NCRDIV: [[IF_THEN_I]]:
8027 // NCRDIV-NEXT: [[CALL_I20_I:%.*]] = tail call contract noundef float @__ocml_y0_f32(float noundef [[Y]]) #[[ATTR15]]
8028 // NCRDIV-NEXT: br label %[[_ZL3YNFIF_EXIT:.*]]
8029 // NCRDIV: [[IF_THEN2_I]]:
8030 // NCRDIV-NEXT: [[CALL_I22_I:%.*]] = tail call contract noundef float @__ocml_y1_f32(float noundef [[Y]]) #[[ATTR15]]
8031 // NCRDIV-NEXT: br label %[[_ZL3YNFIF_EXIT]]
8032 // NCRDIV: [[IF_END4_I]]:
8033 // NCRDIV-NEXT: [[CALL_I_I:%.*]] = tail call contract noundef float @__ocml_y0_f32(float noundef [[Y]]) #[[ATTR15]]
8034 // NCRDIV-NEXT: [[CALL_I21_I:%.*]] = tail call contract noundef float @__ocml_y1_f32(float noundef [[Y]]) #[[ATTR15]]
8035 // NCRDIV-NEXT: [[CMP7_I1:%.*]] = icmp sgt i32 [[X]], 1
8036 // NCRDIV-NEXT: br i1 [[CMP7_I1]], label %[[FOR_BODY_I:.*]], label %[[_ZL3YNFIF_EXIT]]
8037 // NCRDIV: [[FOR_BODY_I]]:
8038 // NCRDIV-NEXT: [[__I_0_I4:%.*]] = phi i32 [ [[INC_I:%.*]], %[[FOR_BODY_I]] ], [ 1, %[[IF_END4_I]] ]
8039 // NCRDIV-NEXT: [[__X1_0_I3:%.*]] = phi float [ [[SUB_I:%.*]], %[[FOR_BODY_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ]
8040 // NCRDIV-NEXT: [[__X0_0_I2:%.*]] = phi float [ [[__X1_0_I3]], %[[FOR_BODY_I]] ], [ [[CALL_I_I]], %[[IF_END4_I]] ]
8041 // NCRDIV-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
8042 // NCRDIV-NEXT: [[CONV_I:%.*]] = uitofp nneg i32 [[MUL_I]] to float
8043 // NCRDIV-NEXT: [[DIV_I:%.*]] = fdiv contract float [[CONV_I]], [[Y]], !fpmath [[META14]]
8044 // NCRDIV-NEXT: [[MUL8_I:%.*]] = fmul contract float [[__X1_0_I3]], [[DIV_I]]
8045 // NCRDIV-NEXT: [[SUB_I]] = fsub contract float [[MUL8_I]], [[__X0_0_I2]]
8046 // NCRDIV-NEXT: [[INC_I]] = add nuw nsw i32 [[__I_0_I4]], 1
8047 // NCRDIV-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC_I]], [[X]]
8048 // NCRDIV-NEXT: br i1 [[EXITCOND_NOT]], label %[[_ZL3YNFIF_EXIT]], label %[[FOR_BODY_I]], !llvm.loop [[LOOP26:![0-9]+]]
8049 // NCRDIV: [[_ZL3YNFIF_EXIT]]:
8050 // NCRDIV-NEXT: [[RETVAL_0_I:%.*]] = phi float [ [[CALL_I20_I]], %[[IF_THEN_I]] ], [ [[CALL_I22_I]], %[[IF_THEN2_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ], [ [[SUB_I]], %[[FOR_BODY_I]] ]
8051 // NCRDIV-NEXT: ret float [[RETVAL_0_I]]
8052 //
8053 // AMDGCNSPIRV-LABEL: define spir_func float @test_ynf(
8054 // AMDGCNSPIRV-SAME: i32 noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
8055 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8056 // AMDGCNSPIRV-NEXT: switch i32 [[X]], label %[[IF_END4_I:.*]] [
8057 // AMDGCNSPIRV-NEXT: i32 0, label %[[IF_THEN_I:.*]]
8058 // AMDGCNSPIRV-NEXT: i32 1, label %[[IF_THEN2_I:.*]]
8059 // AMDGCNSPIRV-NEXT: ]
8060 // AMDGCNSPIRV: [[IF_THEN_I]]:
8061 // AMDGCNSPIRV-NEXT: [[CALL_I20_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_y0_f32(float noundef [[Y]]) #[[ATTR15]]
8062 // AMDGCNSPIRV-NEXT: br label %[[_ZL3YNFIF_EXIT:.*]]
8063 // AMDGCNSPIRV: [[IF_THEN2_I]]:
8064 // AMDGCNSPIRV-NEXT: [[CALL_I22_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_y1_f32(float noundef [[Y]]) #[[ATTR15]]
8065 // AMDGCNSPIRV-NEXT: br label %[[_ZL3YNFIF_EXIT]]
8066 // AMDGCNSPIRV: [[IF_END4_I]]:
8067 // AMDGCNSPIRV-NEXT: [[CALL_I_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_y0_f32(float noundef [[Y]]) #[[ATTR15]]
8068 // AMDGCNSPIRV-NEXT: [[CALL_I21_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_y1_f32(float noundef [[Y]]) #[[ATTR15]]
8069 // AMDGCNSPIRV-NEXT: [[CMP7_I1:%.*]] = icmp sgt i32 [[X]], 1
8070 // AMDGCNSPIRV-NEXT: br i1 [[CMP7_I1]], label %[[FOR_BODY_I:.*]], label %[[_ZL3YNFIF_EXIT]]
8071 // AMDGCNSPIRV: [[FOR_BODY_I]]:
8072 // AMDGCNSPIRV-NEXT: [[__I_0_I4:%.*]] = phi i32 [ [[INC_I:%.*]], %[[FOR_BODY_I]] ], [ 1, %[[IF_END4_I]] ]
8073 // AMDGCNSPIRV-NEXT: [[__X1_0_I3:%.*]] = phi float [ [[SUB_I:%.*]], %[[FOR_BODY_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ]
8074 // AMDGCNSPIRV-NEXT: [[__X0_0_I2:%.*]] = phi float [ [[__X1_0_I3]], %[[FOR_BODY_I]] ], [ [[CALL_I_I]], %[[IF_END4_I]] ]
8075 // AMDGCNSPIRV-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
8076 // AMDGCNSPIRV-NEXT: [[CONV_I:%.*]] = uitofp nneg i32 [[MUL_I]] to float
8077 // AMDGCNSPIRV-NEXT: [[DIV_I:%.*]] = fdiv contract float [[CONV_I]], [[Y]]
8078 // AMDGCNSPIRV-NEXT: [[MUL8_I:%.*]] = fmul contract float [[__X1_0_I3]], [[DIV_I]]
8079 // AMDGCNSPIRV-NEXT: [[SUB_I]] = fsub contract float [[MUL8_I]], [[__X0_0_I2]]
8080 // AMDGCNSPIRV-NEXT: [[INC_I]] = add nuw nsw i32 [[__I_0_I4]], 1
8081 // AMDGCNSPIRV-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC_I]], [[X]]
8082 // AMDGCNSPIRV-NEXT: br i1 [[EXITCOND_NOT]], label %[[_ZL3YNFIF_EXIT]], label %[[FOR_BODY_I]], !llvm.loop [[LOOP25:![0-9]+]]
8083 // AMDGCNSPIRV: [[_ZL3YNFIF_EXIT]]:
8084 // AMDGCNSPIRV-NEXT: [[RETVAL_0_I:%.*]] = phi float [ [[CALL_I20_I]], %[[IF_THEN_I]] ], [ [[CALL_I22_I]], %[[IF_THEN2_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ], [ [[SUB_I]], %[[FOR_BODY_I]] ]
8085 // AMDGCNSPIRV-NEXT: ret float [[RETVAL_0_I]]
8086 //
8087 extern "C" __device__ float test_ynf(int x, float y) {
8088 return ynf(x, y);
8089 }
8090
8091 // DEFAULT-LABEL: define dso_local double @test_yn(
8092 // DEFAULT-SAME: i32 noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
8093 // DEFAULT-NEXT: [[ENTRY:.*:]]
8094 // DEFAULT-NEXT: switch i32 [[X]], label %[[IF_END4_I:.*]] [
8095 // DEFAULT-NEXT: i32 0, label %[[IF_THEN_I:.*]]
8096 // DEFAULT-NEXT: i32 1, label %[[IF_THEN2_I:.*]]
8097 // DEFAULT-NEXT: ]
8098 // DEFAULT: [[IF_THEN_I]]:
8099 // DEFAULT-NEXT: [[CALL_I20_I:%.*]] = tail call contract noundef double @__ocml_y0_f64(double noundef [[Y]]) #[[ATTR15]]
8100 // DEFAULT-NEXT: br label %[[_ZL2YNID_EXIT:.*]]
8101 // DEFAULT: [[IF_THEN2_I]]:
8102 // DEFAULT-NEXT: [[CALL_I22_I:%.*]] = tail call contract noundef double @__ocml_y1_f64(double noundef [[Y]]) #[[ATTR15]]
8103 // DEFAULT-NEXT: br label %[[_ZL2YNID_EXIT]]
8104 // DEFAULT: [[IF_END4_I]]:
8105 // DEFAULT-NEXT: [[CALL_I_I:%.*]] = tail call contract noundef double @__ocml_y0_f64(double noundef [[Y]]) #[[ATTR15]]
8106 // DEFAULT-NEXT: [[CALL_I21_I:%.*]] = tail call contract noundef double @__ocml_y1_f64(double noundef [[Y]]) #[[ATTR15]]
8107 // DEFAULT-NEXT: [[CMP7_I1:%.*]] = icmp sgt i32 [[X]], 1
8108 // DEFAULT-NEXT: br i1 [[CMP7_I1]], label %[[FOR_BODY_I:.*]], label %[[_ZL2YNID_EXIT]]
8109 // DEFAULT: [[FOR_BODY_I]]:
8110 // DEFAULT-NEXT: [[__I_0_I4:%.*]] = phi i32 [ [[INC_I:%.*]], %[[FOR_BODY_I]] ], [ 1, %[[IF_END4_I]] ]
8111 // DEFAULT-NEXT: [[__X1_0_I3:%.*]] = phi double [ [[SUB_I:%.*]], %[[FOR_BODY_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ]
8112 // DEFAULT-NEXT: [[__X0_0_I2:%.*]] = phi double [ [[__X1_0_I3]], %[[FOR_BODY_I]] ], [ [[CALL_I_I]], %[[IF_END4_I]] ]
8113 // DEFAULT-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
8114 // DEFAULT-NEXT: [[CONV_I:%.*]] = uitofp nneg i32 [[MUL_I]] to double
8115 // DEFAULT-NEXT: [[DIV_I:%.*]] = fdiv contract double [[CONV_I]], [[Y]]
8116 // DEFAULT-NEXT: [[MUL8_I:%.*]] = fmul contract double [[__X1_0_I3]], [[DIV_I]]
8117 // DEFAULT-NEXT: [[SUB_I]] = fsub contract double [[MUL8_I]], [[__X0_0_I2]]
8118 // DEFAULT-NEXT: [[INC_I]] = add nuw nsw i32 [[__I_0_I4]], 1
8119 // DEFAULT-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC_I]], [[X]]
8120 // DEFAULT-NEXT: br i1 [[EXITCOND_NOT]], label %[[_ZL2YNID_EXIT]], label %[[FOR_BODY_I]], !llvm.loop [[LOOP25:![0-9]+]]
8121 // DEFAULT: [[_ZL2YNID_EXIT]]:
8122 // DEFAULT-NEXT: [[RETVAL_0_I:%.*]] = phi double [ [[CALL_I20_I]], %[[IF_THEN_I]] ], [ [[CALL_I22_I]], %[[IF_THEN2_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ], [ [[SUB_I]], %[[FOR_BODY_I]] ]
8123 // DEFAULT-NEXT: ret double [[RETVAL_0_I]]
8124 //
8125 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) double @test_yn(
8126 // FINITEONLY-SAME: i32 noundef [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
8127 // FINITEONLY-NEXT: [[ENTRY:.*:]]
8128 // FINITEONLY-NEXT: switch i32 [[X]], label %[[IF_END4_I:.*]] [
8129 // FINITEONLY-NEXT: i32 0, label %[[IF_THEN_I:.*]]
8130 // FINITEONLY-NEXT: i32 1, label %[[IF_THEN2_I:.*]]
8131 // FINITEONLY-NEXT: ]
8132 // FINITEONLY: [[IF_THEN_I]]:
8133 // FINITEONLY-NEXT: [[CALL_I20_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_y0_f64(double noundef nofpclass(nan inf) [[Y]]) #[[ATTR15]]
8134 // FINITEONLY-NEXT: br label %[[_ZL2YNID_EXIT:.*]]
8135 // FINITEONLY: [[IF_THEN2_I]]:
8136 // FINITEONLY-NEXT: [[CALL_I22_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_y1_f64(double noundef nofpclass(nan inf) [[Y]]) #[[ATTR15]]
8137 // FINITEONLY-NEXT: br label %[[_ZL2YNID_EXIT]]
8138 // FINITEONLY: [[IF_END4_I]]:
8139 // FINITEONLY-NEXT: [[CALL_I_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_y0_f64(double noundef nofpclass(nan inf) [[Y]]) #[[ATTR15]]
8140 // FINITEONLY-NEXT: [[CALL_I21_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) double @__ocml_y1_f64(double noundef nofpclass(nan inf) [[Y]]) #[[ATTR15]]
8141 // FINITEONLY-NEXT: [[CMP7_I1:%.*]] = icmp sgt i32 [[X]], 1
8142 // FINITEONLY-NEXT: br i1 [[CMP7_I1]], label %[[FOR_BODY_I:.*]], label %[[_ZL2YNID_EXIT]]
8143 // FINITEONLY: [[FOR_BODY_I]]:
8144 // FINITEONLY-NEXT: [[__I_0_I4:%.*]] = phi i32 [ [[INC_I:%.*]], %[[FOR_BODY_I]] ], [ 1, %[[IF_END4_I]] ]
8145 // FINITEONLY-NEXT: [[__X1_0_I3:%.*]] = phi double [ [[SUB_I:%.*]], %[[FOR_BODY_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ]
8146 // FINITEONLY-NEXT: [[__X0_0_I2:%.*]] = phi double [ [[__X1_0_I3]], %[[FOR_BODY_I]] ], [ [[CALL_I_I]], %[[IF_END4_I]] ]
8147 // FINITEONLY-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
8148 // FINITEONLY-NEXT: [[CONV_I:%.*]] = uitofp nneg i32 [[MUL_I]] to double
8149 // FINITEONLY-NEXT: [[DIV_I:%.*]] = fdiv nnan ninf contract double [[CONV_I]], [[Y]]
8150 // FINITEONLY-NEXT: [[MUL8_I:%.*]] = fmul nnan ninf contract double [[__X1_0_I3]], [[DIV_I]]
8151 // FINITEONLY-NEXT: [[SUB_I]] = fsub nnan ninf contract double [[MUL8_I]], [[__X0_0_I2]]
8152 // FINITEONLY-NEXT: [[INC_I]] = add nuw nsw i32 [[__I_0_I4]], 1
8153 // FINITEONLY-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC_I]], [[X]]
8154 // FINITEONLY-NEXT: br i1 [[EXITCOND_NOT]], label %[[_ZL2YNID_EXIT]], label %[[FOR_BODY_I]], !llvm.loop [[LOOP25:![0-9]+]]
8155 // FINITEONLY: [[_ZL2YNID_EXIT]]:
8156 // FINITEONLY-NEXT: [[RETVAL_0_I:%.*]] = phi double [ [[CALL_I20_I]], %[[IF_THEN_I]] ], [ [[CALL_I22_I]], %[[IF_THEN2_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ], [ [[SUB_I]], %[[FOR_BODY_I]] ]
8157 // FINITEONLY-NEXT: ret double [[RETVAL_0_I]]
8158 //
8159 // APPROX-LABEL: define dso_local double @test_yn(
8160 // APPROX-SAME: i32 noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
8161 // APPROX-NEXT: [[ENTRY:.*:]]
8162 // APPROX-NEXT: switch i32 [[X]], label %[[IF_END4_I:.*]] [
8163 // APPROX-NEXT: i32 0, label %[[IF_THEN_I:.*]]
8164 // APPROX-NEXT: i32 1, label %[[IF_THEN2_I:.*]]
8165 // APPROX-NEXT: ]
8166 // APPROX: [[IF_THEN_I]]:
8167 // APPROX-NEXT: [[CALL_I20_I:%.*]] = tail call contract noundef double @__ocml_y0_f64(double noundef [[Y]]) #[[ATTR15]]
8168 // APPROX-NEXT: br label %[[_ZL2YNID_EXIT:.*]]
8169 // APPROX: [[IF_THEN2_I]]:
8170 // APPROX-NEXT: [[CALL_I22_I:%.*]] = tail call contract noundef double @__ocml_y1_f64(double noundef [[Y]]) #[[ATTR15]]
8171 // APPROX-NEXT: br label %[[_ZL2YNID_EXIT]]
8172 // APPROX: [[IF_END4_I]]:
8173 // APPROX-NEXT: [[CALL_I_I:%.*]] = tail call contract noundef double @__ocml_y0_f64(double noundef [[Y]]) #[[ATTR15]]
8174 // APPROX-NEXT: [[CALL_I21_I:%.*]] = tail call contract noundef double @__ocml_y1_f64(double noundef [[Y]]) #[[ATTR15]]
8175 // APPROX-NEXT: [[CMP7_I1:%.*]] = icmp sgt i32 [[X]], 1
8176 // APPROX-NEXT: br i1 [[CMP7_I1]], label %[[FOR_BODY_I:.*]], label %[[_ZL2YNID_EXIT]]
8177 // APPROX: [[FOR_BODY_I]]:
8178 // APPROX-NEXT: [[__I_0_I4:%.*]] = phi i32 [ [[INC_I:%.*]], %[[FOR_BODY_I]] ], [ 1, %[[IF_END4_I]] ]
8179 // APPROX-NEXT: [[__X1_0_I3:%.*]] = phi double [ [[SUB_I:%.*]], %[[FOR_BODY_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ]
8180 // APPROX-NEXT: [[__X0_0_I2:%.*]] = phi double [ [[__X1_0_I3]], %[[FOR_BODY_I]] ], [ [[CALL_I_I]], %[[IF_END4_I]] ]
8181 // APPROX-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
8182 // APPROX-NEXT: [[CONV_I:%.*]] = uitofp nneg i32 [[MUL_I]] to double
8183 // APPROX-NEXT: [[DIV_I:%.*]] = fdiv contract double [[CONV_I]], [[Y]]
8184 // APPROX-NEXT: [[MUL8_I:%.*]] = fmul contract double [[__X1_0_I3]], [[DIV_I]]
8185 // APPROX-NEXT: [[SUB_I]] = fsub contract double [[MUL8_I]], [[__X0_0_I2]]
8186 // APPROX-NEXT: [[INC_I]] = add nuw nsw i32 [[__I_0_I4]], 1
8187 // APPROX-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC_I]], [[X]]
8188 // APPROX-NEXT: br i1 [[EXITCOND_NOT]], label %[[_ZL2YNID_EXIT]], label %[[FOR_BODY_I]], !llvm.loop [[LOOP25:![0-9]+]]
8189 // APPROX: [[_ZL2YNID_EXIT]]:
8190 // APPROX-NEXT: [[RETVAL_0_I:%.*]] = phi double [ [[CALL_I20_I]], %[[IF_THEN_I]] ], [ [[CALL_I22_I]], %[[IF_THEN2_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ], [ [[SUB_I]], %[[FOR_BODY_I]] ]
8191 // APPROX-NEXT: ret double [[RETVAL_0_I]]
8192 //
8193 // NCRDIV-LABEL: define dso_local double @test_yn(
8194 // NCRDIV-SAME: i32 noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR6]] {
8195 // NCRDIV-NEXT: [[ENTRY:.*:]]
8196 // NCRDIV-NEXT: switch i32 [[X]], label %[[IF_END4_I:.*]] [
8197 // NCRDIV-NEXT: i32 0, label %[[IF_THEN_I:.*]]
8198 // NCRDIV-NEXT: i32 1, label %[[IF_THEN2_I:.*]]
8199 // NCRDIV-NEXT: ]
8200 // NCRDIV: [[IF_THEN_I]]:
8201 // NCRDIV-NEXT: [[CALL_I20_I:%.*]] = tail call contract noundef double @__ocml_y0_f64(double noundef [[Y]]) #[[ATTR15]]
8202 // NCRDIV-NEXT: br label %[[_ZL2YNID_EXIT:.*]]
8203 // NCRDIV: [[IF_THEN2_I]]:
8204 // NCRDIV-NEXT: [[CALL_I22_I:%.*]] = tail call contract noundef double @__ocml_y1_f64(double noundef [[Y]]) #[[ATTR15]]
8205 // NCRDIV-NEXT: br label %[[_ZL2YNID_EXIT]]
8206 // NCRDIV: [[IF_END4_I]]:
8207 // NCRDIV-NEXT: [[CALL_I_I:%.*]] = tail call contract noundef double @__ocml_y0_f64(double noundef [[Y]]) #[[ATTR15]]
8208 // NCRDIV-NEXT: [[CALL_I21_I:%.*]] = tail call contract noundef double @__ocml_y1_f64(double noundef [[Y]]) #[[ATTR15]]
8209 // NCRDIV-NEXT: [[CMP7_I1:%.*]] = icmp sgt i32 [[X]], 1
8210 // NCRDIV-NEXT: br i1 [[CMP7_I1]], label %[[FOR_BODY_I:.*]], label %[[_ZL2YNID_EXIT]]
8211 // NCRDIV: [[FOR_BODY_I]]:
8212 // NCRDIV-NEXT: [[__I_0_I4:%.*]] = phi i32 [ [[INC_I:%.*]], %[[FOR_BODY_I]] ], [ 1, %[[IF_END4_I]] ]
8213 // NCRDIV-NEXT: [[__X1_0_I3:%.*]] = phi double [ [[SUB_I:%.*]], %[[FOR_BODY_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ]
8214 // NCRDIV-NEXT: [[__X0_0_I2:%.*]] = phi double [ [[__X1_0_I3]], %[[FOR_BODY_I]] ], [ [[CALL_I_I]], %[[IF_END4_I]] ]
8215 // NCRDIV-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
8216 // NCRDIV-NEXT: [[CONV_I:%.*]] = uitofp nneg i32 [[MUL_I]] to double
8217 // NCRDIV-NEXT: [[DIV_I:%.*]] = fdiv contract double [[CONV_I]], [[Y]]
8218 // NCRDIV-NEXT: [[MUL8_I:%.*]] = fmul contract double [[__X1_0_I3]], [[DIV_I]]
8219 // NCRDIV-NEXT: [[SUB_I]] = fsub contract double [[MUL8_I]], [[__X0_0_I2]]
8220 // NCRDIV-NEXT: [[INC_I]] = add nuw nsw i32 [[__I_0_I4]], 1
8221 // NCRDIV-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC_I]], [[X]]
8222 // NCRDIV-NEXT: br i1 [[EXITCOND_NOT]], label %[[_ZL2YNID_EXIT]], label %[[FOR_BODY_I]], !llvm.loop [[LOOP27:![0-9]+]]
8223 // NCRDIV: [[_ZL2YNID_EXIT]]:
8224 // NCRDIV-NEXT: [[RETVAL_0_I:%.*]] = phi double [ [[CALL_I20_I]], %[[IF_THEN_I]] ], [ [[CALL_I22_I]], %[[IF_THEN2_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ], [ [[SUB_I]], %[[FOR_BODY_I]] ]
8225 // NCRDIV-NEXT: ret double [[RETVAL_0_I]]
8226 //
8227 // AMDGCNSPIRV-LABEL: define spir_func double @test_yn(
8228 // AMDGCNSPIRV-SAME: i32 noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
8229 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8230 // AMDGCNSPIRV-NEXT: switch i32 [[X]], label %[[IF_END4_I:.*]] [
8231 // AMDGCNSPIRV-NEXT: i32 0, label %[[IF_THEN_I:.*]]
8232 // AMDGCNSPIRV-NEXT: i32 1, label %[[IF_THEN2_I:.*]]
8233 // AMDGCNSPIRV-NEXT: ]
8234 // AMDGCNSPIRV: [[IF_THEN_I]]:
8235 // AMDGCNSPIRV-NEXT: [[CALL_I20_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_y0_f64(double noundef [[Y]]) #[[ATTR15]]
8236 // AMDGCNSPIRV-NEXT: br label %[[_ZL2YNID_EXIT:.*]]
8237 // AMDGCNSPIRV: [[IF_THEN2_I]]:
8238 // AMDGCNSPIRV-NEXT: [[CALL_I22_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_y1_f64(double noundef [[Y]]) #[[ATTR15]]
8239 // AMDGCNSPIRV-NEXT: br label %[[_ZL2YNID_EXIT]]
8240 // AMDGCNSPIRV: [[IF_END4_I]]:
8241 // AMDGCNSPIRV-NEXT: [[CALL_I_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_y0_f64(double noundef [[Y]]) #[[ATTR15]]
8242 // AMDGCNSPIRV-NEXT: [[CALL_I21_I:%.*]] = tail call contract spir_func noundef addrspace(4) double @__ocml_y1_f64(double noundef [[Y]]) #[[ATTR15]]
8243 // AMDGCNSPIRV-NEXT: [[CMP7_I1:%.*]] = icmp sgt i32 [[X]], 1
8244 // AMDGCNSPIRV-NEXT: br i1 [[CMP7_I1]], label %[[FOR_BODY_I:.*]], label %[[_ZL2YNID_EXIT]]
8245 // AMDGCNSPIRV: [[FOR_BODY_I]]:
8246 // AMDGCNSPIRV-NEXT: [[__I_0_I4:%.*]] = phi i32 [ [[INC_I:%.*]], %[[FOR_BODY_I]] ], [ 1, %[[IF_END4_I]] ]
8247 // AMDGCNSPIRV-NEXT: [[__X1_0_I3:%.*]] = phi double [ [[SUB_I:%.*]], %[[FOR_BODY_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ]
8248 // AMDGCNSPIRV-NEXT: [[__X0_0_I2:%.*]] = phi double [ [[__X1_0_I3]], %[[FOR_BODY_I]] ], [ [[CALL_I_I]], %[[IF_END4_I]] ]
8249 // AMDGCNSPIRV-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
8250 // AMDGCNSPIRV-NEXT: [[CONV_I:%.*]] = uitofp nneg i32 [[MUL_I]] to double
8251 // AMDGCNSPIRV-NEXT: [[DIV_I:%.*]] = fdiv contract double [[CONV_I]], [[Y]]
8252 // AMDGCNSPIRV-NEXT: [[MUL8_I:%.*]] = fmul contract double [[__X1_0_I3]], [[DIV_I]]
8253 // AMDGCNSPIRV-NEXT: [[SUB_I]] = fsub contract double [[MUL8_I]], [[__X0_0_I2]]
8254 // AMDGCNSPIRV-NEXT: [[INC_I]] = add nuw nsw i32 [[__I_0_I4]], 1
8255 // AMDGCNSPIRV-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC_I]], [[X]]
8256 // AMDGCNSPIRV-NEXT: br i1 [[EXITCOND_NOT]], label %[[_ZL2YNID_EXIT]], label %[[FOR_BODY_I]], !llvm.loop [[LOOP26:![0-9]+]]
8257 // AMDGCNSPIRV: [[_ZL2YNID_EXIT]]:
8258 // AMDGCNSPIRV-NEXT: [[RETVAL_0_I:%.*]] = phi double [ [[CALL_I20_I]], %[[IF_THEN_I]] ], [ [[CALL_I22_I]], %[[IF_THEN2_I]] ], [ [[CALL_I21_I]], %[[IF_END4_I]] ], [ [[SUB_I]], %[[FOR_BODY_I]] ]
8259 // AMDGCNSPIRV-NEXT: ret double [[RETVAL_0_I]]
8260 //
8261 extern "C" __device__ double test_yn(int x, double y) {
8262 return yn(x, y);
8263 }
8264
8265 // DEFAULT-LABEL: define dso_local noundef float @test___cosf(
8266 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
8267 // DEFAULT-NEXT: [[ENTRY:.*:]]
8268 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_native_cos_f32(float noundef [[X]]) #[[ATTR15]]
8269 // DEFAULT-NEXT: ret float [[CALL_I]]
8270 //
8271 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test___cosf(
8272 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
8273 // FINITEONLY-NEXT: [[ENTRY:.*:]]
8274 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_native_cos_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
8275 // FINITEONLY-NEXT: ret float [[CALL_I]]
8276 //
8277 // APPROX-LABEL: define dso_local noundef float @test___cosf(
8278 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
8279 // APPROX-NEXT: [[ENTRY:.*:]]
8280 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_native_cos_f32(float noundef [[X]]) #[[ATTR15]]
8281 // APPROX-NEXT: ret float [[CALL_I]]
8282 //
8283 // NCRDIV-LABEL: define dso_local noundef float @test___cosf(
8284 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
8285 // NCRDIV-NEXT: [[ENTRY:.*:]]
8286 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_native_cos_f32(float noundef [[X]]) #[[ATTR15]]
8287 // NCRDIV-NEXT: ret float [[CALL_I]]
8288 //
8289 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test___cosf(
8290 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
8291 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8292 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_native_cos_f32(float noundef [[X]]) #[[ATTR15]]
8293 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
8294 //
8295 extern "C" __device__ float test___cosf(float x) {
8296 return __cosf(x);
8297 }
8298
8299 // DEFAULT-LABEL: define dso_local noundef float @test___exp10f(
8300 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8301 // DEFAULT-NEXT: [[ENTRY:.*:]]
8302 // DEFAULT-NEXT: [[MUL_I:%.*]] = fmul contract float [[X]], 0x400A934F00000000
8303 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.amdgcn.exp2.f32(float [[MUL_I]])
8304 // DEFAULT-NEXT: ret float [[TMP0]]
8305 //
8306 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test___exp10f(
8307 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8308 // FINITEONLY-NEXT: [[ENTRY:.*:]]
8309 // FINITEONLY-NEXT: [[MUL_I:%.*]] = fmul nnan ninf contract float [[X]], 0x400A934F00000000
8310 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.amdgcn.exp2.f32(float [[MUL_I]])
8311 // FINITEONLY-NEXT: ret float [[TMP0]]
8312 //
8313 // APPROX-LABEL: define dso_local noundef float @test___exp10f(
8314 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8315 // APPROX-NEXT: [[ENTRY:.*:]]
8316 // APPROX-NEXT: [[MUL_I:%.*]] = fmul contract float [[X]], 0x400A934F00000000
8317 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.amdgcn.exp2.f32(float [[MUL_I]])
8318 // APPROX-NEXT: ret float [[TMP0]]
8319 //
8320 // NCRDIV-LABEL: define dso_local noundef float @test___exp10f(
8321 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8322 // NCRDIV-NEXT: [[ENTRY:.*:]]
8323 // NCRDIV-NEXT: [[MUL_I:%.*]] = fmul contract float [[X]], 0x400A934F00000000
8324 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.amdgcn.exp2.f32(float [[MUL_I]])
8325 // NCRDIV-NEXT: ret float [[TMP0]]
8326 //
8327 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test___exp10f(
8328 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
8329 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8330 // AMDGCNSPIRV-NEXT: [[MUL_I:%.*]] = fmul contract float [[X]], 0x400A934F00000000
8331 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.amdgcn.exp2.f32(float [[MUL_I]])
8332 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
8333 //
8334 extern "C" __device__ float test___exp10f(float x) {
8335 return __exp10f(x);
8336 }
8337
8338 // DEFAULT-LABEL: define dso_local noundef float @test___expf(
8339 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8340 // DEFAULT-NEXT: [[ENTRY:.*:]]
8341 // DEFAULT-NEXT: [[MUL_I:%.*]] = fmul contract float [[X]], 0x3FF7154760000000
8342 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.amdgcn.exp2.f32(float [[MUL_I]])
8343 // DEFAULT-NEXT: ret float [[TMP0]]
8344 //
8345 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test___expf(
8346 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8347 // FINITEONLY-NEXT: [[ENTRY:.*:]]
8348 // FINITEONLY-NEXT: [[MUL_I:%.*]] = fmul nnan ninf contract float [[X]], 0x3FF7154760000000
8349 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.amdgcn.exp2.f32(float [[MUL_I]])
8350 // FINITEONLY-NEXT: ret float [[TMP0]]
8351 //
8352 // APPROX-LABEL: define dso_local noundef float @test___expf(
8353 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8354 // APPROX-NEXT: [[ENTRY:.*:]]
8355 // APPROX-NEXT: [[MUL_I:%.*]] = fmul contract float [[X]], 0x3FF7154760000000
8356 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.amdgcn.exp2.f32(float [[MUL_I]])
8357 // APPROX-NEXT: ret float [[TMP0]]
8358 //
8359 // NCRDIV-LABEL: define dso_local noundef float @test___expf(
8360 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8361 // NCRDIV-NEXT: [[ENTRY:.*:]]
8362 // NCRDIV-NEXT: [[MUL_I:%.*]] = fmul contract float [[X]], 0x3FF7154760000000
8363 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.amdgcn.exp2.f32(float [[MUL_I]])
8364 // NCRDIV-NEXT: ret float [[TMP0]]
8365 //
8366 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test___expf(
8367 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
8368 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8369 // AMDGCNSPIRV-NEXT: [[MUL_I:%.*]] = fmul contract float [[X]], 0x3FF7154760000000
8370 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.amdgcn.exp2.f32(float [[MUL_I]])
8371 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
8372 //
8373 extern "C" __device__ float test___expf(float x) {
8374 return __expf(x);
8375 }
8376
8377 // DEFAULT-LABEL: define dso_local noundef float @test___fadd_rn(
8378 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
8379 // DEFAULT-NEXT: [[ENTRY:.*:]]
8380 // DEFAULT-NEXT: [[ADD_I:%.*]] = fadd contract float [[X]], [[Y]]
8381 // DEFAULT-NEXT: ret float [[ADD_I]]
8382 //
8383 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) float @test___fadd_rn(
8384 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
8385 // FINITEONLY-NEXT: [[ENTRY:.*:]]
8386 // FINITEONLY-NEXT: [[ADD_I:%.*]] = fadd nnan ninf contract float [[X]], [[Y]]
8387 // FINITEONLY-NEXT: ret float [[ADD_I]]
8388 //
8389 // APPROX-LABEL: define dso_local noundef float @test___fadd_rn(
8390 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
8391 // APPROX-NEXT: [[ENTRY:.*:]]
8392 // APPROX-NEXT: [[ADD_I:%.*]] = fadd contract float [[X]], [[Y]]
8393 // APPROX-NEXT: ret float [[ADD_I]]
8394 //
8395 // NCRDIV-LABEL: define dso_local noundef float @test___fadd_rn(
8396 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
8397 // NCRDIV-NEXT: [[ENTRY:.*:]]
8398 // NCRDIV-NEXT: [[ADD_I:%.*]] = fadd contract float [[X]], [[Y]]
8399 // NCRDIV-NEXT: ret float [[ADD_I]]
8400 //
8401 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test___fadd_rn(
8402 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
8403 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8404 // AMDGCNSPIRV-NEXT: [[ADD_I:%.*]] = fadd contract float [[X]], [[Y]]
8405 // AMDGCNSPIRV-NEXT: ret float [[ADD_I]]
8406 //
8407 extern "C" __device__ float test___fadd_rn(float x, float y) {
8408 return __fadd_rn(x, y);
8409 }
8410
8411 // DEFAULT-LABEL: define dso_local noundef float @test___fdividef(
8412 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
8413 // DEFAULT-NEXT: [[ENTRY:.*:]]
8414 // DEFAULT-NEXT: [[DIV_I:%.*]] = fdiv contract float [[X]], [[Y]]
8415 // DEFAULT-NEXT: ret float [[DIV_I]]
8416 //
8417 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) float @test___fdividef(
8418 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
8419 // FINITEONLY-NEXT: [[ENTRY:.*:]]
8420 // FINITEONLY-NEXT: [[DIV_I:%.*]] = fdiv nnan ninf contract float [[X]], [[Y]]
8421 // FINITEONLY-NEXT: ret float [[DIV_I]]
8422 //
8423 // APPROX-LABEL: define dso_local noundef float @test___fdividef(
8424 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
8425 // APPROX-NEXT: [[ENTRY:.*:]]
8426 // APPROX-NEXT: [[DIV_I:%.*]] = fdiv contract float [[X]], [[Y]]
8427 // APPROX-NEXT: ret float [[DIV_I]]
8428 //
8429 // NCRDIV-LABEL: define dso_local noundef float @test___fdividef(
8430 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
8431 // NCRDIV-NEXT: [[ENTRY:.*:]]
8432 // NCRDIV-NEXT: [[DIV_I:%.*]] = fdiv contract float [[X]], [[Y]], !fpmath [[META14]]
8433 // NCRDIV-NEXT: ret float [[DIV_I]]
8434 //
8435 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test___fdividef(
8436 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
8437 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8438 // AMDGCNSPIRV-NEXT: [[DIV_I:%.*]] = fdiv contract float [[X]], [[Y]]
8439 // AMDGCNSPIRV-NEXT: ret float [[DIV_I]]
8440 //
8441 extern "C" __device__ float test___fdividef(float x, float y) {
8442 return __fdividef(x, y);
8443 }
8444
8445 // DEFAULT-LABEL: define dso_local noundef float @test__fmaf_rn(
8446 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR3]] {
8447 // DEFAULT-NEXT: [[ENTRY:.*:]]
8448 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.fma.f32(float [[X]], float [[Y]], float [[Z]])
8449 // DEFAULT-NEXT: ret float [[TMP0]]
8450 //
8451 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test__fmaf_rn(
8452 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]], float noundef nofpclass(nan inf) [[Z:%.*]]) local_unnamed_addr #[[ATTR3]] {
8453 // FINITEONLY-NEXT: [[ENTRY:.*:]]
8454 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.fma.f32(float nofpclass(nan inf) [[X]], float nofpclass(nan inf) [[Y]], float nofpclass(nan inf) [[Z]])
8455 // FINITEONLY-NEXT: ret float [[TMP0]]
8456 //
8457 // APPROX-LABEL: define dso_local noundef float @test__fmaf_rn(
8458 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR3]] {
8459 // APPROX-NEXT: [[ENTRY:.*:]]
8460 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.fma.f32(float [[X]], float [[Y]], float [[Z]])
8461 // APPROX-NEXT: ret float [[TMP0]]
8462 //
8463 // NCRDIV-LABEL: define dso_local noundef float @test__fmaf_rn(
8464 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR3]] {
8465 // NCRDIV-NEXT: [[ENTRY:.*:]]
8466 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.fma.f32(float [[X]], float [[Y]], float [[Z]])
8467 // NCRDIV-NEXT: ret float [[TMP0]]
8468 //
8469 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test__fmaf_rn(
8470 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]], float noundef [[Z:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
8471 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8472 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.fma.f32(float [[X]], float [[Y]], float [[Z]])
8473 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
8474 //
8475 extern "C" __device__ float test__fmaf_rn(float x, float y, float z) {
8476 return __fmaf_rn(x, y, z);
8477 }
8478
8479 // DEFAULT-LABEL: define dso_local noundef float @test___fmul_rn(
8480 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
8481 // DEFAULT-NEXT: [[ENTRY:.*:]]
8482 // DEFAULT-NEXT: [[MUL_I:%.*]] = fmul contract float [[X]], [[Y]]
8483 // DEFAULT-NEXT: ret float [[MUL_I]]
8484 //
8485 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) float @test___fmul_rn(
8486 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
8487 // FINITEONLY-NEXT: [[ENTRY:.*:]]
8488 // FINITEONLY-NEXT: [[MUL_I:%.*]] = fmul nnan ninf contract float [[X]], [[Y]]
8489 // FINITEONLY-NEXT: ret float [[MUL_I]]
8490 //
8491 // APPROX-LABEL: define dso_local noundef float @test___fmul_rn(
8492 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
8493 // APPROX-NEXT: [[ENTRY:.*:]]
8494 // APPROX-NEXT: [[MUL_I:%.*]] = fmul contract float [[X]], [[Y]]
8495 // APPROX-NEXT: ret float [[MUL_I]]
8496 //
8497 // NCRDIV-LABEL: define dso_local noundef float @test___fmul_rn(
8498 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
8499 // NCRDIV-NEXT: [[ENTRY:.*:]]
8500 // NCRDIV-NEXT: [[MUL_I:%.*]] = fmul contract float [[X]], [[Y]]
8501 // NCRDIV-NEXT: ret float [[MUL_I]]
8502 //
8503 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test___fmul_rn(
8504 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
8505 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8506 // AMDGCNSPIRV-NEXT: [[MUL_I:%.*]] = fmul contract float [[X]], [[Y]]
8507 // AMDGCNSPIRV-NEXT: ret float [[MUL_I]]
8508 //
8509 extern "C" __device__ float test___fmul_rn(float x, float y) {
8510 return __fmul_rn(x, y);
8511 }
8512
8513 // DEFAULT-LABEL: define dso_local noundef float @test___frcp_rn(
8514 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8515 // DEFAULT-NEXT: [[ENTRY:.*:]]
8516 // DEFAULT-NEXT: [[DIV_I:%.*]] = fdiv contract float 1.000000e+00, [[X]]
8517 // DEFAULT-NEXT: ret float [[DIV_I]]
8518 //
8519 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) float @test___frcp_rn(
8520 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8521 // FINITEONLY-NEXT: [[ENTRY:.*:]]
8522 // FINITEONLY-NEXT: [[DIV_I:%.*]] = fdiv nnan ninf contract float 1.000000e+00, [[X]]
8523 // FINITEONLY-NEXT: ret float [[DIV_I]]
8524 //
8525 // APPROX-LABEL: define dso_local noundef float @test___frcp_rn(
8526 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8527 // APPROX-NEXT: [[ENTRY:.*:]]
8528 // APPROX-NEXT: [[DIV_I:%.*]] = fdiv contract float 1.000000e+00, [[X]]
8529 // APPROX-NEXT: ret float [[DIV_I]]
8530 //
8531 // NCRDIV-LABEL: define dso_local noundef float @test___frcp_rn(
8532 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8533 // NCRDIV-NEXT: [[ENTRY:.*:]]
8534 // NCRDIV-NEXT: [[DIV_I:%.*]] = fdiv contract float 1.000000e+00, [[X]], !fpmath [[META14]]
8535 // NCRDIV-NEXT: ret float [[DIV_I]]
8536 //
8537 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test___frcp_rn(
8538 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
8539 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8540 // AMDGCNSPIRV-NEXT: [[DIV_I:%.*]] = fdiv contract float 1.000000e+00, [[X]]
8541 // AMDGCNSPIRV-NEXT: ret float [[DIV_I]]
8542 //
8543 extern "C" __device__ float test___frcp_rn(float x) {
8544 return __frcp_rn(x);
8545 }
8546
8547 // DEFAULT-LABEL: define dso_local noundef float @test___frsqrt_rn(
8548 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8549 // DEFAULT-NEXT: [[ENTRY:.*:]]
8550 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.amdgcn.rsq.f32(float [[X]])
8551 // DEFAULT-NEXT: ret float [[TMP0]]
8552 //
8553 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test___frsqrt_rn(
8554 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8555 // FINITEONLY-NEXT: [[ENTRY:.*:]]
8556 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.amdgcn.rsq.f32(float nofpclass(nan inf) [[X]])
8557 // FINITEONLY-NEXT: ret float [[TMP0]]
8558 //
8559 // APPROX-LABEL: define dso_local noundef float @test___frsqrt_rn(
8560 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8561 // APPROX-NEXT: [[ENTRY:.*:]]
8562 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.amdgcn.rsq.f32(float [[X]])
8563 // APPROX-NEXT: ret float [[TMP0]]
8564 //
8565 // NCRDIV-LABEL: define dso_local noundef float @test___frsqrt_rn(
8566 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8567 // NCRDIV-NEXT: [[ENTRY:.*:]]
8568 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.amdgcn.rsq.f32(float [[X]])
8569 // NCRDIV-NEXT: ret float [[TMP0]]
8570 //
8571 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test___frsqrt_rn(
8572 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
8573 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8574 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.amdgcn.rsq.f32(float [[X]])
8575 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
8576 //
8577 extern "C" __device__ float test___frsqrt_rn(float x) {
8578 return __frsqrt_rn(x);
8579 }
8580
8581 // DEFAULT-LABEL: define dso_local noundef float @test___fsqrt_rn(
8582 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
8583 // DEFAULT-NEXT: [[ENTRY:.*:]]
8584 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_native_sqrt_f32(float noundef [[X]]) #[[ATTR13]]
8585 // DEFAULT-NEXT: ret float [[CALL_I]]
8586 //
8587 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test___fsqrt_rn(
8588 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
8589 // FINITEONLY-NEXT: [[ENTRY:.*:]]
8590 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_native_sqrt_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR13]]
8591 // FINITEONLY-NEXT: ret float [[CALL_I]]
8592 //
8593 // APPROX-LABEL: define dso_local noundef float @test___fsqrt_rn(
8594 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
8595 // APPROX-NEXT: [[ENTRY:.*:]]
8596 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_native_sqrt_f32(float noundef [[X]]) #[[ATTR13]]
8597 // APPROX-NEXT: ret float [[CALL_I]]
8598 //
8599 // NCRDIV-LABEL: define dso_local noundef float @test___fsqrt_rn(
8600 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR4]] {
8601 // NCRDIV-NEXT: [[ENTRY:.*:]]
8602 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_native_sqrt_f32(float noundef [[X]]) #[[ATTR13]]
8603 // NCRDIV-NEXT: ret float [[CALL_I]]
8604 //
8605 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test___fsqrt_rn(
8606 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR4]] {
8607 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8608 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_native_sqrt_f32(float noundef [[X]]) #[[ATTR13]]
8609 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
8610 //
8611 extern "C" __device__ float test___fsqrt_rn(float x) {
8612 return __fsqrt_rn(x);
8613 }
8614
8615 // DEFAULT-LABEL: define dso_local noundef float @test___fsub_rn(
8616 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
8617 // DEFAULT-NEXT: [[ENTRY:.*:]]
8618 // DEFAULT-NEXT: [[SUB_I:%.*]] = fsub contract float [[X]], [[Y]]
8619 // DEFAULT-NEXT: ret float [[SUB_I]]
8620 //
8621 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) float @test___fsub_rn(
8622 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
8623 // FINITEONLY-NEXT: [[ENTRY:.*:]]
8624 // FINITEONLY-NEXT: [[SUB_I:%.*]] = fsub nnan ninf contract float [[X]], [[Y]]
8625 // FINITEONLY-NEXT: ret float [[SUB_I]]
8626 //
8627 // APPROX-LABEL: define dso_local noundef float @test___fsub_rn(
8628 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
8629 // APPROX-NEXT: [[ENTRY:.*:]]
8630 // APPROX-NEXT: [[SUB_I:%.*]] = fsub contract float [[X]], [[Y]]
8631 // APPROX-NEXT: ret float [[SUB_I]]
8632 //
8633 // NCRDIV-LABEL: define dso_local noundef float @test___fsub_rn(
8634 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
8635 // NCRDIV-NEXT: [[ENTRY:.*:]]
8636 // NCRDIV-NEXT: [[SUB_I:%.*]] = fsub contract float [[X]], [[Y]]
8637 // NCRDIV-NEXT: ret float [[SUB_I]]
8638 //
8639 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test___fsub_rn(
8640 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
8641 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8642 // AMDGCNSPIRV-NEXT: [[SUB_I:%.*]] = fsub contract float [[X]], [[Y]]
8643 // AMDGCNSPIRV-NEXT: ret float [[SUB_I]]
8644 //
8645 extern "C" __device__ float test___fsub_rn(float x, float y) {
8646 return __fsub_rn(x, y);
8647 }
8648
8649 // DEFAULT-LABEL: define dso_local noundef float @test___log10f(
8650 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8651 // DEFAULT-NEXT: [[ENTRY:.*:]]
8652 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.log10.f32(float [[X]])
8653 // DEFAULT-NEXT: ret float [[TMP0]]
8654 //
8655 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test___log10f(
8656 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8657 // FINITEONLY-NEXT: [[ENTRY:.*:]]
8658 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.log10.f32(float nofpclass(nan inf) [[X]])
8659 // FINITEONLY-NEXT: ret float [[TMP0]]
8660 //
8661 // APPROX-LABEL: define dso_local noundef float @test___log10f(
8662 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8663 // APPROX-NEXT: [[ENTRY:.*:]]
8664 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.log10.f32(float [[X]])
8665 // APPROX-NEXT: ret float [[TMP0]]
8666 //
8667 // NCRDIV-LABEL: define dso_local noundef float @test___log10f(
8668 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8669 // NCRDIV-NEXT: [[ENTRY:.*:]]
8670 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.log10.f32(float [[X]])
8671 // NCRDIV-NEXT: ret float [[TMP0]]
8672 //
8673 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test___log10f(
8674 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
8675 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8676 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.log10.f32(float [[X]])
8677 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
8678 //
8679 extern "C" __device__ float test___log10f(float x) {
8680 return __log10f(x);
8681 }
8682
8683 // DEFAULT-LABEL: define dso_local noundef float @test___log2f(
8684 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8685 // DEFAULT-NEXT: [[ENTRY:.*:]]
8686 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.amdgcn.log.f32(float [[X]])
8687 // DEFAULT-NEXT: ret float [[TMP0]]
8688 //
8689 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test___log2f(
8690 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8691 // FINITEONLY-NEXT: [[ENTRY:.*:]]
8692 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.amdgcn.log.f32(float nofpclass(nan inf) [[X]])
8693 // FINITEONLY-NEXT: ret float [[TMP0]]
8694 //
8695 // APPROX-LABEL: define dso_local noundef float @test___log2f(
8696 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8697 // APPROX-NEXT: [[ENTRY:.*:]]
8698 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.amdgcn.log.f32(float [[X]])
8699 // APPROX-NEXT: ret float [[TMP0]]
8700 //
8701 // NCRDIV-LABEL: define dso_local noundef float @test___log2f(
8702 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8703 // NCRDIV-NEXT: [[ENTRY:.*:]]
8704 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.amdgcn.log.f32(float [[X]])
8705 // NCRDIV-NEXT: ret float [[TMP0]]
8706 //
8707 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test___log2f(
8708 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
8709 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8710 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.amdgcn.log.f32(float [[X]])
8711 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
8712 //
8713 extern "C" __device__ float test___log2f(float x) {
8714 return __log2f(x);
8715 }
8716
8717 // DEFAULT-LABEL: define dso_local noundef float @test___logf(
8718 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8719 // DEFAULT-NEXT: [[ENTRY:.*:]]
8720 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.log.f32(float [[X]])
8721 // DEFAULT-NEXT: ret float [[TMP0]]
8722 //
8723 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test___logf(
8724 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8725 // FINITEONLY-NEXT: [[ENTRY:.*:]]
8726 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.log.f32(float nofpclass(nan inf) [[X]])
8727 // FINITEONLY-NEXT: ret float [[TMP0]]
8728 //
8729 // APPROX-LABEL: define dso_local noundef float @test___logf(
8730 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8731 // APPROX-NEXT: [[ENTRY:.*:]]
8732 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.log.f32(float [[X]])
8733 // APPROX-NEXT: ret float [[TMP0]]
8734 //
8735 // NCRDIV-LABEL: define dso_local noundef float @test___logf(
8736 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8737 // NCRDIV-NEXT: [[ENTRY:.*:]]
8738 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.log.f32(float [[X]])
8739 // NCRDIV-NEXT: ret float [[TMP0]]
8740 //
8741 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test___logf(
8742 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
8743 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8744 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.log.f32(float [[X]])
8745 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
8746 //
8747 extern "C" __device__ float test___logf(float x) {
8748 return __logf(x);
8749 }
8750
8751 // DEFAULT-LABEL: define dso_local noundef float @test___powf(
8752 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
8753 // DEFAULT-NEXT: [[ENTRY:.*:]]
8754 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_pow_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR14]]
8755 // DEFAULT-NEXT: ret float [[CALL_I]]
8756 //
8757 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test___powf(
8758 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
8759 // FINITEONLY-NEXT: [[ENTRY:.*:]]
8760 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_pow_f32(float noundef nofpclass(nan inf) [[X]], float noundef nofpclass(nan inf) [[Y]]) #[[ATTR14]]
8761 // FINITEONLY-NEXT: ret float [[CALL_I]]
8762 //
8763 // APPROX-LABEL: define dso_local noundef float @test___powf(
8764 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
8765 // APPROX-NEXT: [[ENTRY:.*:]]
8766 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_pow_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR14]]
8767 // APPROX-NEXT: ret float [[CALL_I]]
8768 //
8769 // NCRDIV-LABEL: define dso_local noundef float @test___powf(
8770 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR5]] {
8771 // NCRDIV-NEXT: [[ENTRY:.*:]]
8772 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_pow_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR14]]
8773 // NCRDIV-NEXT: ret float [[CALL_I]]
8774 //
8775 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test___powf(
8776 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR5]] {
8777 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8778 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_pow_f32(float noundef [[X]], float noundef [[Y]]) #[[ATTR14]]
8779 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
8780 //
8781 extern "C" __device__ float test___powf(float x, float y) {
8782 return __powf(x, y);
8783 }
8784
8785 // DEFAULT-LABEL: define dso_local noundef float @test___saturatef(
8786 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8787 // DEFAULT-NEXT: [[ENTRY:.*:]]
8788 // DEFAULT-NEXT: [[CMP_I:%.*]] = fcmp contract olt float [[X]], 0.000000e+00
8789 // DEFAULT-NEXT: [[CMP1_I:%.*]] = fcmp contract ogt float [[X]], 1.000000e+00
8790 // DEFAULT-NEXT: [[COND_I:%.*]] = select contract i1 [[CMP1_I]], float 1.000000e+00, float [[X]]
8791 // DEFAULT-NEXT: [[COND5_I:%.*]] = select contract i1 [[CMP_I]], float 0.000000e+00, float [[COND_I]]
8792 // DEFAULT-NEXT: ret float [[COND5_I]]
8793 //
8794 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) float @test___saturatef(
8795 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8796 // FINITEONLY-NEXT: [[ENTRY:.*:]]
8797 // FINITEONLY-NEXT: [[CMP_I:%.*]] = fcmp nnan ninf contract olt float [[X]], 0.000000e+00
8798 // FINITEONLY-NEXT: [[CMP1_I:%.*]] = fcmp nnan ninf contract ogt float [[X]], 1.000000e+00
8799 // FINITEONLY-NEXT: [[COND_I:%.*]] = select nnan ninf contract i1 [[CMP1_I]], float 1.000000e+00, float [[X]]
8800 // FINITEONLY-NEXT: [[COND5_I:%.*]] = select nnan ninf contract i1 [[CMP_I]], float 0.000000e+00, float [[COND_I]]
8801 // FINITEONLY-NEXT: ret float [[COND5_I]]
8802 //
8803 // APPROX-LABEL: define dso_local noundef float @test___saturatef(
8804 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8805 // APPROX-NEXT: [[ENTRY:.*:]]
8806 // APPROX-NEXT: [[CMP_I:%.*]] = fcmp contract olt float [[X]], 0.000000e+00
8807 // APPROX-NEXT: [[CMP1_I:%.*]] = fcmp contract ogt float [[X]], 1.000000e+00
8808 // APPROX-NEXT: [[COND_I:%.*]] = select contract i1 [[CMP1_I]], float 1.000000e+00, float [[X]]
8809 // APPROX-NEXT: [[COND5_I:%.*]] = select contract i1 [[CMP_I]], float 0.000000e+00, float [[COND_I]]
8810 // APPROX-NEXT: ret float [[COND5_I]]
8811 //
8812 // NCRDIV-LABEL: define dso_local noundef float @test___saturatef(
8813 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8814 // NCRDIV-NEXT: [[ENTRY:.*:]]
8815 // NCRDIV-NEXT: [[CMP_I:%.*]] = fcmp contract olt float [[X]], 0.000000e+00
8816 // NCRDIV-NEXT: [[CMP1_I:%.*]] = fcmp contract ogt float [[X]], 1.000000e+00
8817 // NCRDIV-NEXT: [[COND_I:%.*]] = select contract i1 [[CMP1_I]], float 1.000000e+00, float [[X]]
8818 // NCRDIV-NEXT: [[COND5_I:%.*]] = select contract i1 [[CMP_I]], float 0.000000e+00, float [[COND_I]]
8819 // NCRDIV-NEXT: ret float [[COND5_I]]
8820 //
8821 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test___saturatef(
8822 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
8823 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8824 // AMDGCNSPIRV-NEXT: [[CMP_I:%.*]] = fcmp contract olt float [[X]], 0.000000e+00
8825 // AMDGCNSPIRV-NEXT: [[CMP1_I:%.*]] = fcmp contract ogt float [[X]], 1.000000e+00
8826 // AMDGCNSPIRV-NEXT: [[COND_I:%.*]] = select contract i1 [[CMP1_I]], float 1.000000e+00, float [[X]]
8827 // AMDGCNSPIRV-NEXT: [[COND5_I:%.*]] = select contract i1 [[CMP_I]], float 0.000000e+00, float [[COND_I]]
8828 // AMDGCNSPIRV-NEXT: ret float [[COND5_I]]
8829 //
8830 extern "C" __device__ float test___saturatef(float x) {
8831 return __saturatef(x);
8832 }
8833
8834 // DEFAULT-LABEL: define dso_local void @test___sincosf(
8835 // DEFAULT-SAME: float noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
8836 // DEFAULT-NEXT: [[ENTRY:.*:]]
8837 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract float @__ocml_native_sin_f32(float noundef [[X]]) #[[ATTR15]]
8838 // DEFAULT-NEXT: store float [[CALL_I]], ptr [[Y]], align 4, !tbaa [[FLOAT_TBAA16]]
8839 // DEFAULT-NEXT: [[CALL1_I:%.*]] = tail call contract float @__ocml_native_cos_f32(float noundef [[X]]) #[[ATTR15]]
8840 // DEFAULT-NEXT: store float [[CALL1_I]], ptr [[Z]], align 4, !tbaa [[FLOAT_TBAA16]]
8841 // DEFAULT-NEXT: ret void
8842 //
8843 // FINITEONLY-LABEL: define dso_local void @test___sincosf(
8844 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
8845 // FINITEONLY-NEXT: [[ENTRY:.*:]]
8846 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract nofpclass(nan inf) float @__ocml_native_sin_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
8847 // FINITEONLY-NEXT: store float [[CALL_I]], ptr [[Y]], align 4, !tbaa [[FLOAT_TBAA16]]
8848 // FINITEONLY-NEXT: [[CALL1_I:%.*]] = tail call nnan ninf contract nofpclass(nan inf) float @__ocml_native_cos_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
8849 // FINITEONLY-NEXT: store float [[CALL1_I]], ptr [[Z]], align 4, !tbaa [[FLOAT_TBAA16]]
8850 // FINITEONLY-NEXT: ret void
8851 //
8852 // APPROX-LABEL: define dso_local void @test___sincosf(
8853 // APPROX-SAME: float noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
8854 // APPROX-NEXT: [[ENTRY:.*:]]
8855 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract float @__ocml_native_sin_f32(float noundef [[X]]) #[[ATTR15]]
8856 // APPROX-NEXT: store float [[CALL_I]], ptr [[Y]], align 4, !tbaa [[FLOAT_TBAA16]]
8857 // APPROX-NEXT: [[CALL1_I:%.*]] = tail call contract float @__ocml_native_cos_f32(float noundef [[X]]) #[[ATTR15]]
8858 // APPROX-NEXT: store float [[CALL1_I]], ptr [[Z]], align 4, !tbaa [[FLOAT_TBAA16]]
8859 // APPROX-NEXT: ret void
8860 //
8861 // NCRDIV-LABEL: define dso_local void @test___sincosf(
8862 // NCRDIV-SAME: float noundef [[X:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr #[[ATTR6]] {
8863 // NCRDIV-NEXT: [[ENTRY:.*:]]
8864 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract float @__ocml_native_sin_f32(float noundef [[X]]) #[[ATTR15]]
8865 // NCRDIV-NEXT: store float [[CALL_I]], ptr [[Y]], align 4, !tbaa [[FLOAT_TBAA17]]
8866 // NCRDIV-NEXT: [[CALL1_I:%.*]] = tail call contract float @__ocml_native_cos_f32(float noundef [[X]]) #[[ATTR15]]
8867 // NCRDIV-NEXT: store float [[CALL1_I]], ptr [[Z]], align 4, !tbaa [[FLOAT_TBAA17]]
8868 // NCRDIV-NEXT: ret void
8869 //
8870 // AMDGCNSPIRV-LABEL: define spir_func void @test___sincosf(
8871 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], ptr addrspace(4) noundef writeonly captures(none) initializes((0, 4)) [[Y:%.*]], ptr addrspace(4) noundef writeonly captures(none) initializes((0, 4)) [[Z:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
8872 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8873 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func addrspace(4) float @__ocml_native_sin_f32(float noundef [[X]]) #[[ATTR15]]
8874 // AMDGCNSPIRV-NEXT: store float [[CALL_I]], ptr addrspace(4) [[Y]], align 4, !tbaa [[FLOAT_TBAA17]]
8875 // AMDGCNSPIRV-NEXT: [[CALL1_I:%.*]] = tail call contract spir_func addrspace(4) float @__ocml_native_cos_f32(float noundef [[X]]) #[[ATTR15]]
8876 // AMDGCNSPIRV-NEXT: store float [[CALL1_I]], ptr addrspace(4) [[Z]], align 4, !tbaa [[FLOAT_TBAA17]]
8877 // AMDGCNSPIRV-NEXT: ret void
8878 //
8879 extern "C" __device__ void test___sincosf(float x, float *y, float *z) {
8880 __sincosf(x, y, z);
8881 }
8882
8883 // DEFAULT-LABEL: define dso_local noundef float @test___sinf(
8884 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
8885 // DEFAULT-NEXT: [[ENTRY:.*:]]
8886 // DEFAULT-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_native_sin_f32(float noundef [[X]]) #[[ATTR15]]
8887 // DEFAULT-NEXT: ret float [[CALL_I]]
8888 //
8889 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test___sinf(
8890 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
8891 // FINITEONLY-NEXT: [[ENTRY:.*:]]
8892 // FINITEONLY-NEXT: [[CALL_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_native_sin_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
8893 // FINITEONLY-NEXT: ret float [[CALL_I]]
8894 //
8895 // APPROX-LABEL: define dso_local noundef float @test___sinf(
8896 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
8897 // APPROX-NEXT: [[ENTRY:.*:]]
8898 // APPROX-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_native_sin_f32(float noundef [[X]]) #[[ATTR15]]
8899 // APPROX-NEXT: ret float [[CALL_I]]
8900 //
8901 // NCRDIV-LABEL: define dso_local noundef float @test___sinf(
8902 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
8903 // NCRDIV-NEXT: [[ENTRY:.*:]]
8904 // NCRDIV-NEXT: [[CALL_I:%.*]] = tail call contract noundef float @__ocml_native_sin_f32(float noundef [[X]]) #[[ATTR15]]
8905 // NCRDIV-NEXT: ret float [[CALL_I]]
8906 //
8907 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test___sinf(
8908 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
8909 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8910 // AMDGCNSPIRV-NEXT: [[CALL_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_native_sin_f32(float noundef [[X]]) #[[ATTR15]]
8911 // AMDGCNSPIRV-NEXT: ret float [[CALL_I]]
8912 //
8913 extern "C" __device__ float test___sinf(float x) {
8914 return __sinf(x);
8915 }
8916
8917 // DEFAULT-LABEL: define dso_local noundef float @test___tanf(
8918 // DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
8919 // DEFAULT-NEXT: [[ENTRY:.*:]]
8920 // DEFAULT-NEXT: [[CALL_I3_I:%.*]] = tail call contract noundef float @__ocml_native_sin_f32(float noundef [[X]]) #[[ATTR15]]
8921 // DEFAULT-NEXT: [[CALL_I_I:%.*]] = tail call contract noundef float @__ocml_native_cos_f32(float noundef [[X]]) #[[ATTR15]]
8922 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract float @llvm.amdgcn.rcp.f32(float [[CALL_I_I]])
8923 // DEFAULT-NEXT: [[MUL_I:%.*]] = fmul contract float [[CALL_I3_I]], [[TMP0]]
8924 // DEFAULT-NEXT: ret float [[MUL_I]]
8925 //
8926 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) float @test___tanf(
8927 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
8928 // FINITEONLY-NEXT: [[ENTRY:.*:]]
8929 // FINITEONLY-NEXT: [[CALL_I3_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_native_sin_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
8930 // FINITEONLY-NEXT: [[CALL_I_I:%.*]] = tail call nnan ninf contract noundef nofpclass(nan inf) float @__ocml_native_cos_f32(float noundef nofpclass(nan inf) [[X]]) #[[ATTR15]]
8931 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract float @llvm.amdgcn.rcp.f32(float [[CALL_I_I]])
8932 // FINITEONLY-NEXT: [[MUL_I:%.*]] = fmul nnan ninf contract float [[CALL_I3_I]], [[TMP0]]
8933 // FINITEONLY-NEXT: ret float [[MUL_I]]
8934 //
8935 // APPROX-LABEL: define dso_local noundef float @test___tanf(
8936 // APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
8937 // APPROX-NEXT: [[ENTRY:.*:]]
8938 // APPROX-NEXT: [[CALL_I3_I:%.*]] = tail call contract noundef float @__ocml_native_sin_f32(float noundef [[X]]) #[[ATTR15]]
8939 // APPROX-NEXT: [[CALL_I_I:%.*]] = tail call contract noundef float @__ocml_native_cos_f32(float noundef [[X]]) #[[ATTR15]]
8940 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract float @llvm.amdgcn.rcp.f32(float [[CALL_I_I]])
8941 // APPROX-NEXT: [[MUL_I:%.*]] = fmul contract float [[CALL_I3_I]], [[TMP0]]
8942 // APPROX-NEXT: ret float [[MUL_I]]
8943 //
8944 // NCRDIV-LABEL: define dso_local noundef float @test___tanf(
8945 // NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR6]] {
8946 // NCRDIV-NEXT: [[ENTRY:.*:]]
8947 // NCRDIV-NEXT: [[CALL_I3_I:%.*]] = tail call contract noundef float @__ocml_native_sin_f32(float noundef [[X]]) #[[ATTR15]]
8948 // NCRDIV-NEXT: [[CALL_I_I:%.*]] = tail call contract noundef float @__ocml_native_cos_f32(float noundef [[X]]) #[[ATTR15]]
8949 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract float @llvm.amdgcn.rcp.f32(float [[CALL_I_I]])
8950 // NCRDIV-NEXT: [[MUL_I:%.*]] = fmul contract float [[CALL_I3_I]], [[TMP0]]
8951 // NCRDIV-NEXT: ret float [[MUL_I]]
8952 //
8953 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test___tanf(
8954 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR6]] {
8955 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8956 // AMDGCNSPIRV-NEXT: [[CALL_I3_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_native_sin_f32(float noundef [[X]]) #[[ATTR15]]
8957 // AMDGCNSPIRV-NEXT: [[CALL_I_I:%.*]] = tail call contract spir_func noundef addrspace(4) float @__ocml_native_cos_f32(float noundef [[X]]) #[[ATTR15]]
8958 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract addrspace(4) float @llvm.amdgcn.rcp.f32(float [[CALL_I_I]])
8959 // AMDGCNSPIRV-NEXT: [[MUL_I:%.*]] = fmul contract float [[CALL_I3_I]], [[TMP0]]
8960 // AMDGCNSPIRV-NEXT: ret float [[MUL_I]]
8961 //
8962 extern "C" __device__ float test___tanf(float x) {
8963 return __tanf(x);
8964 }
8965
8966 // DEFAULT-LABEL: define dso_local noundef double @test___dadd_rn(
8967 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
8968 // DEFAULT-NEXT: [[ENTRY:.*:]]
8969 // DEFAULT-NEXT: [[ADD_I:%.*]] = fadd contract double [[X]], [[Y]]
8970 // DEFAULT-NEXT: ret double [[ADD_I]]
8971 //
8972 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) double @test___dadd_rn(
8973 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
8974 // FINITEONLY-NEXT: [[ENTRY:.*:]]
8975 // FINITEONLY-NEXT: [[ADD_I:%.*]] = fadd nnan ninf contract double [[X]], [[Y]]
8976 // FINITEONLY-NEXT: ret double [[ADD_I]]
8977 //
8978 // APPROX-LABEL: define dso_local noundef double @test___dadd_rn(
8979 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
8980 // APPROX-NEXT: [[ENTRY:.*:]]
8981 // APPROX-NEXT: [[ADD_I:%.*]] = fadd contract double [[X]], [[Y]]
8982 // APPROX-NEXT: ret double [[ADD_I]]
8983 //
8984 // NCRDIV-LABEL: define dso_local noundef double @test___dadd_rn(
8985 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
8986 // NCRDIV-NEXT: [[ENTRY:.*:]]
8987 // NCRDIV-NEXT: [[ADD_I:%.*]] = fadd contract double [[X]], [[Y]]
8988 // NCRDIV-NEXT: ret double [[ADD_I]]
8989 //
8990 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test___dadd_rn(
8991 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
8992 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
8993 // AMDGCNSPIRV-NEXT: [[ADD_I:%.*]] = fadd contract double [[X]], [[Y]]
8994 // AMDGCNSPIRV-NEXT: ret double [[ADD_I]]
8995 //
8996 extern "C" __device__ double test___dadd_rn(double x, double y) {
8997 return __dadd_rn(x, y);
8998 }
8999
9000 // DEFAULT-LABEL: define dso_local noundef double @test___ddiv_rn(
9001 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9002 // DEFAULT-NEXT: [[ENTRY:.*:]]
9003 // DEFAULT-NEXT: [[DIV_I:%.*]] = fdiv contract double [[X]], [[Y]]
9004 // DEFAULT-NEXT: ret double [[DIV_I]]
9005 //
9006 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) double @test___ddiv_rn(
9007 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9008 // FINITEONLY-NEXT: [[ENTRY:.*:]]
9009 // FINITEONLY-NEXT: [[DIV_I:%.*]] = fdiv nnan ninf contract double [[X]], [[Y]]
9010 // FINITEONLY-NEXT: ret double [[DIV_I]]
9011 //
9012 // APPROX-LABEL: define dso_local noundef double @test___ddiv_rn(
9013 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9014 // APPROX-NEXT: [[ENTRY:.*:]]
9015 // APPROX-NEXT: [[DIV_I:%.*]] = fdiv contract double [[X]], [[Y]]
9016 // APPROX-NEXT: ret double [[DIV_I]]
9017 //
9018 // NCRDIV-LABEL: define dso_local noundef double @test___ddiv_rn(
9019 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9020 // NCRDIV-NEXT: [[ENTRY:.*:]]
9021 // NCRDIV-NEXT: [[DIV_I:%.*]] = fdiv contract double [[X]], [[Y]]
9022 // NCRDIV-NEXT: ret double [[DIV_I]]
9023 //
9024 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test___ddiv_rn(
9025 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
9026 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
9027 // AMDGCNSPIRV-NEXT: [[DIV_I:%.*]] = fdiv contract double [[X]], [[Y]]
9028 // AMDGCNSPIRV-NEXT: ret double [[DIV_I]]
9029 //
9030 extern "C" __device__ double test___ddiv_rn(double x, double y) {
9031 return __ddiv_rn(x, y);
9032 }
9033
9034 // DEFAULT-LABEL: define dso_local noundef double @test___dmul_rn(
9035 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9036 // DEFAULT-NEXT: [[ENTRY:.*:]]
9037 // DEFAULT-NEXT: [[MUL_I:%.*]] = fmul contract double [[X]], [[Y]]
9038 // DEFAULT-NEXT: ret double [[MUL_I]]
9039 //
9040 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) double @test___dmul_rn(
9041 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9042 // FINITEONLY-NEXT: [[ENTRY:.*:]]
9043 // FINITEONLY-NEXT: [[MUL_I:%.*]] = fmul nnan ninf contract double [[X]], [[Y]]
9044 // FINITEONLY-NEXT: ret double [[MUL_I]]
9045 //
9046 // APPROX-LABEL: define dso_local noundef double @test___dmul_rn(
9047 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9048 // APPROX-NEXT: [[ENTRY:.*:]]
9049 // APPROX-NEXT: [[MUL_I:%.*]] = fmul contract double [[X]], [[Y]]
9050 // APPROX-NEXT: ret double [[MUL_I]]
9051 //
9052 // NCRDIV-LABEL: define dso_local noundef double @test___dmul_rn(
9053 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9054 // NCRDIV-NEXT: [[ENTRY:.*:]]
9055 // NCRDIV-NEXT: [[MUL_I:%.*]] = fmul contract double [[X]], [[Y]]
9056 // NCRDIV-NEXT: ret double [[MUL_I]]
9057 //
9058 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test___dmul_rn(
9059 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
9060 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
9061 // AMDGCNSPIRV-NEXT: [[MUL_I:%.*]] = fmul contract double [[X]], [[Y]]
9062 // AMDGCNSPIRV-NEXT: ret double [[MUL_I]]
9063 //
9064 extern "C" __device__ double test___dmul_rn(double x, double y) {
9065 return __dmul_rn(x, y);
9066 }
9067
9068 // DEFAULT-LABEL: define dso_local noundef double @test___drcp_rn(
9069 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
9070 // DEFAULT-NEXT: [[ENTRY:.*:]]
9071 // DEFAULT-NEXT: [[DIV_I:%.*]] = fdiv contract double 1.000000e+00, [[X]]
9072 // DEFAULT-NEXT: ret double [[DIV_I]]
9073 //
9074 // FINITEONLY-LABEL: define dso_local nofpclass(nan inf) double @test___drcp_rn(
9075 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
9076 // FINITEONLY-NEXT: [[ENTRY:.*:]]
9077 // FINITEONLY-NEXT: [[DIV_I:%.*]] = fdiv nnan ninf contract double 1.000000e+00, [[X]]
9078 // FINITEONLY-NEXT: ret double [[DIV_I]]
9079 //
9080 // APPROX-LABEL: define dso_local noundef double @test___drcp_rn(
9081 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
9082 // APPROX-NEXT: [[ENTRY:.*:]]
9083 // APPROX-NEXT: [[DIV_I:%.*]] = fdiv contract double 1.000000e+00, [[X]]
9084 // APPROX-NEXT: ret double [[DIV_I]]
9085 //
9086 // NCRDIV-LABEL: define dso_local noundef double @test___drcp_rn(
9087 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
9088 // NCRDIV-NEXT: [[ENTRY:.*:]]
9089 // NCRDIV-NEXT: [[DIV_I:%.*]] = fdiv contract double 1.000000e+00, [[X]]
9090 // NCRDIV-NEXT: ret double [[DIV_I]]
9091 //
9092 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test___drcp_rn(
9093 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
9094 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
9095 // AMDGCNSPIRV-NEXT: [[DIV_I:%.*]] = fdiv contract double 1.000000e+00, [[X]]
9096 // AMDGCNSPIRV-NEXT: ret double [[DIV_I]]
9097 //
9098 extern "C" __device__ double test___drcp_rn(double x) {
9099 return __drcp_rn(x);
9100 }
9101
9102 // DEFAULT-LABEL: define dso_local noundef double @test___dsqrt_rn(
9103 // DEFAULT-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
9104 // DEFAULT-NEXT: [[ENTRY:.*:]]
9105 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.sqrt.f64(double [[X]])
9106 // DEFAULT-NEXT: ret double [[TMP0]]
9107 //
9108 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test___dsqrt_rn(
9109 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
9110 // FINITEONLY-NEXT: [[ENTRY:.*:]]
9111 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef double @llvm.sqrt.f64(double nofpclass(nan inf) [[X]])
9112 // FINITEONLY-NEXT: ret double [[TMP0]]
9113 //
9114 // APPROX-LABEL: define dso_local noundef double @test___dsqrt_rn(
9115 // APPROX-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
9116 // APPROX-NEXT: [[ENTRY:.*:]]
9117 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.sqrt.f64(double [[X]])
9118 // APPROX-NEXT: ret double [[TMP0]]
9119 //
9120 // NCRDIV-LABEL: define dso_local noundef double @test___dsqrt_rn(
9121 // NCRDIV-SAME: double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
9122 // NCRDIV-NEXT: [[ENTRY:.*:]]
9123 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.sqrt.f64(double [[X]])
9124 // NCRDIV-NEXT: ret double [[TMP0]]
9125 //
9126 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test___dsqrt_rn(
9127 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
9128 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
9129 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) double @llvm.sqrt.f64(double [[X]])
9130 // AMDGCNSPIRV-NEXT: ret double [[TMP0]]
9131 //
9132 extern "C" __device__ double test___dsqrt_rn(double x) {
9133 return __dsqrt_rn(x);
9134 }
9135
9136 // DEFAULT-LABEL: define dso_local noundef double @test__fma_rn(
9137 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR3]] {
9138 // DEFAULT-NEXT: [[ENTRY:.*:]]
9139 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.fma.f64(double [[X]], double [[Y]], double [[Z]])
9140 // DEFAULT-NEXT: ret double [[TMP0]]
9141 //
9142 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test__fma_rn(
9143 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]], double noundef nofpclass(nan inf) [[Z:%.*]]) local_unnamed_addr #[[ATTR3]] {
9144 // FINITEONLY-NEXT: [[ENTRY:.*:]]
9145 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef double @llvm.fma.f64(double nofpclass(nan inf) [[X]], double nofpclass(nan inf) [[Y]], double nofpclass(nan inf) [[Z]])
9146 // FINITEONLY-NEXT: ret double [[TMP0]]
9147 //
9148 // APPROX-LABEL: define dso_local noundef double @test__fma_rn(
9149 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR3]] {
9150 // APPROX-NEXT: [[ENTRY:.*:]]
9151 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.fma.f64(double [[X]], double [[Y]], double [[Z]])
9152 // APPROX-NEXT: ret double [[TMP0]]
9153 //
9154 // NCRDIV-LABEL: define dso_local noundef double @test__fma_rn(
9155 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]]) local_unnamed_addr #[[ATTR3]] {
9156 // NCRDIV-NEXT: [[ENTRY:.*:]]
9157 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.fma.f64(double [[X]], double [[Y]], double [[Z]])
9158 // NCRDIV-NEXT: ret double [[TMP0]]
9159 //
9160 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test__fma_rn(
9161 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]], double noundef [[Z:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
9162 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
9163 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) double @llvm.fma.f64(double [[X]], double [[Y]], double [[Z]])
9164 // AMDGCNSPIRV-NEXT: ret double [[TMP0]]
9165 //
9166 extern "C" __device__ double test__fma_rn(double x, double y, double z) {
9167 return __fma_rn(x, y, z);
9168 }
9169
9170 // DEFAULT-LABEL: define dso_local noundef float @test_float_min(
9171 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9172 // DEFAULT-NEXT: [[ENTRY:.*:]]
9173 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.minnum.f32(float [[X]], float [[Y]])
9174 // DEFAULT-NEXT: ret float [[TMP0]]
9175 //
9176 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_float_min(
9177 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9178 // FINITEONLY-NEXT: [[ENTRY:.*:]]
9179 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.minnum.f32(float nofpclass(nan inf) [[X]], float nofpclass(nan inf) [[Y]])
9180 // FINITEONLY-NEXT: ret float [[TMP0]]
9181 //
9182 // APPROX-LABEL: define dso_local noundef float @test_float_min(
9183 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9184 // APPROX-NEXT: [[ENTRY:.*:]]
9185 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.minnum.f32(float [[X]], float [[Y]])
9186 // APPROX-NEXT: ret float [[TMP0]]
9187 //
9188 // NCRDIV-LABEL: define dso_local noundef float @test_float_min(
9189 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9190 // NCRDIV-NEXT: [[ENTRY:.*:]]
9191 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.minnum.f32(float [[X]], float [[Y]])
9192 // NCRDIV-NEXT: ret float [[TMP0]]
9193 //
9194 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_float_min(
9195 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
9196 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
9197 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.minnum.f32(float [[X]], float [[Y]])
9198 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
9199 //
9200 extern "C" __device__ float test_float_min(float x, float y) {
9201 return min(x, y);
9202 }
9203
9204 // DEFAULT-LABEL: define dso_local noundef float @test_float_max(
9205 // DEFAULT-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9206 // DEFAULT-NEXT: [[ENTRY:.*:]]
9207 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.maxnum.f32(float [[X]], float [[Y]])
9208 // DEFAULT-NEXT: ret float [[TMP0]]
9209 //
9210 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) float @test_float_max(
9211 // FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9212 // FINITEONLY-NEXT: [[ENTRY:.*:]]
9213 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef float @llvm.maxnum.f32(float nofpclass(nan inf) [[X]], float nofpclass(nan inf) [[Y]])
9214 // FINITEONLY-NEXT: ret float [[TMP0]]
9215 //
9216 // APPROX-LABEL: define dso_local noundef float @test_float_max(
9217 // APPROX-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9218 // APPROX-NEXT: [[ENTRY:.*:]]
9219 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.maxnum.f32(float [[X]], float [[Y]])
9220 // APPROX-NEXT: ret float [[TMP0]]
9221 //
9222 // NCRDIV-LABEL: define dso_local noundef float @test_float_max(
9223 // NCRDIV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9224 // NCRDIV-NEXT: [[ENTRY:.*:]]
9225 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef float @llvm.maxnum.f32(float [[X]], float [[Y]])
9226 // NCRDIV-NEXT: ret float [[TMP0]]
9227 //
9228 // AMDGCNSPIRV-LABEL: define spir_func noundef float @test_float_max(
9229 // AMDGCNSPIRV-SAME: float noundef [[X:%.*]], float noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
9230 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
9231 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) float @llvm.maxnum.f32(float [[X]], float [[Y]])
9232 // AMDGCNSPIRV-NEXT: ret float [[TMP0]]
9233 //
9234 extern "C" __device__ float test_float_max(float x, float y) {
9235 return max(x, y);
9236 }
9237
9238 // DEFAULT-LABEL: define dso_local noundef double @test_double_min(
9239 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9240 // DEFAULT-NEXT: [[ENTRY:.*:]]
9241 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.minnum.f64(double [[X]], double [[Y]])
9242 // DEFAULT-NEXT: ret double [[TMP0]]
9243 //
9244 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_double_min(
9245 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9246 // FINITEONLY-NEXT: [[ENTRY:.*:]]
9247 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef double @llvm.minnum.f64(double nofpclass(nan inf) [[X]], double nofpclass(nan inf) [[Y]])
9248 // FINITEONLY-NEXT: ret double [[TMP0]]
9249 //
9250 // APPROX-LABEL: define dso_local noundef double @test_double_min(
9251 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9252 // APPROX-NEXT: [[ENTRY:.*:]]
9253 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.minnum.f64(double [[X]], double [[Y]])
9254 // APPROX-NEXT: ret double [[TMP0]]
9255 //
9256 // NCRDIV-LABEL: define dso_local noundef double @test_double_min(
9257 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9258 // NCRDIV-NEXT: [[ENTRY:.*:]]
9259 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.minnum.f64(double [[X]], double [[Y]])
9260 // NCRDIV-NEXT: ret double [[TMP0]]
9261 //
9262 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_double_min(
9263 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
9264 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
9265 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) double @llvm.minnum.f64(double [[X]], double [[Y]])
9266 // AMDGCNSPIRV-NEXT: ret double [[TMP0]]
9267 //
9268 extern "C" __device__ double test_double_min(double x, double y) {
9269 return min(x, y);
9270 }
9271
9272 // DEFAULT-LABEL: define dso_local noundef double @test_double_max(
9273 // DEFAULT-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9274 // DEFAULT-NEXT: [[ENTRY:.*:]]
9275 // DEFAULT-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.maxnum.f64(double [[X]], double [[Y]])
9276 // DEFAULT-NEXT: ret double [[TMP0]]
9277 //
9278 // FINITEONLY-LABEL: define dso_local noundef nofpclass(nan inf) double @test_double_max(
9279 // FINITEONLY-SAME: double noundef nofpclass(nan inf) [[X:%.*]], double noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9280 // FINITEONLY-NEXT: [[ENTRY:.*:]]
9281 // FINITEONLY-NEXT: [[TMP0:%.*]] = tail call nnan ninf contract noundef double @llvm.maxnum.f64(double nofpclass(nan inf) [[X]], double nofpclass(nan inf) [[Y]])
9282 // FINITEONLY-NEXT: ret double [[TMP0]]
9283 //
9284 // APPROX-LABEL: define dso_local noundef double @test_double_max(
9285 // APPROX-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9286 // APPROX-NEXT: [[ENTRY:.*:]]
9287 // APPROX-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.maxnum.f64(double [[X]], double [[Y]])
9288 // APPROX-NEXT: ret double [[TMP0]]
9289 //
9290 // NCRDIV-LABEL: define dso_local noundef double @test_double_max(
9291 // NCRDIV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9292 // NCRDIV-NEXT: [[ENTRY:.*:]]
9293 // NCRDIV-NEXT: [[TMP0:%.*]] = tail call contract noundef double @llvm.maxnum.f64(double [[X]], double [[Y]])
9294 // NCRDIV-NEXT: ret double [[TMP0]]
9295 //
9296 // AMDGCNSPIRV-LABEL: define spir_func noundef double @test_double_max(
9297 // AMDGCNSPIRV-SAME: double noundef [[X:%.*]], double noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
9298 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
9299 // AMDGCNSPIRV-NEXT: [[TMP0:%.*]] = tail call contract noundef addrspace(4) double @llvm.maxnum.f64(double [[X]], double [[Y]])
9300 // AMDGCNSPIRV-NEXT: ret double [[TMP0]]
9301 //
9302 extern "C" __device__ double test_double_max(double x, double y) {
9303 return max(x, y);
9304 }
9305 // CHECK-LABEL: define dso_local noundef i32 @test_int_min(
9306 // CHECK-SAME: i32 noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9307 // CHECK-NEXT: [[ENTRY:.*:]]
9308 // CHECK-NEXT: [[COND_I:%.*]] = tail call noundef i32 @llvm.smin.i32(i32 [[X]], i32 [[Y]])
9309 // CHECK-NEXT: ret i32 [[COND_I]]
9310 //
9311 // AMDGCNSPIRV-LABEL: define spir_func noundef i32 @test_int_min(
9312 // AMDGCNSPIRV-SAME: i32 noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
9313 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
9314 // AMDGCNSPIRV-NEXT: [[COND_I:%.*]] = tail call noundef addrspace(4) i32 @llvm.smin.i32(i32 [[X]], i32 [[Y]])
9315 // AMDGCNSPIRV-NEXT: ret i32 [[COND_I]]
9316 //
9317 extern "C" __device__ int test_int_min(int x, int y) {
9318 return min(x, y);
9319 }
9320
9321 // CHECK-LABEL: define dso_local noundef i32 @test_int_max(
9322 // CHECK-SAME: i32 noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] {
9323 // CHECK-NEXT: [[ENTRY:.*:]]
9324 // CHECK-NEXT: [[COND_I:%.*]] = tail call noundef i32 @llvm.smax.i32(i32 [[X]], i32 [[Y]])
9325 // CHECK-NEXT: ret i32 [[COND_I]]
9326 //
9327 // AMDGCNSPIRV-LABEL: define spir_func noundef i32 @test_int_max(
9328 // AMDGCNSPIRV-SAME: i32 noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
9329 // AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
9330 // AMDGCNSPIRV-NEXT: [[COND_I:%.*]] = tail call noundef addrspace(4) i32 @llvm.smax.i32(i32 [[X]], i32 [[Y]])
9331 // AMDGCNSPIRV-NEXT: ret i32 [[COND_I]]
9332 //
9333 extern "C" __device__ int test_int_max(int x, int y) {
9334 return max(x, y);
9335 }
9336 //.
9337 // DEFAULT: [[INT_TBAA4]] = !{[[META5:![0-9]+]], [[META5]], i64 0}
9338 // DEFAULT: [[META5]] = !{!"int", [[META6:![0-9]+]], i64 0}
9339 // DEFAULT: [[META6]] = !{!"omnipotent char", [[META7:![0-9]+]], i64 0}
9340 // DEFAULT: [[META7]] = !{!"Simple C++ TBAA"}
9341 // DEFAULT: [[CHAR_TBAA8]] = !{[[META6]], [[META6]], i64 0}
9342 // DEFAULT: [[LOOP9]] = distinct !{[[LOOP9]], [[META10:![0-9]+]], [[META11:![0-9]+]]}
9343 // DEFAULT: [[META10]] = !{!"llvm.loop.mustprogress"}
9344 // DEFAULT: [[META11]] = !{!"llvm.loop.unroll.disable"}
9345 // DEFAULT: [[LOOP12]] = distinct !{[[LOOP12]], [[META10]], [[META11]]}
9346 // DEFAULT: [[LOOP13]] = distinct !{[[LOOP13]], [[META10]], [[META11]]}
9347 // DEFAULT: [[LOOP14]] = distinct !{[[LOOP14]], [[META10]], [[META11]]}
9348 // DEFAULT: [[LOOP15]] = distinct !{[[LOOP15]], [[META10]], [[META11]]}
9349 // DEFAULT: [[FLOAT_TBAA16]] = !{[[META17:![0-9]+]], [[META17]], i64 0}
9350 // DEFAULT: [[META17]] = !{!"float", [[META6]], i64 0}
9351 // DEFAULT: [[DOUBLE_TBAA18]] = !{[[META19:![0-9]+]], [[META19]], i64 0}
9352 // DEFAULT: [[META19]] = !{!"double", [[META6]], i64 0}
9353 // DEFAULT: [[LOOP20]] = distinct !{[[LOOP20]], [[META10]], [[META11]]}
9354 // DEFAULT: [[LOOP21]] = distinct !{[[LOOP21]], [[META10]], [[META11]]}
9355 // DEFAULT: [[LOOP22]] = distinct !{[[LOOP22]], [[META10]], [[META11]]}
9356 // DEFAULT: [[LOOP23]] = distinct !{[[LOOP23]], [[META10]], [[META11]]}
9357 // DEFAULT: [[LOOP24]] = distinct !{[[LOOP24]], [[META10]], [[META11]]}
9358 // DEFAULT: [[LOOP25]] = distinct !{[[LOOP25]], [[META10]], [[META11]]}
9359 //.
9360 // FINITEONLY: [[INT_TBAA4]] = !{[[META5:![0-9]+]], [[META5]], i64 0}
9361 // FINITEONLY: [[META5]] = !{!"int", [[META6:![0-9]+]], i64 0}
9362 // FINITEONLY: [[META6]] = !{!"omnipotent char", [[META7:![0-9]+]], i64 0}
9363 // FINITEONLY: [[META7]] = !{!"Simple C++ TBAA"}
9364 // FINITEONLY: [[CHAR_TBAA8]] = !{[[META6]], [[META6]], i64 0}
9365 // FINITEONLY: [[LOOP9]] = distinct !{[[LOOP9]], [[META10:![0-9]+]], [[META11:![0-9]+]]}
9366 // FINITEONLY: [[META10]] = !{!"llvm.loop.mustprogress"}
9367 // FINITEONLY: [[META11]] = !{!"llvm.loop.unroll.disable"}
9368 // FINITEONLY: [[LOOP12]] = distinct !{[[LOOP12]], [[META10]], [[META11]]}
9369 // FINITEONLY: [[LOOP13]] = distinct !{[[LOOP13]], [[META10]], [[META11]]}
9370 // FINITEONLY: [[LOOP14]] = distinct !{[[LOOP14]], [[META10]], [[META11]]}
9371 // FINITEONLY: [[LOOP15]] = distinct !{[[LOOP15]], [[META10]], [[META11]]}
9372 // FINITEONLY: [[FLOAT_TBAA16]] = !{[[META17:![0-9]+]], [[META17]], i64 0}
9373 // FINITEONLY: [[META17]] = !{!"float", [[META6]], i64 0}
9374 // FINITEONLY: [[DOUBLE_TBAA18]] = !{[[META19:![0-9]+]], [[META19]], i64 0}
9375 // FINITEONLY: [[META19]] = !{!"double", [[META6]], i64 0}
9376 // FINITEONLY: [[LOOP20]] = distinct !{[[LOOP20]], [[META10]], [[META11]]}
9377 // FINITEONLY: [[LOOP21]] = distinct !{[[LOOP21]], [[META10]], [[META11]]}
9378 // FINITEONLY: [[LOOP22]] = distinct !{[[LOOP22]], [[META10]], [[META11]]}
9379 // FINITEONLY: [[LOOP23]] = distinct !{[[LOOP23]], [[META10]], [[META11]]}
9380 // FINITEONLY: [[LOOP24]] = distinct !{[[LOOP24]], [[META10]], [[META11]]}
9381 // FINITEONLY: [[LOOP25]] = distinct !{[[LOOP25]], [[META10]], [[META11]]}
9382 //.
9383 // APPROX: [[INT_TBAA4]] = !{[[META5:![0-9]+]], [[META5]], i64 0}
9384 // APPROX: [[META5]] = !{!"int", [[META6:![0-9]+]], i64 0}
9385 // APPROX: [[META6]] = !{!"omnipotent char", [[META7:![0-9]+]], i64 0}
9386 // APPROX: [[META7]] = !{!"Simple C++ TBAA"}
9387 // APPROX: [[CHAR_TBAA8]] = !{[[META6]], [[META6]], i64 0}
9388 // APPROX: [[LOOP9]] = distinct !{[[LOOP9]], [[META10:![0-9]+]], [[META11:![0-9]+]]}
9389 // APPROX: [[META10]] = !{!"llvm.loop.mustprogress"}
9390 // APPROX: [[META11]] = !{!"llvm.loop.unroll.disable"}
9391 // APPROX: [[LOOP12]] = distinct !{[[LOOP12]], [[META10]], [[META11]]}
9392 // APPROX: [[LOOP13]] = distinct !{[[LOOP13]], [[META10]], [[META11]]}
9393 // APPROX: [[LOOP14]] = distinct !{[[LOOP14]], [[META10]], [[META11]]}
9394 // APPROX: [[LOOP15]] = distinct !{[[LOOP15]], [[META10]], [[META11]]}
9395 // APPROX: [[FLOAT_TBAA16]] = !{[[META17:![0-9]+]], [[META17]], i64 0}
9396 // APPROX: [[META17]] = !{!"float", [[META6]], i64 0}
9397 // APPROX: [[DOUBLE_TBAA18]] = !{[[META19:![0-9]+]], [[META19]], i64 0}
9398 // APPROX: [[META19]] = !{!"double", [[META6]], i64 0}
9399 // APPROX: [[LOOP20]] = distinct !{[[LOOP20]], [[META10]], [[META11]]}
9400 // APPROX: [[LOOP21]] = distinct !{[[LOOP21]], [[META10]], [[META11]]}
9401 // APPROX: [[LOOP22]] = distinct !{[[LOOP22]], [[META10]], [[META11]]}
9402 // APPROX: [[LOOP23]] = distinct !{[[LOOP23]], [[META10]], [[META11]]}
9403 // APPROX: [[LOOP24]] = distinct !{[[LOOP24]], [[META10]], [[META11]]}
9404 // APPROX: [[LOOP25]] = distinct !{[[LOOP25]], [[META10]], [[META11]]}
9405 //.
9406 // NCRDIV: [[INT_TBAA4]] = !{[[META5:![0-9]+]], [[META5]], i64 0}
9407 // NCRDIV: [[META5]] = !{!"int", [[META6:![0-9]+]], i64 0}
9408 // NCRDIV: [[META6]] = !{!"omnipotent char", [[META7:![0-9]+]], i64 0}
9409 // NCRDIV: [[META7]] = !{!"Simple C++ TBAA"}
9410 // NCRDIV: [[CHAR_TBAA8]] = !{[[META6]], [[META6]], i64 0}
9411 // NCRDIV: [[LOOP9]] = distinct !{[[LOOP9]], [[META10:![0-9]+]], [[META11:![0-9]+]]}
9412 // NCRDIV: [[META10]] = !{!"llvm.loop.mustprogress"}
9413 // NCRDIV: [[META11]] = !{!"llvm.loop.unroll.disable"}
9414 // NCRDIV: [[LOOP12]] = distinct !{[[LOOP12]], [[META10]], [[META11]]}
9415 // NCRDIV: [[LOOP13]] = distinct !{[[LOOP13]], [[META10]], [[META11]]}
9416 // NCRDIV: [[META14]] = !{float 2.500000e+00}
9417 // NCRDIV: [[LOOP15]] = distinct !{[[LOOP15]], [[META10]], [[META11]]}
9418 // NCRDIV: [[LOOP16]] = distinct !{[[LOOP16]], [[META10]], [[META11]]}
9419 // NCRDIV: [[FLOAT_TBAA17]] = !{[[META18:![0-9]+]], [[META18]], i64 0}
9420 // NCRDIV: [[META18]] = !{!"float", [[META6]], i64 0}
9421 // NCRDIV: [[DOUBLE_TBAA19]] = !{[[META20:![0-9]+]], [[META20]], i64 0}
9422 // NCRDIV: [[META20]] = !{!"double", [[META6]], i64 0}
9423 // NCRDIV: [[LOOP21]] = distinct !{[[LOOP21]], [[META10]], [[META11]]}
9424 // NCRDIV: [[LOOP22]] = distinct !{[[LOOP22]], [[META10]], [[META11]]}
9425 // NCRDIV: [[LOOP23]] = distinct !{[[LOOP23]], [[META10]], [[META11]]}
9426 // NCRDIV: [[LOOP24]] = distinct !{[[LOOP24]], [[META10]], [[META11]]}
9427 // NCRDIV: [[META25]] = !{float 3.000000e+00}
9428 // NCRDIV: [[LOOP26]] = distinct !{[[LOOP26]], [[META10]], [[META11]]}
9429 // NCRDIV: [[LOOP27]] = distinct !{[[LOOP27]], [[META10]], [[META11]]}
9430 //.
9431 // AMDGCNSPIRV: [[INT_TBAA5]] = !{[[META6:![0-9]+]], [[META6]], i64 0}
9432 // AMDGCNSPIRV: [[META6]] = !{!"int", [[META7:![0-9]+]], i64 0}
9433 // AMDGCNSPIRV: [[META7]] = !{!"omnipotent char", [[META8:![0-9]+]], i64 0}
9434 // AMDGCNSPIRV: [[META8]] = !{!"Simple C++ TBAA"}
9435 // AMDGCNSPIRV: [[CHAR_TBAA9]] = !{[[META7]], [[META7]], i64 0}
9436 // AMDGCNSPIRV: [[LOOP10]] = distinct !{[[LOOP10]], [[META11:![0-9]+]], [[META12:![0-9]+]]}
9437 // AMDGCNSPIRV: [[META11]] = !{!"llvm.loop.mustprogress"}
9438 // AMDGCNSPIRV: [[META12]] = !{!"llvm.loop.unroll.disable"}
9439 // AMDGCNSPIRV: [[LOOP13]] = distinct !{[[LOOP13]], [[META11]], [[META12]]}
9440 // AMDGCNSPIRV: [[LOOP14]] = distinct !{[[LOOP14]], [[META11]], [[META12]]}
9441 // AMDGCNSPIRV: [[LOOP15]] = distinct !{[[LOOP15]], [[META11]], [[META12]]}
9442 // AMDGCNSPIRV: [[LOOP16]] = distinct !{[[LOOP16]], [[META11]], [[META12]]}
9443 // AMDGCNSPIRV: [[FLOAT_TBAA17]] = !{[[META18:![0-9]+]], [[META18]], i64 0}
9444 // AMDGCNSPIRV: [[META18]] = !{!"float", [[META7]], i64 0}
9445 // AMDGCNSPIRV: [[DOUBLE_TBAA19]] = !{[[META20:![0-9]+]], [[META20]], i64 0}
9446 // AMDGCNSPIRV: [[META20]] = !{!"double", [[META7]], i64 0}
9447 // AMDGCNSPIRV: [[LOOP21]] = distinct !{[[LOOP21]], [[META11]], [[META12]]}
9448 // AMDGCNSPIRV: [[LOOP22]] = distinct !{[[LOOP22]], [[META11]], [[META12]]}
9449 // AMDGCNSPIRV: [[LOOP23]] = distinct !{[[LOOP23]], [[META11]], [[META12]]}
9450 // AMDGCNSPIRV: [[LOOP24]] = distinct !{[[LOOP24]], [[META11]], [[META12]]}
9451 // AMDGCNSPIRV: [[LOOP25]] = distinct !{[[LOOP25]], [[META11]], [[META12]]}
9452 // AMDGCNSPIRV: [[LOOP26]] = distinct !{[[LOOP26]], [[META11]], [[META12]]}
9453 //.