1 ; RUN: opt < %s -constprop -S | FileCheck %s
2 ; RUN: opt < %s -constprop -disable-simplify-libcalls -S | FileCheck %s --check-prefix=FNOBUILTIN
4 declare double @acos(double)
5 declare double @asin(double)
6 declare double @atan(double)
7 declare double @atan2(double, double)
8 declare double @ceil(double)
9 declare double @cos(double)
10 declare double @cosh(double)
11 declare double @exp(double)
12 declare double @exp2(double)
13 declare double @fabs(double)
14 declare double @floor(double)
15 declare double @fmod(double, double)
16 declare double @log(double)
17 declare double @log10(double)
18 declare double @pow(double, double)
19 declare double @sin(double)
20 declare double @sinh(double)
21 declare double @sqrt(double)
22 declare double @tan(double)
23 declare double @tanh(double)
25 declare float @acosf(float)
26 declare float @asinf(float)
27 declare float @atanf(float)
28 declare float @atan2f(float, float)
29 declare float @ceilf(float)
30 declare float @cosf(float)
31 declare float @coshf(float)
32 declare float @expf(float)
33 declare float @exp2f(float)
34 declare float @fabsf(float)
35 declare float @floorf(float)
36 declare float @fmodf(float, float)
37 declare float @logf(float)
38 declare float @log10f(float)
39 declare float @powf(float, float)
40 declare float @sinf(float)
41 declare float @sinhf(float)
42 declare float @sqrtf(float)
43 declare float @tanf(float)
44 declare float @tanhf(float)
48 ; FNOBUILTIN-LABEL: @T(
52 %A = call double @cos(double 0.000000e+00)
53 %B = call double @sin(double 0.000000e+00)
54 %a = fadd double %A, %B
55 %C = call double @tan(double 0.000000e+00)
56 %b = fadd double %a, %C
57 %D = call double @sqrt(double 4.000000e+00)
58 %c = fadd double %b, %D
63 %1 = call double @acos(double 1.000000e+00)
64 store double %1, double* %slot
66 %2 = call double @asin(double 1.000000e+00)
67 store double %2, double* %slot
69 %3 = call double @atan(double 3.000000e+00)
70 store double %3, double* %slot
72 %4 = call double @atan2(double 3.000000e+00, double 4.000000e+00)
73 store double %4, double* %slot
75 %5 = call double @ceil(double 3.000000e+00)
76 store double %5, double* %slot
78 %6 = call double @cosh(double 3.000000e+00)
79 store double %6, double* %slot
81 %7 = call double @exp(double 3.000000e+00)
82 store double %7, double* %slot
84 %8 = call double @exp2(double 3.000000e+00)
85 store double %8, double* %slot
87 %9 = call double @fabs(double 3.000000e+00)
88 store double %9, double* %slot
90 %10 = call double @floor(double 3.000000e+00)
91 store double %10, double* %slot
93 %11 = call double @fmod(double 3.000000e+00, double 4.000000e+00)
94 store double %11, double* %slot
96 %12 = call double @log(double 3.000000e+00)
97 store double %12, double* %slot
99 %13 = call double @log10(double 3.000000e+00)
100 store double %13, double* %slot
102 %14 = call double @pow(double 3.000000e+00, double 4.000000e+00)
103 store double %14, double* %slot
105 %15 = call double @sinh(double 3.000000e+00)
106 store double %15, double* %slot
108 %16 = call double @tanh(double 3.000000e+00)
109 store double %16, double* %slot
111 %17 = call float @acosf(float 1.000000e+00)
112 store float %17, float* %slotf
114 %18 = call float @asinf(float 1.000000e+00)
115 store float %18, float* %slotf
117 %19 = call float @atanf(float 3.000000e+00)
118 store float %19, float* %slotf
120 %20 = call float @atan2f(float 3.000000e+00, float 4.000000e+00)
121 store float %20, float* %slotf
123 %21 = call float @ceilf(float 3.000000e+00)
124 store float %21, float* %slotf
126 %22 = call float @cosf(float 3.000000e+00)
127 store float %22, float* %slotf
129 %23 = call float @coshf(float 3.000000e+00)
130 store float %23, float* %slotf
132 %24 = call float @expf(float 3.000000e+00)
133 store float %24, float* %slotf
135 %25 = call float @exp2f(float 3.000000e+00)
136 store float %25, float* %slotf
138 %26 = call float @fabsf(float 3.000000e+00)
139 store float %26, float* %slotf
141 %27 = call float @floorf(float 3.000000e+00)
142 store float %27, float* %slotf
144 %28 = call float @fmodf(float 3.000000e+00, float 4.000000e+00)
145 store float %28, float* %slotf
147 %29 = call float @logf(float 3.000000e+00)
148 store float %29, float* %slotf
150 %30 = call float @log10f(float 3.000000e+00)
151 store float %30, float* %slotf
153 %31 = call float @powf(float 3.000000e+00, float 4.000000e+00)
154 store float %31, float* %slotf
156 %32 = call float @sinf(float 3.000000e+00)
157 store float %32, float* %slotf
159 %33 = call float @sinhf(float 3.000000e+00)
160 store float %33, float* %slotf
162 %34 = call float @sqrtf(float 3.000000e+00)
163 store float %34, float* %slotf
165 %35 = call float @tanf(float 3.000000e+00)
166 store float %35, float* %slotf
168 %36 = call float @tanhf(float 3.000000e+00)
169 store float %36, float* %slotf
174 %E = call double @exp2(double 4.0)
175 %d = fadd double %c, %E
179 define i1 @test_sse_cvt() nounwind readnone {
180 ; CHECK-LABEL: @test_sse_cvt(
184 %i0 = tail call i32 @llvm.x86.sse.cvtss2si(<4 x float> <float 1.75, float undef, float undef, float undef>) nounwind
185 %i1 = tail call i32 @llvm.x86.sse.cvttss2si(<4 x float> <float 1.75, float undef, float undef, float undef>) nounwind
186 %i2 = tail call i64 @llvm.x86.sse.cvtss2si64(<4 x float> <float 1.75, float undef, float undef, float undef>) nounwind
187 %i3 = tail call i64 @llvm.x86.sse.cvttss2si64(<4 x float> <float 1.75, float undef, float undef, float undef>) nounwind
188 %i4 = call i32 @llvm.x86.sse2.cvtsd2si(<2 x double> <double 1.75, double undef>) nounwind
189 %i5 = call i32 @llvm.x86.sse2.cvttsd2si(<2 x double> <double 1.75, double undef>) nounwind
190 %i6 = call i64 @llvm.x86.sse2.cvtsd2si64(<2 x double> <double 1.75, double undef>) nounwind
191 %i7 = call i64 @llvm.x86.sse2.cvttsd2si64(<2 x double> <double 1.75, double undef>) nounwind
192 %sum11 = add i32 %i0, %i1
193 %sum12 = add i32 %i4, %i5
194 %sum1 = add i32 %sum11, %sum12
195 %sum21 = add i64 %i2, %i3
196 %sum22 = add i64 %i6, %i7
197 %sum2 = add i64 %sum21, %sum22
198 %sum1.sext = sext i32 %sum1 to i64
199 %b = icmp eq i64 %sum1.sext, %sum2
203 declare i32 @llvm.x86.sse.cvtss2si(<4 x float>) nounwind readnone
204 declare i32 @llvm.x86.sse.cvttss2si(<4 x float>) nounwind readnone
205 declare i64 @llvm.x86.sse.cvtss2si64(<4 x float>) nounwind readnone
206 declare i64 @llvm.x86.sse.cvttss2si64(<4 x float>) nounwind readnone
207 declare i32 @llvm.x86.sse2.cvtsd2si(<2 x double>) nounwind readnone
208 declare i32 @llvm.x86.sse2.cvttsd2si(<2 x double>) nounwind readnone
209 declare i64 @llvm.x86.sse2.cvtsd2si64(<2 x double>) nounwind readnone
210 declare i64 @llvm.x86.sse2.cvttsd2si64(<2 x double>) nounwind readnone
212 define double @test_intrinsic_pow() nounwind uwtable ssp {
214 ; CHECK-LABEL: @test_intrinsic_pow(
217 %0 = call double @llvm.pow.f64(double 1.500000e+00, double 3.000000e+00)
221 declare double @llvm.pow.f64(double, double) nounwind readonly