1 ; RUN: opt -mtriple unknown -instcombine -S < %s | FileCheck %s
4 ; Can't generate test checks due to PR42740.
6 define double @pow_sitofp_const_base_fast(i32 %x) {
7 ; CHECK-LABEL: @pow_sitofp_const_base_fast(
8 ; CHECK-NEXT: [[TMP1:%.*]] = call afn float @llvm.powi.f32.i32(float 7.000000e+00, i32 [[X:%.*]])
9 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[TMP1]] to double
10 ; CHECK-NEXT: ret double [[RES]]
12 %subfp = sitofp i32 %x to float
13 %pow = tail call afn float @llvm.pow.f32(float 7.000000e+00, float %subfp)
14 %res = fpext float %pow to double
18 define double @pow_uitofp_const_base_fast(i31 %x) {
19 ; CHECK-LABEL: @pow_uitofp_const_base_fast(
20 ; CHECK-NEXT: [[TMP1:%.*]] = zext i31 [[X:%.*]] to i32
21 ; CHECK-NEXT: [[TMP2:%.*]] = call afn float @llvm.powi.f32.i32(float 7.000000e+00, i32 [[TMP1]])
22 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[TMP2]] to double
23 ; CHECK-NEXT: ret double [[RES]]
25 %subfp = uitofp i31 %x to float
26 %pow = tail call afn float @llvm.pow.f32(float 7.000000e+00, float %subfp)
27 %res = fpext float %pow to double
31 define double @pow_sitofp_double_const_base_fast(i32 %x) {
32 ; CHECK-LABEL: @pow_sitofp_double_const_base_fast(
33 ; CHECK-NEXT: [[TMP1:%.*]] = call afn double @llvm.powi.f64.i32(double 7.000000e+00, i32 [[X:%.*]])
34 ; CHECK-NEXT: ret double [[TMP1]]
36 %subfp = sitofp i32 %x to double
37 %pow = tail call afn double @llvm.pow.f64(double 7.000000e+00, double %subfp)
41 define double @pow_uitofp_double_const_base_fast(i31 %x) {
42 ; CHECK-LABEL: @pow_uitofp_double_const_base_fast(
43 ; CHECK-NEXT: [[TMP1:%.*]] = zext i31 [[X:%.*]] to i32
44 ; CHECK-NEXT: [[TMP2:%.*]] = call afn double @llvm.powi.f64.i32(double 7.000000e+00, i32 [[TMP1]])
45 ; CHECK-NEXT: ret double [[TMP2]]
47 %subfp = uitofp i31 %x to double
48 %pow = tail call afn double @llvm.pow.f64(double 7.000000e+00, double %subfp)
52 define double @pow_sitofp_double_const_base_2_fast(i32 %x) {
53 ; CHECK-LABEL: @pow_sitofp_double_const_base_2_fast(
54 ; CHECK-NEXT: [[LDEXPF:%.*]] = call afn float @ldexpf(float 1.000000e+00, i32 [[X:%.*]])
55 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[LDEXPF]] to double
56 ; CHECK-NEXT: ret double [[RES]]
58 %subfp = sitofp i32 %x to float
59 %pow = tail call afn float @llvm.pow.f32(float 2.000000e+00, float %subfp)
60 %res = fpext float %pow to double
64 define double @pow_sitofp_double_const_base_power_of_2_fast(i32 %x) {
65 ; CHECK-LABEL: @pow_sitofp_double_const_base_power_of_2_fast(
66 ; CHECK-NEXT: [[SUBFP:%.*]] = sitofp i32 [[X:%.*]] to float
67 ; CHECK-NEXT: [[MUL:%.*]] = fmul afn float [[SUBFP]], 4.000000e+00
68 ; CHECK-NEXT: [[EXP2:%.*]] = call afn float @llvm.exp2.f32(float [[MUL]])
69 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[EXP2]] to double
70 ; CHECK-NEXT: ret double [[RES]]
72 %subfp = sitofp i32 %x to float
73 %pow = tail call afn float @llvm.pow.f32(float 16.000000e+00, float %subfp)
74 %res = fpext float %pow to double
78 define double @pow_uitofp_const_base_2_fast(i31 %x) {
79 ; CHECK-LABEL: @pow_uitofp_const_base_2_fast(
80 ; CHECK-NEXT: [[TMP1:%.*]] = zext i31 [[X:%.*]] to i32
81 ; CHECK-NEXT: [[LDEXPF:%.*]] = call afn float @ldexpf(float 1.000000e+00, i32 [[TMP1]])
82 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[LDEXPF]] to double
83 ; CHECK-NEXT: ret double [[RES]]
85 %subfp = uitofp i31 %x to float
86 %pow = tail call afn float @llvm.pow.f32(float 2.000000e+00, float %subfp)
87 %res = fpext float %pow to double
91 define double @pow_uitofp_const_base_power_of_2_fast(i31 %x) {
92 ; CHECK-LABEL: @pow_uitofp_const_base_power_of_2_fast(
93 ; CHECK-NEXT: [[SUBFP:%.*]] = uitofp i31 [[X:%.*]] to float
94 ; CHECK-NEXT: [[MUL:%.*]] = fmul afn float [[SUBFP]], 4.000000e+00
95 ; CHECK-NEXT: [[EXP2:%.*]] = call afn float @llvm.exp2.f32(float [[MUL]])
96 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[EXP2]] to double
97 ; CHECK-NEXT: ret double [[RES]]
99 %subfp = uitofp i31 %x to float
100 %pow = tail call afn float @llvm.pow.f32(float 16.000000e+00, float %subfp)
101 %res = fpext float %pow to double
105 define double @pow_sitofp_float_base_fast(float %base, i32 %x) {
106 ; CHECK-LABEL: @pow_sitofp_float_base_fast(
107 ; CHECK-NEXT: [[TMP1:%.*]] = call afn float @llvm.powi.f32.i32(float [[BASE:%.*]], i32 [[X:%.*]])
108 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[TMP1]] to double
109 ; CHECK-NEXT: ret double [[RES]]
111 %subfp = sitofp i32 %x to float
112 %pow = tail call afn float @llvm.pow.f32(float %base, float %subfp)
113 %res = fpext float %pow to double
117 define double @pow_uitofp_float_base_fast(float %base, i31 %x) {
118 ; CHECK-LABEL: @pow_uitofp_float_base_fast(
119 ; CHECK-NEXT: [[TMP1:%.*]] = zext i31 [[X:%.*]] to i32
120 ; CHECK-NEXT: [[TMP2:%.*]] = call afn float @llvm.powi.f32.i32(float [[BASE:%.*]], i32 [[TMP1]])
121 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[TMP2]] to double
122 ; CHECK-NEXT: ret double [[RES]]
124 %subfp = uitofp i31 %x to float
125 %pow = tail call afn float @llvm.pow.f32(float %base, float %subfp)
126 %res = fpext float %pow to double
130 define double @pow_sitofp_double_base_fast(double %base, i32 %x) {
131 ; CHECK-LABEL: @pow_sitofp_double_base_fast(
132 ; CHECK-NEXT: [[TMP1:%.*]] = call afn double @llvm.powi.f64.i32(double [[BASE:%.*]], i32 [[X:%.*]])
133 ; CHECK-NEXT: ret double [[TMP1]]
135 %subfp = sitofp i32 %x to double
136 %res = tail call afn double @llvm.pow.f64(double %base, double %subfp)
140 define double @pow_uitofp_double_base_fast(double %base, i31 %x) {
141 ; CHECK-LABEL: @pow_uitofp_double_base_fast(
142 ; CHECK-NEXT: [[TMP1:%.*]] = zext i31 [[X:%.*]] to i32
143 ; CHECK-NEXT: [[TMP2:%.*]] = call afn double @llvm.powi.f64.i32(double [[BASE:%.*]], i32 [[TMP1]])
144 ; CHECK-NEXT: ret double [[TMP2]]
146 %subfp = uitofp i31 %x to double
147 %res = tail call afn double @llvm.pow.f64(double %base, double %subfp)
151 define double @pow_sitofp_const_base_fast_i8(i8 %x) {
152 ; CHECK-LABEL: @pow_sitofp_const_base_fast_i8(
153 ; CHECK-NEXT: [[TMP1:%.*]] = sext i8 [[X:%.*]] to i32
154 ; CHECK-NEXT: [[TMP2:%.*]] = call afn float @llvm.powi.f32.i32(float 7.000000e+00, i32 [[TMP1]])
155 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[TMP2]] to double
156 ; CHECK-NEXT: ret double [[RES]]
158 %subfp = sitofp i8 %x to float
159 %pow = tail call afn float @llvm.pow.f32(float 7.000000e+00, float %subfp)
160 %res = fpext float %pow to double
164 define double @pow_sitofp_const_base_fast_i16(i16 %x) {
165 ; CHECK-LABEL: @pow_sitofp_const_base_fast_i16(
166 ; CHECK-NEXT: [[TMP1:%.*]] = sext i16 [[X:%.*]] to i32
167 ; CHECK-NEXT: [[TMP2:%.*]] = call afn float @llvm.powi.f32.i32(float 7.000000e+00, i32 [[TMP1]])
168 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[TMP2]] to double
169 ; CHECK-NEXT: ret double [[RES]]
171 %subfp = sitofp i16 %x to float
172 %pow = tail call afn float @llvm.pow.f32(float 7.000000e+00, float %subfp)
173 %res = fpext float %pow to double
178 define double @pow_uitofp_const_base_fast_i8(i8 %x) {
179 ; CHECK-LABEL: @pow_uitofp_const_base_fast_i8(
180 ; CHECK-NEXT: [[TMP1:%.*]] = zext i8 [[X:%.*]] to i32
181 ; CHECK-NEXT: [[TMP2:%.*]] = call afn float @llvm.powi.f32.i32(float 7.000000e+00, i32 [[TMP1]])
182 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[TMP2]] to double
183 ; CHECK-NEXT: ret double [[RES]]
185 %subfp = uitofp i8 %x to float
186 %pow = tail call afn float @llvm.pow.f32(float 7.000000e+00, float %subfp)
187 %res = fpext float %pow to double
191 define double @pow_uitofp_const_base_fast_i16(i16 %x) {
192 ; CHECK-LABEL: @pow_uitofp_const_base_fast_i16(
193 ; CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[X:%.*]] to i32
194 ; CHECK-NEXT: [[TMP2:%.*]] = call afn float @llvm.powi.f32.i32(float 7.000000e+00, i32 [[TMP1]])
195 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[TMP2]] to double
196 ; CHECK-NEXT: ret double [[RES]]
198 %subfp = uitofp i16 %x to float
199 %pow = tail call afn float @llvm.pow.f32(float 7.000000e+00, float %subfp)
200 %res = fpext float %pow to double
204 define double @powf_exp_const_int_fast(double %base) {
205 ; CHECK-LABEL: @powf_exp_const_int_fast(
206 ; CHECK-NEXT: [[TMP1:%.*]] = call fast double @llvm.powi.f64.i32(double [[BASE:%.*]], i32 40)
207 ; CHECK-NEXT: ret double [[TMP1]]
209 %res = tail call fast double @llvm.pow.f64(double %base, double 4.000000e+01)
213 define double @powf_exp_const2_int_fast(double %base) {
214 ; CHECK-LABEL: @powf_exp_const2_int_fast(
215 ; CHECK-NEXT: [[TMP1:%.*]] = call fast double @llvm.powi.f64.i32(double [[BASE:%.*]], i32 -40)
216 ; CHECK-NEXT: ret double [[TMP1]]
218 %res = tail call fast double @llvm.pow.f64(double %base, double -4.000000e+01)
224 define double @pow_uitofp_const_base_fast_i32(i32 %x) {
225 ; CHECK-LABEL: @pow_uitofp_const_base_fast_i32(
226 ; CHECK-NEXT: [[SUBFP:%.*]] = uitofp i32 [[X:%.*]] to float
227 ; CHECK-NEXT: [[MUL:%.*]] = fmul fast float [[SUBFP]], 0x4006757{{.*}}
228 ; CHECK-NEXT: [[EXP2:%.*]] = call fast float @llvm.exp2.f32(float [[MUL]])
229 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[EXP2]] to double
230 ; CHECK-NEXT: ret double [[RES]]
232 %subfp = uitofp i32 %x to float
233 %pow = tail call fast float @llvm.pow.f32(float 7.000000e+00, float %subfp)
234 %res = fpext float %pow to double
238 define double @pow_uitofp_const_base_2_fast_i32(i32 %x) {
239 ; CHECK-LABEL: @pow_uitofp_const_base_2_fast_i32(
240 ; CHECK-NEXT: [[SUBFP:%.*]] = uitofp i32 [[X:%.*]] to float
241 ; CHECK-NEXT: [[EXP2:%.*]] = call fast float @llvm.exp2.f32(float [[SUBFP]])
242 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[EXP2]] to double
243 ; CHECK-NEXT: ret double [[RES]]
245 %subfp = uitofp i32 %x to float
246 %pow = tail call fast float @llvm.pow.f32(float 2.000000e+00, float %subfp)
247 %res = fpext float %pow to double
251 define double @pow_uitofp_const_base_power_of_2_fast_i32(i32 %x) {
252 ; CHECK-LABEL: @pow_uitofp_const_base_power_of_2_fast_i32(
253 ; CHECK-NEXT: [[SUBFP:%.*]] = uitofp i32 [[X:%.*]] to float
254 ; CHECK-NEXT: [[MUL:%.*]] = fmul fast float [[SUBFP]], 4.000000e+00
255 ; CHECK-NEXT: [[EXP2:%.*]] = call fast float @llvm.exp2.f32(float [[MUL]])
256 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[EXP2]] to double
257 ; CHECK-NEXT: ret double [[RES]]
259 %subfp = uitofp i32 %x to float
260 %pow = tail call fast float @llvm.pow.f32(float 16.000000e+00, float %subfp)
261 %res = fpext float %pow to double
265 define double @pow_uitofp_float_base_fast_i32(float %base, i32 %x) {
266 ; CHECK-LABEL: @pow_uitofp_float_base_fast_i32(
267 ; CHECK-NEXT: [[SUBFP:%.*]] = uitofp i32 [[X:%.*]] to float
268 ; CHECK-NEXT: [[POW:%.*]] = tail call fast float @llvm.pow.f32(float [[BASE:%.*]], float [[SUBFP]])
269 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[POW]] to double
270 ; CHECK-NEXT: ret double [[RES]]
272 %subfp = uitofp i32 %x to float
273 %pow = tail call fast float @llvm.pow.f32(float %base, float %subfp)
274 %res = fpext float %pow to double
278 define double @pow_uitofp_double_base_fast_i32(double %base, i32 %x) {
279 ; CHECK-LABEL: @pow_uitofp_double_base_fast_i32(
280 ; CHECK-NEXT: [[SUBFP:%.*]] = uitofp i32 [[X:%.*]] to double
281 ; CHECK-NEXT: [[RES:%.*]] = tail call fast double @llvm.pow.f64(double [[BASE:%.*]], double [[SUBFP]])
282 ; CHECK-NEXT: ret double [[RES]]
284 %subfp = uitofp i32 %x to double
285 %res = tail call fast double @llvm.pow.f64(double %base, double %subfp)
289 define double @pow_sitofp_const_base_fast_i64(i64 %x) {
290 ; CHECK-LABEL: @pow_sitofp_const_base_fast_i64(
291 ; CHECK-NEXT: [[SUBFP:%.*]] = sitofp i64 [[X:%.*]] to float
292 ; Do not change 0x400675{{.*}} to the exact constant, see PR42740
293 ; CHECK-NEXT: [[MUL:%.*]] = fmul fast float [[SUBFP]], 0x400675{{.*}}
294 ; CHECK-NEXT: [[EXP2:%.*]] = call fast float @llvm.exp2.f32(float [[MUL]])
295 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[EXP2]] to double
296 ; CHECK-NEXT: ret double [[RES]]
298 %subfp = sitofp i64 %x to float
299 %pow = tail call fast float @llvm.pow.f32(float 7.000000e+00, float %subfp)
300 %res = fpext float %pow to double
304 define double @pow_uitofp_const_base_fast_i64(i64 %x) {
305 ; CHECK-LABEL: @pow_uitofp_const_base_fast_i64(
306 ; CHECK-NEXT: [[SUBFP:%.*]] = uitofp i64 [[X:%.*]] to float
307 ; CHECK-NEXT: [[MUL:%.*]] = fmul fast float [[SUBFP]], 0x400675{{.*}}
308 ; CHECK-NEXT: [[EXP2:%.*]] = call fast float @llvm.exp2.f32(float [[MUL]])
309 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[EXP2]] to double
310 ; CHECK-NEXT: ret double [[RES]]
312 %subfp = uitofp i64 %x to float
313 %pow = tail call fast float @llvm.pow.f32(float 7.000000e+00, float %subfp)
314 %res = fpext float %pow to double
318 define double @pow_sitofp_const_base_no_fast(i32 %x) {
319 ; CHECK-LABEL: @pow_sitofp_const_base_no_fast(
320 ; CHECK-NEXT: [[SUBFP:%.*]] = sitofp i32 [[X:%.*]] to float
321 ; CHECK-NEXT: [[POW:%.*]] = tail call float @llvm.pow.f32(float 7.000000e+00, float [[SUBFP]])
322 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[POW]] to double
323 ; CHECK-NEXT: ret double [[RES]]
325 %subfp = sitofp i32 %x to float
326 %pow = tail call float @llvm.pow.f32(float 7.000000e+00, float %subfp)
327 %res = fpext float %pow to double
331 define double @pow_uitofp_const_base_no_fast(i32 %x) {
332 ; CHECK-LABEL: @pow_uitofp_const_base_no_fast(
333 ; CHECK-NEXT: [[SUBFP:%.*]] = uitofp i32 [[X:%.*]] to float
334 ; CHECK-NEXT: [[POW:%.*]] = tail call float @llvm.pow.f32(float 7.000000e+00, float [[SUBFP]])
335 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[POW]] to double
336 ; CHECK-NEXT: ret double [[RES]]
338 %subfp = uitofp i32 %x to float
339 %pow = tail call float @llvm.pow.f32(float 7.000000e+00, float %subfp)
340 %res = fpext float %pow to double
344 define double @pow_sitofp_const_base_2_no_fast(i32 %x) {
345 ; CHECK-LABEL: @pow_sitofp_const_base_2_no_fast(
346 ; CHECK-NEXT: [[LDEXPF:%.*]] = call float @ldexpf(float 1.000000e+00, i32 [[X:%.*]])
347 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[LDEXPF]] to double
348 ; CHECK-NEXT: ret double [[RES]]
350 %subfp = sitofp i32 %x to float
351 %pow = tail call float @llvm.pow.f32(float 2.000000e+00, float %subfp)
352 %res = fpext float %pow to double
356 define double @pow_sitofp_const_base_power_of_2_no_fast(i32 %x) {
357 ; CHECK-LABEL: @pow_sitofp_const_base_power_of_2_no_fast(
358 ; CHECK-NEXT: [[SUBFP:%.*]] = sitofp i32 [[X:%.*]] to float
359 ; CHECK-NEXT: [[MUL:%.*]] = fmul float [[SUBFP]], 4.000000e+00
360 ; CHECK-NEXT: [[EXP2:%.*]] = call float @llvm.exp2.f32(float [[MUL]])
361 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[EXP2]] to double
362 ; CHECK-NEXT: ret double [[RES]]
364 %subfp = sitofp i32 %x to float
365 %pow = tail call float @llvm.pow.f32(float 16.000000e+00, float %subfp)
366 %res = fpext float %pow to double
370 define double @pow_uitofp_const_base_2_no_fast(i32 %x) {
371 ; CHECK-LABEL: @pow_uitofp_const_base_2_no_fast(
372 ; CHECK-NEXT: [[SUBFP:%.*]] = uitofp i32 [[X:%.*]] to float
373 ; CHECK-NEXT: [[EXP2:%.*]] = call float @llvm.exp2.f32(float [[SUBFP]])
374 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[EXP2]] to double
375 ; CHECK-NEXT: ret double [[RES]]
377 %subfp = uitofp i32 %x to float
378 %pow = tail call float @llvm.pow.f32(float 2.000000e+00, float %subfp)
379 %res = fpext float %pow to double
383 define double @pow_uitofp_const_base_power_of_2_no_fast(i32 %x) {
384 ; CHECK-LABEL: @pow_uitofp_const_base_power_of_2_no_fast(
385 ; CHECK-NEXT: [[SUBFP:%.*]] = uitofp i32 [[X:%.*]] to float
386 ; CHECK-NEXT: [[MUL:%.*]] = fmul float [[SUBFP]], 4.000000e+00
387 ; CHECK-NEXT: [[EXP2:%.*]] = call float @llvm.exp2.f32(float [[MUL]])
388 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[EXP2]] to double
389 ; CHECK-NEXT: ret double [[RES]]
391 %subfp = uitofp i32 %x to float
392 %pow = tail call float @llvm.pow.f32(float 16.000000e+00, float %subfp)
393 %res = fpext float %pow to double
397 define double @pow_sitofp_float_base_no_fast(float %base, i32 %x) {
398 ; CHECK-LABEL: @pow_sitofp_float_base_no_fast(
399 ; CHECK-NEXT: [[SUBFP:%.*]] = sitofp i32 [[X:%.*]] to float
400 ; CHECK-NEXT: [[POW:%.*]] = tail call float @llvm.pow.f32(float [[BASE:%.*]], float [[SUBFP]])
401 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[POW]] to double
402 ; CHECK-NEXT: ret double [[RES]]
404 %subfp = sitofp i32 %x to float
405 %pow = tail call float @llvm.pow.f32(float %base, float %subfp)
406 %res = fpext float %pow to double
410 define double @pow_uitofp_float_base_no_fast(float %base, i32 %x) {
411 ; CHECK-LABEL: @pow_uitofp_float_base_no_fast(
412 ; CHECK-NEXT: [[SUBFP:%.*]] = uitofp i32 [[X:%.*]] to float
413 ; CHECK-NEXT: [[POW:%.*]] = tail call float @llvm.pow.f32(float [[BASE:%.*]], float [[SUBFP]])
414 ; CHECK-NEXT: [[RES:%.*]] = fpext float [[POW]] to double
415 ; CHECK-NEXT: ret double [[RES]]
417 %subfp = uitofp i32 %x to float
418 %pow = tail call float @llvm.pow.f32(float %base, float %subfp)
419 %res = fpext float %pow to double
423 define double @pow_sitofp_double_base_no_fast(double %base, i32 %x) {
424 ; CHECK-LABEL: @pow_sitofp_double_base_no_fast(
425 ; CHECK-NEXT: [[SUBFP:%.*]] = sitofp i32 [[X:%.*]] to double
426 ; CHECK-NEXT: [[POW:%.*]] = tail call double @llvm.pow.f64(double [[BASE:%.*]], double [[SUBFP]])
427 ; CHECK-NEXT: ret double [[POW]]
429 %subfp = sitofp i32 %x to double
430 %pow = tail call double @llvm.pow.f64(double %base, double %subfp)
434 define double @pow_uitofp_double_base_no_fast(double %base, i32 %x) {
435 ; CHECK-LABEL: @pow_uitofp_double_base_no_fast(
436 ; CHECK-NEXT: [[SUBFP:%.*]] = uitofp i32 [[X:%.*]] to double
437 ; CHECK-NEXT: [[POW:%.*]] = tail call double @llvm.pow.f64(double [[BASE:%.*]], double [[SUBFP]])
438 ; CHECK-NEXT: ret double [[POW]]
440 %subfp = uitofp i32 %x to double
441 %pow = tail call double @llvm.pow.f64(double %base, double %subfp)
445 define double @powf_exp_const_int_no_fast(double %base) {
446 ; CHECK-LABEL: @powf_exp_const_int_no_fast(
447 ; CHECK-NEXT: [[RES:%.*]] = tail call double @llvm.pow.f64(double [[BASE:%.*]], double 4.000000e+01)
448 ; CHECK-NEXT: ret double [[RES]]
450 %res = tail call double @llvm.pow.f64(double %base, double 4.000000e+01)
454 define double @powf_exp_const_not_int_fast(double %base) {
455 ; CHECK-LABEL: @powf_exp_const_not_int_fast(
456 ; CHECK-NEXT: [[RES:%.*]] = tail call fast double @llvm.pow.f64(double [[BASE:%.*]], double 3.750000e+01)
457 ; CHECK-NEXT: ret double [[RES]]
459 %res = tail call fast double @llvm.pow.f64(double %base, double 3.750000e+01)
463 define double @powf_exp_const_not_int_no_fast(double %base) {
464 ; CHECK-LABEL: @powf_exp_const_not_int_no_fast(
465 ; CHECK-NEXT: [[RES:%.*]] = tail call double @llvm.pow.f64(double [[BASE:%.*]], double 3.750000e+01)
466 ; CHECK-NEXT: ret double [[RES]]
468 %res = tail call double @llvm.pow.f64(double %base, double 3.750000e+01)
472 define double @powf_exp_const2_int_no_fast(double %base) {
473 ; CHECK-LABEL: @powf_exp_const2_int_no_fast(
474 ; CHECK-NEXT: [[RES:%.*]] = tail call double @llvm.pow.f64(double [[BASE:%.*]], double -4.000000e+01)
475 ; CHECK-NEXT: ret double [[RES]]
477 %res = tail call double @llvm.pow.f64(double %base, double -4.000000e+01)
481 declare float @llvm.pow.f32(float, float)
482 declare double @llvm.pow.f64(double, double)