forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for sqrt, sqrtl, and sqrtf in TargetLibraryInfo. Disable
(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
- Loading branch information
Chad Rosier
committed
Nov 29, 2011
1 parent
6029b6d
commit 3d925d2
Showing
5 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
; 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) |