]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Transforms/InstCombine/fold-sqrt-sqrtf.ll
Vendor import of llvm trunk r351319 (just before the release_80 branch
[FreeBSD/FreeBSD.git] / test / Transforms / InstCombine / fold-sqrt-sqrtf.ll
1 ; RUN: opt -instcombine -S -disable-simplify-libcalls < %s | FileCheck %s
2 ; rdar://10466410
3
4 ; Instcombine tries to fold (fptrunc (sqrt (fpext x))) -> (sqrtf x), but this
5 ; shouldn't fold when sqrtf isn't available.
6 define float @foo(float %f) uwtable ssp {
7 entry:
8 ; CHECK: %conv = fpext float %f to double
9 ; CHECK: %call = tail call double @sqrt(double %conv)
10 ; CHECK: %conv1 = fptrunc double %call to float
11   %conv = fpext float %f to double
12   %call = tail call double @sqrt(double %conv)
13   %conv1 = fptrunc double %call to float
14   ret float %conv1
15 }
16
17 declare double @sqrt(double)