| Meador Inge | 193e035 | 2012-11-13 04:16:17 +0000 | [diff] [blame^] | 1 | ; RUN: opt < %s -instcombine -enable-double-float-shrink -S | FileCheck %s |
| 2 | |
| 3 | target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" |
| 4 | target triple = "x86_64-unknown-linux-gnu" |
| 5 | |
| 6 | define float @acos_test(float %f) nounwind readnone { |
| 7 | ; CHECK: acos_test |
| 8 | %conv = fpext float %f to double |
| 9 | %call = call double @acos(double %conv) |
| 10 | %conv1 = fptrunc double %call to float |
| 11 | ret float %conv1 |
| 12 | ; CHECK: call float @acosf(float %f) |
| 13 | } |
| 14 | |
| 15 | define double @acos_test2(float %f) nounwind readnone { |
| 16 | ; CHECK: acos_test2 |
| 17 | %conv = fpext float %f to double |
| 18 | %call = call double @acos(double %conv) |
| 19 | ret double %call |
| 20 | ; CHECK: call double @acos(double %conv) |
| 21 | } |
| 22 | |
| 23 | define float @acosh_test(float %f) nounwind readnone { |
| 24 | ; CHECK: acosh_test |
| 25 | %conv = fpext float %f to double |
| 26 | %call = call double @acosh(double %conv) |
| 27 | %conv1 = fptrunc double %call to float |
| 28 | ret float %conv1 |
| 29 | ; CHECK: call float @acoshf(float %f) |
| 30 | } |
| 31 | |
| 32 | define double @acosh_test2(float %f) nounwind readnone { |
| 33 | ; CHECK: acosh_test2 |
| 34 | %conv = fpext float %f to double |
| 35 | %call = call double @acosh(double %conv) |
| 36 | ret double %call |
| 37 | ; CHECK: call double @acosh(double %conv) |
| 38 | } |
| 39 | |
| 40 | define float @asin_test(float %f) nounwind readnone { |
| 41 | ; CHECK: asin_test |
| 42 | %conv = fpext float %f to double |
| 43 | %call = call double @asin(double %conv) |
| 44 | %conv1 = fptrunc double %call to float |
| 45 | ret float %conv1 |
| 46 | ; CHECK: call float @asinf(float %f) |
| 47 | } |
| 48 | |
| 49 | define double @asin_test2(float %f) nounwind readnone { |
| 50 | ; CHECK: asin_test2 |
| 51 | %conv = fpext float %f to double |
| 52 | %call = call double @asin(double %conv) |
| 53 | ret double %call |
| 54 | ; CHECK: call double @asin(double %conv) |
| 55 | } |
| 56 | |
| 57 | define float @asinh_test(float %f) nounwind readnone { |
| 58 | ; CHECK: asinh_test |
| 59 | %conv = fpext float %f to double |
| 60 | %call = call double @asinh(double %conv) |
| 61 | %conv1 = fptrunc double %call to float |
| 62 | ret float %conv1 |
| 63 | ; CHECK: call float @asinhf(float %f) |
| 64 | } |
| 65 | |
| 66 | define double @asinh_test2(float %f) nounwind readnone { |
| 67 | ; CHECK: asinh_test2 |
| 68 | %conv = fpext float %f to double |
| 69 | %call = call double @asinh(double %conv) |
| 70 | ret double %call |
| 71 | ; CHECK: call double @asinh(double %conv) |
| 72 | } |
| 73 | |
| 74 | define float @atan_test(float %f) nounwind readnone { |
| 75 | ; CHECK: atan_test |
| 76 | %conv = fpext float %f to double |
| 77 | %call = call double @atan(double %conv) |
| 78 | %conv1 = fptrunc double %call to float |
| 79 | ret float %conv1 |
| 80 | ; CHECK: call float @atanf(float %f) |
| 81 | } |
| 82 | |
| 83 | define double @atan_test2(float %f) nounwind readnone { |
| 84 | ; CHECK: atan_test2 |
| 85 | %conv = fpext float %f to double |
| 86 | %call = call double @atan(double %conv) |
| 87 | ret double %call |
| 88 | ; CHECK: call double @atan(double %conv) |
| 89 | } |
| 90 | define float @atanh_test(float %f) nounwind readnone { |
| 91 | ; CHECK: atanh_test |
| 92 | %conv = fpext float %f to double |
| 93 | %call = call double @atanh(double %conv) |
| 94 | %conv1 = fptrunc double %call to float |
| 95 | ret float %conv1 |
| 96 | ; CHECK: call float @atanhf(float %f) |
| 97 | } |
| 98 | |
| 99 | define double @atanh_test2(float %f) nounwind readnone { |
| 100 | ; CHECK: atanh_test2 |
| 101 | %conv = fpext float %f to double |
| 102 | %call = call double @atanh(double %conv) |
| 103 | ret double %call |
| 104 | ; CHECK: call double @atanh(double %conv) |
| 105 | } |
| 106 | define float @cbrt_test(float %f) nounwind readnone { |
| 107 | ; CHECK: cbrt_test |
| 108 | %conv = fpext float %f to double |
| 109 | %call = call double @cbrt(double %conv) |
| 110 | %conv1 = fptrunc double %call to float |
| 111 | ret float %conv1 |
| 112 | ; CHECK: call float @cbrtf(float %f) |
| 113 | } |
| 114 | |
| 115 | define double @cbrt_test2(float %f) nounwind readnone { |
| 116 | ; CHECK: cbrt_test2 |
| 117 | %conv = fpext float %f to double |
| 118 | %call = call double @cbrt(double %conv) |
| 119 | ret double %call |
| 120 | ; CHECK: call double @cbrt(double %conv) |
| 121 | } |
| 122 | define float @exp_test(float %f) nounwind readnone { |
| 123 | ; CHECK: exp_test |
| 124 | %conv = fpext float %f to double |
| 125 | %call = call double @exp(double %conv) |
| 126 | %conv1 = fptrunc double %call to float |
| 127 | ret float %conv1 |
| 128 | ; CHECK: call float @expf(float %f) |
| 129 | } |
| 130 | |
| 131 | define double @exp_test2(float %f) nounwind readnone { |
| 132 | ; CHECK: exp_test2 |
| 133 | %conv = fpext float %f to double |
| 134 | %call = call double @exp(double %conv) |
| 135 | ret double %call |
| 136 | ; CHECK: call double @exp(double %conv) |
| 137 | } |
| 138 | define float @expm1_test(float %f) nounwind readnone { |
| 139 | ; CHECK: expm1_test |
| 140 | %conv = fpext float %f to double |
| 141 | %call = call double @expm1(double %conv) |
| 142 | %conv1 = fptrunc double %call to float |
| 143 | ret float %conv1 |
| 144 | ; CHECK: call float @expm1f(float %f) |
| 145 | } |
| 146 | |
| 147 | define double @expm1_test2(float %f) nounwind readnone { |
| 148 | ; CHECK: expm1_test2 |
| 149 | %conv = fpext float %f to double |
| 150 | %call = call double @expm1(double %conv) |
| 151 | ret double %call |
| 152 | ; CHECK: call double @expm1(double %conv) |
| 153 | } |
| 154 | define float @exp10_test(float %f) nounwind readnone { |
| 155 | ; CHECK: exp10_test |
| 156 | %conv = fpext float %f to double |
| 157 | %call = call double @exp10(double %conv) |
| 158 | %conv1 = fptrunc double %call to float |
| 159 | ret float %conv1 |
| 160 | ; CHECK: call float @exp10f(float %f) |
| 161 | } |
| 162 | |
| 163 | define double @exp10_test2(float %f) nounwind readnone { |
| 164 | ; CHECK: exp10_test2 |
| 165 | %conv = fpext float %f to double |
| 166 | %call = call double @exp10(double %conv) |
| 167 | ret double %call |
| 168 | ; CHECK: call double @exp10(double %conv) |
| 169 | } |
| 170 | define float @log_test(float %f) nounwind readnone { |
| 171 | ; CHECK: log_test |
| 172 | %conv = fpext float %f to double |
| 173 | %call = call double @log(double %conv) |
| 174 | %conv1 = fptrunc double %call to float |
| 175 | ret float %conv1 |
| 176 | ; CHECK: call float @logf(float %f) |
| 177 | } |
| 178 | |
| 179 | define double @log_test2(float %f) nounwind readnone { |
| 180 | ; CHECK: log_test2 |
| 181 | %conv = fpext float %f to double |
| 182 | %call = call double @log(double %conv) |
| 183 | ret double %call |
| 184 | ; CHECK: call double @log(double %conv) |
| 185 | } |
| 186 | define float @log10_test(float %f) nounwind readnone { |
| 187 | ; CHECK: log10_test |
| 188 | %conv = fpext float %f to double |
| 189 | %call = call double @log10(double %conv) |
| 190 | %conv1 = fptrunc double %call to float |
| 191 | ret float %conv1 |
| 192 | ; CHECK: call float @log10f(float %f) |
| 193 | } |
| 194 | |
| 195 | define double @log10_test2(float %f) nounwind readnone { |
| 196 | ; CHECK: log10_test2 |
| 197 | %conv = fpext float %f to double |
| 198 | %call = call double @log10(double %conv) |
| 199 | ret double %call |
| 200 | ; CHECK: call double @log10(double %conv) |
| 201 | } |
| 202 | define float @log1p_test(float %f) nounwind readnone { |
| 203 | ; CHECK: log1p_test |
| 204 | %conv = fpext float %f to double |
| 205 | %call = call double @log1p(double %conv) |
| 206 | %conv1 = fptrunc double %call to float |
| 207 | ret float %conv1 |
| 208 | ; CHECK: call float @log1pf(float %f) |
| 209 | } |
| 210 | |
| 211 | define double @log1p_test2(float %f) nounwind readnone { |
| 212 | ; CHECK: log1p_test2 |
| 213 | %conv = fpext float %f to double |
| 214 | %call = call double @log1p(double %conv) |
| 215 | ret double %call |
| 216 | ; CHECK: call double @log1p(double %conv) |
| 217 | } |
| 218 | define float @log2_test(float %f) nounwind readnone { |
| 219 | ; CHECK: log2_test |
| 220 | %conv = fpext float %f to double |
| 221 | %call = call double @log2(double %conv) |
| 222 | %conv1 = fptrunc double %call to float |
| 223 | ret float %conv1 |
| 224 | ; CHECK: call float @log2f(float %f) |
| 225 | } |
| 226 | |
| 227 | define double @log2_test2(float %f) nounwind readnone { |
| 228 | ; CHECK: log2_test2 |
| 229 | %conv = fpext float %f to double |
| 230 | %call = call double @log2(double %conv) |
| 231 | ret double %call |
| 232 | ; CHECK: call double @log2(double %conv) |
| 233 | } |
| 234 | define float @logb_test(float %f) nounwind readnone { |
| 235 | ; CHECK: logb_test |
| 236 | %conv = fpext float %f to double |
| 237 | %call = call double @logb(double %conv) |
| 238 | %conv1 = fptrunc double %call to float |
| 239 | ret float %conv1 |
| 240 | ; CHECK: call float @logbf(float %f) |
| 241 | } |
| 242 | |
| 243 | define double @logb_test2(float %f) nounwind readnone { |
| 244 | ; CHECK: logb_test2 |
| 245 | %conv = fpext float %f to double |
| 246 | %call = call double @logb(double %conv) |
| 247 | ret double %call |
| 248 | ; CHECK: call double @logb(double %conv) |
| 249 | } |
| 250 | define float @sin_test(float %f) nounwind readnone { |
| 251 | ; CHECK: sin_test |
| 252 | %conv = fpext float %f to double |
| 253 | %call = call double @sin(double %conv) |
| 254 | %conv1 = fptrunc double %call to float |
| 255 | ret float %conv1 |
| 256 | ; CHECK: call float @sinf(float %f) |
| 257 | } |
| 258 | |
| 259 | define double @sin_test2(float %f) nounwind readnone { |
| 260 | ; CHECK: sin_test2 |
| 261 | %conv = fpext float %f to double |
| 262 | %call = call double @sin(double %conv) |
| 263 | ret double %call |
| 264 | ; CHECK: call double @sin(double %conv) |
| 265 | } |
| 266 | define float @sqrt_test(float %f) nounwind readnone { |
| 267 | ; CHECK: sqrt_test |
| 268 | %conv = fpext float %f to double |
| 269 | %call = call double @sqrt(double %conv) |
| 270 | %conv1 = fptrunc double %call to float |
| 271 | ret float %conv1 |
| 272 | ; CHECK: call float @sqrtf(float %f) |
| 273 | } |
| 274 | |
| 275 | define double @sqrt_test2(float %f) nounwind readnone { |
| 276 | ; CHECK: sqrt_test2 |
| 277 | %conv = fpext float %f to double |
| 278 | %call = call double @sqrt(double %conv) |
| 279 | ret double %call |
| 280 | ; CHECK: call double @sqrt(double %conv) |
| 281 | } |
| 282 | define float @tan_test(float %f) nounwind readnone { |
| 283 | ; CHECK: tan_test |
| 284 | %conv = fpext float %f to double |
| 285 | %call = call double @tan(double %conv) |
| 286 | %conv1 = fptrunc double %call to float |
| 287 | ret float %conv1 |
| 288 | ; CHECK: call float @tanf(float %f) |
| 289 | } |
| 290 | |
| 291 | define double @tan_test2(float %f) nounwind readnone { |
| 292 | ; CHECK: tan_test2 |
| 293 | %conv = fpext float %f to double |
| 294 | %call = call double @tan(double %conv) |
| 295 | ret double %call |
| 296 | ; CHECK: call double @tan(double %conv) |
| 297 | } |
| 298 | define float @tanh_test(float %f) nounwind readnone { |
| 299 | ; CHECK: tanh_test |
| 300 | %conv = fpext float %f to double |
| 301 | %call = call double @tanh(double %conv) |
| 302 | %conv1 = fptrunc double %call to float |
| 303 | ret float %conv1 |
| 304 | ; CHECK: call float @tanhf(float %f) |
| 305 | } |
| 306 | |
| 307 | define double @tanh_test2(float %f) nounwind readnone { |
| 308 | ; CHECK: tanh_test2 |
| 309 | %conv = fpext float %f to double |
| 310 | %call = call double @tanh(double %conv) |
| 311 | ret double %call |
| 312 | ; CHECK: call double @tanh(double %conv) |
| 313 | } |
| 314 | |
| 315 | declare double @tanh(double) nounwind readnone |
| 316 | declare double @tan(double) nounwind readnone |
| 317 | declare double @sqrt(double) nounwind readnone |
| 318 | declare double @sin(double) nounwind readnone |
| 319 | declare double @log2(double) nounwind readnone |
| 320 | declare double @log1p(double) nounwind readnone |
| 321 | declare double @log10(double) nounwind readnone |
| 322 | declare double @log(double) nounwind readnone |
| 323 | declare double @logb(double) nounwind readnone |
| 324 | declare double @exp10(double) nounwind readnone |
| 325 | declare double @expm1(double) nounwind readnone |
| 326 | declare double @exp(double) nounwind readnone |
| 327 | declare double @cbrt(double) nounwind readnone |
| 328 | declare double @atanh(double) nounwind readnone |
| 329 | declare double @atan(double) nounwind readnone |
| 330 | declare double @acos(double) nounwind readnone |
| 331 | declare double @acosh(double) nounwind readnone |
| 332 | declare double @asin(double) nounwind readnone |
| 333 | declare double @asinh(double) nounwind readnone |