mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-15 20:06:46 +00:00
3d925d24e8
(fptrunc (sqrt (fpext x))) -> (sqrtf x) transformation if -fno-builtin is specified. rdar://10466410 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145460 91177308-0d34-0410-b5e6-96231b3b80d8
18 lines
583 B
LLVM
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)
|