1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00
llvm-mirror/test/Transforms/InstCombine/fold-sqrt-sqrtf.ll
Eric Christopher a62270de2c Revert "Temporarily Revert "Add basic loop fusion pass.""
The reversion apparently deleted the test/Transforms directory.

Will be re-reverting again.

llvm-svn: 358552
2019-04-17 04:52:47 +00:00

18 lines
583 B
LLVM

; RUN: opt -instcombine -S -disable-simplify-libcalls < %s | FileCheck %s
; rdar://10466410
; Instcombine tries to fold (fptrunc (sqrt (fpext x))) -> (sqrtf x), but this
; shouldn't fold when sqrtf isn't available.
define float @foo(float %f) uwtable ssp {
entry:
; CHECK: %conv = fpext float %f to double
; CHECK: %call = tail call double @sqrt(double %conv)
; CHECK: %conv1 = fptrunc double %call to float
%conv = fpext float %f to double
%call = tail call double @sqrt(double %conv)
%conv1 = fptrunc double %call to float
ret float %conv1
}
declare double @sqrt(double)