summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/cos-1.ll
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-08-13 20:14:27 +0000
committerSanjay Patel <spatel@rotateright.com>2018-08-13 20:14:27 +0000
commit981f50919e20af957dc147ec429ef0cd397e49f6 (patch)
tree68ffdab5aa42aded5d2a409733f2e6e4ac568858 /llvm/test/Transforms/InstCombine/cos-1.ll
parent753bc5496b6ed20db4fd153328633d2118f072da (diff)
downloadbcm5719-llvm-981f50919e20af957dc147ec429ef0cd397e49f6.tar.gz
bcm5719-llvm-981f50919e20af957dc147ec429ef0cd397e49f6.zip
[SimplifyLibCalls] don't drop fast-math-flags on trig reflection folds
llvm-svn: 339608
Diffstat (limited to 'llvm/test/Transforms/InstCombine/cos-1.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/cos-1.ll13
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/test/Transforms/InstCombine/cos-1.ll b/llvm/test/Transforms/InstCombine/cos-1.ll
index daa193b57ef..8c9a5d81b73 100644
--- a/llvm/test/Transforms/InstCombine/cos-1.ll
+++ b/llvm/test/Transforms/InstCombine/cos-1.ll
@@ -40,7 +40,7 @@ define float @cosf_negated_arg(float %x) {
define float @cosf_negated_arg_FMF(float %x) {
; ANY-LABEL: @cosf_negated_arg_FMF(
-; ANY-NEXT: [[COS:%.*]] = call float @cosf(float [[X:%.*]])
+; ANY-NEXT: [[COS:%.*]] = call reassoc nnan float @cosf(float [[X:%.*]])
; ANY-NEXT: ret float [[COS]]
;
%neg = fsub float -0.0, %x
@@ -72,6 +72,17 @@ define float @sinf_negated_arg(float %x) {
ret float %r
}
+define float @sinf_negated_arg_FMF(float %x) {
+; ANY-LABEL: @sinf_negated_arg_FMF(
+; ANY-NEXT: [[SIN:%.*]] = call nnan afn float @sinf(float [[X:%.*]])
+; ANY-NEXT: [[TMP1:%.*]] = fsub nnan afn float -0.000000e+00, [[SIN]]
+; ANY-NEXT: ret float [[TMP1]]
+;
+ %neg = fsub ninf float -0.0, %x
+ %r = call afn nnan float @sinf(float %neg)
+ ret float %r
+}
+
declare void @use(double)
define double @sin_negated_arg_extra_use(double %x) {
OpenPOWER on IntegriCloud