summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/2010-07-19-sqrt.ll
blob: 65053820482ffb55d40a6cf9f3d22fc764348c7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
; RUN: opt -S -instcombine %s | FileCheck %s

define float @foo(float %x) nounwind readnone ssp {
entry:
; CHECK-NOT: fpext
; CHECK-NOT: sqrt(
; CHECK: sqrtf(
; CHECK-NOT: fptrunc
  %conv = fpext float %x to double                ; <double> [#uses=1]
  %call = tail call double @sqrt(double %conv) nounwind ; <double> [#uses=1]
  %conv1 = fptrunc double %call to float          ; <float> [#uses=1]
; CHECK: ret float
  ret float %conv1
}

declare double @sqrt(double) readnone