1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -instcombine -S | FileCheck %s
4 define double @pow_intrinsic_third_fast(double %x) {
5 ; CHECK-LABEL: @pow_intrinsic_third_fast(
6 ; CHECK-NEXT: [[POW:%.*]] = call fast double @llvm.pow.f64(double [[X:%.*]], double 0x3FD5555555555555)
7 ; CHECK-NEXT: ret double [[POW]]
9 %pow = call fast double @llvm.pow.f64(double %x, double 0x3fd5555555555555)
13 define float @powf_intrinsic_third_fast(float %x) {
14 ; CHECK-LABEL: @powf_intrinsic_third_fast(
15 ; CHECK-NEXT: [[POW:%.*]] = call fast float @llvm.pow.f32(float [[X:%.*]], float 0x3FD5555560000000)
16 ; CHECK-NEXT: ret float [[POW]]
18 %pow = call fast float @llvm.pow.f32(float %x, float 0x3fd5555560000000)
22 define double @pow_intrinsic_third_approx(double %x) {
23 ; CHECK-LABEL: @pow_intrinsic_third_approx(
24 ; CHECK-NEXT: [[POW:%.*]] = call afn double @llvm.pow.f64(double [[X:%.*]], double 0x3FD5555555555555)
25 ; CHECK-NEXT: ret double [[POW]]
27 %pow = call afn double @llvm.pow.f64(double %x, double 0x3fd5555555555555)
31 define float @powf_intrinsic_third_approx(float %x) {
32 ; CHECK-LABEL: @powf_intrinsic_third_approx(
33 ; CHECK-NEXT: [[POW:%.*]] = call afn float @llvm.pow.f32(float [[X:%.*]], float 0x3FD5555560000000)
34 ; CHECK-NEXT: ret float [[POW]]
36 %pow = call afn float @llvm.pow.f32(float %x, float 0x3fd5555560000000)
40 define double @pow_libcall_third_fast(double %x) {
41 ; CHECK-LABEL: @pow_libcall_third_fast(
42 ; CHECK-NEXT: [[POW:%.*]] = call fast double @pow(double [[X:%.*]], double 0x3FD5555555555555)
43 ; CHECK-NEXT: ret double [[POW]]
45 %pow = call fast double @pow(double %x, double 0x3fd5555555555555)
49 define float @powf_libcall_third_fast(float %x) {
50 ; CHECK-LABEL: @powf_libcall_third_fast(
51 ; CHECK-NEXT: [[POW:%.*]] = call fast float @powf(float [[X:%.*]], float 0x3FD5555560000000)
52 ; CHECK-NEXT: ret float [[POW]]
54 %pow = call fast float @powf(float %x, float 0x3fd5555560000000)
58 define double @pow_intrinsic_negthird_fast(double %x) {
59 ; CHECK-LABEL: @pow_intrinsic_negthird_fast(
60 ; CHECK-NEXT: [[POW:%.*]] = call fast double @llvm.pow.f64(double [[X:%.*]], double 0xBFD5555555555555)
61 ; CHECK-NEXT: ret double [[POW]]
63 %pow = call fast double @llvm.pow.f64(double %x, double 0xbfd5555555555555)
67 define float @powf_intrinsic_negthird_fast(float %x) {
68 ; CHECK-LABEL: @powf_intrinsic_negthird_fast(
69 ; CHECK-NEXT: [[POW:%.*]] = call fast float @llvm.pow.f32(float [[X:%.*]], float 0xBFD5555560000000)
70 ; CHECK-NEXT: ret float [[POW]]
72 %pow = call fast float @llvm.pow.f32(float %x, float 0xbfd5555560000000)
76 define double @pow_intrinsic_negthird_approx(double %x) {
77 ; CHECK-LABEL: @pow_intrinsic_negthird_approx(
78 ; CHECK-NEXT: [[POW:%.*]] = call afn double @llvm.pow.f64(double [[X:%.*]], double 0xBFD5555555555555)
79 ; CHECK-NEXT: ret double [[POW]]
81 %pow = call afn double @llvm.pow.f64(double %x, double 0xbfd5555555555555)
85 define float @powf_intrinsic_negthird_approx(float %x) {
86 ; CHECK-LABEL: @powf_intrinsic_negthird_approx(
87 ; CHECK-NEXT: [[POW:%.*]] = call afn float @llvm.pow.f32(float [[X:%.*]], float 0xBFD5555560000000)
88 ; CHECK-NEXT: ret float [[POW]]
90 %pow = call afn float @llvm.pow.f32(float %x, float 0xbfd5555560000000)
94 define double @pow_libcall_negthird_fast(double %x) {
95 ; CHECK-LABEL: @pow_libcall_negthird_fast(
96 ; CHECK-NEXT: [[POW:%.*]] = call fast double @pow(double [[X:%.*]], double 0xBFD5555555555555)
97 ; CHECK-NEXT: ret double [[POW]]
99 %pow = call fast double @pow(double %x, double 0xbfd5555555555555)
103 define float @powf_libcall_negthird_fast(float %x) {
104 ; CHECK-LABEL: @powf_libcall_negthird_fast(
105 ; CHECK-NEXT: [[POW:%.*]] = call fast float @powf(float [[X:%.*]], float 0xBFD5555560000000)
106 ; CHECK-NEXT: ret float [[POW]]
108 %pow = call fast float @powf(float %x, float 0xbfd5555560000000)
112 declare double @llvm.pow.f64(double, double) #0
113 declare float @llvm.pow.f32(float, float) #0
114 declare double @pow(double, double)
115 declare float @powf(float, float)
117 attributes #0 = { nounwind readnone speculatable }