diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2018-08-13 21:49:19 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2018-08-13 21:49:19 +0000 |
| commit | 15bff18c6f2c1e68f9b25110824e384115925461 (patch) | |
| tree | 4cc9b62ce51b5fd8e48e3f24605ff811845327d5 /llvm/test | |
| parent | 7136abff1cbcd22e039356fce4e2939dfd65d82d (diff) | |
| download | bcm5719-llvm-15bff18c6f2c1e68f9b25110824e384115925461.tar.gz bcm5719-llvm-15bff18c6f2c1e68f9b25110824e384115925461.zip | |
[SimplifyLibCalls] don't drop fast-math-flags on trig reflection folds (retry r339608)
Even though this code is below a function called optimizeFloatingPointLibCall(),
we apparently can't guarantee that we're dealing with FPMathOperators, so bail
out immediately if that's not true.
llvm-svn: 339618
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/cos-1.ll | 13 |
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) { |

