1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -early-cse -S -o - %s | FileCheck %s
4 declare double @acos(double)
5 define double @f_acos() {
6 ; CHECK-LABEL: @f_acos(
7 ; CHECK-NEXT: ret double 0.000000e+00
9 %res = tail call fast double @acos(double 1.0)
13 declare float @asinf(float)
14 define float @f_asinf() {
15 ; CHECK-LABEL: @f_asinf(
16 ; CHECK-NEXT: ret float 0x3FF921FB{{.+}}
18 %res = tail call fast float @asinf(float 1.0)
22 declare double @atan(double)
23 define double @f_atan() {
24 ; CHECK-LABEL: @f_atan(
25 ; CHECK-NEXT: [[RES:%.*]] = tail call fast double @atan(double 1.000000e+00)
26 ; CHECK-NEXT: ret double 0x3FE921FB
28 %res = tail call fast double @atan(double 1.0)
32 declare float @cosf(float)
33 define float @f_cosf() {
34 ; CHECK-LABEL: @f_cosf(
35 ; CHECK-NEXT: ret float 0x3FE14A2{{.+}}
37 %res = tail call fast float @cosf(float 1.0)
41 declare float @llvm.cos.f32(float)
42 define float @i_cosf() {
43 ; CHECK-LABEL: @i_cosf(
44 ; CHECK-NEXT: ret float 0x3FE14A2
46 %res = tail call fast float @llvm.cos.f32(float 1.0)
50 declare double @cosh(double)
51 define double @f_cosh() {
52 ; CHECK-LABEL: @f_cosh(
53 ; CHECK-NEXT: ret double 0x3FF8B075{{.+}}
55 %res = tail call fast double @cosh(double 1.0)
59 declare float @expf(float)
60 define float @f_expf() {
61 ; CHECK-LABEL: @f_expf(
62 ; CHECK-NEXT: ret float 0x4005BF0A{{.+}}
64 %res = tail call fast float @expf(float 1.0)
68 declare float @llvm.exp.f32(float)
69 define float @i_expf() {
70 ; CHECK-LABEL: @i_expf(
71 ; CHECK-NEXT: ret float 0x4005BF0A{{.+}}
73 %res = tail call fast float @llvm.exp.f32(float 1.0)
77 declare double @exp2(double)
78 define double @f_exp2() {
79 ; CHECK-LABEL: @f_exp2(
80 ; CHECK-NEXT: ret double 2.000000e+00
82 %res = tail call fast double @exp2(double 1.0)
86 declare double @llvm.exp2.f64(double)
87 define double @i_exp2() {
88 ; CHECK-LABEL: @i_exp2(
89 ; CHECK-NEXT: ret double 2.000000e+00
91 %res = tail call fast double @llvm.exp2.f64(double 1.0)
95 ; FIXME: exp10() is not widely supported.
96 declare float @exp10f(float)
97 define float @f_exp10f() {
98 ; CHECK-LABEL: @f_exp10f(
99 ; CHECK-NEXT: [[RES:%.*]] = tail call float @exp10f(float 1.000000e+00)
100 ; CHECK-NEXT: ret float [[RES]]
102 %res = tail call float @exp10f(float 1.0)
106 declare double @log(double)
107 define double @f_log() {
108 ; CHECK-LABEL: @f_log(
109 ; CHECK-NEXT: ret double 0.000000e+00
111 %res = tail call fast double @log(double 1.0)
115 declare double @llvm.log.f64(double)
116 define double @i_log() {
117 ; CHECK-LABEL: @i_log(
118 ; CHECK-NEXT: ret double 0.000000e+00
120 %res = tail call fast double @llvm.log.f64(double 1.0)
124 declare float @log2f(float)
125 define float @f_log2f() {
126 ; CHECK-LABEL: @f_log2f(
127 ; CHECK-NEXT: ret float 0.000000e+00
129 %res = tail call fast float @log2f(float 1.0)
133 declare float @llvm.log2.f32(float)
134 define float @i_log2f() {
135 ; CHECK-LABEL: @i_log2f(
136 ; CHECK-NEXT: ret float 0.000000e+00
138 %res = tail call fast float @llvm.log2.f32(float 1.0)
142 declare double @log10(double)
143 define double @f_log10() {
144 ; CHECK-LABEL: @f_log10(
145 ; CHECK-NEXT: ret double 0.000000e+00
147 %res = tail call fast double @log10(double 1.0)
151 declare float @sinf(float)
152 define float @f_sinf() {
153 ; CHECK-LABEL: @f_sinf(
154 ; CHECK-NEXT: ret float 0x3FEAED54{{.+}}
156 %res = tail call fast float @sinf(float 1.0)
160 declare double @sinh(double)
161 define double @f_sinh() {
162 ; CHECK-LABEL: @f_sinh(
163 ; CHECK-NEXT: ret double 0x3FF2CD9F{{.+}}
165 %res = tail call fast double @sinh(double 1.0)
169 declare float @sqrtf(float)
170 define float @f_sqrtf() {
171 ; CHECK-LABEL: @f_sqrtf(
172 ; CHECK-NEXT: ret float 1.000000e+00
174 %res = tail call fast float @sqrtf(float 1.0)
178 declare double @tan(double)
179 define double @f_tan() {
180 ; CHECK-LABEL: @f_tan(
181 ; CHECK-NEXT: ret double 0x3FF8EB24{{.+}}
183 %res = tail call fast double @tan(double 1.0)
187 declare float @tanhf(float)
188 define float @f_tanhf() {
189 ; CHECK-LABEL: @f_tanhf(
190 ; CHECK-NEXT: [[RES:%.*]] = tail call fast float @tanhf(float 1.000000e+00)
191 ; CHECK-NEXT: ret float 0x3FE85EFA{{.+}}
193 %res = tail call fast float @tanhf(float 1.0)