1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/test/Transforms/InstCombine/sqrt.ll

33 lines
915 B
LLVM
Raw Normal View History

2010-07-19 10:14:26 +02:00
; RUN: opt -S -instcombine %s | FileCheck %s
define float @test1(float %x) nounwind readnone ssp {
2010-07-19 10:14:26 +02:00
entry:
; CHECK: @test1
2010-07-19 10:14:26 +02:00
; 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) readnone nounwind ; <double> [#uses=1]
2010-07-19 10:14:26 +02:00
%conv1 = fptrunc double %call to float ; <float> [#uses=1]
; CHECK: ret float
ret float %conv1
}
declare double @sqrt(double)
; PR8096
define float @test2(float %x) nounwind readnone ssp {
entry:
; CHECK: @test2
; 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
}