summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/fp-fold.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen/X86/fp-fold.ll')
-rw-r--r--llvm/test/CodeGen/X86/fp-fold.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/fp-fold.ll b/llvm/test/CodeGen/X86/fp-fold.ll
index b8e30a4ce42..d3d965b95b0 100644
--- a/llvm/test/CodeGen/X86/fp-fold.ll
+++ b/llvm/test/CodeGen/X86/fp-fold.ll
@@ -88,6 +88,19 @@ define float @fsub_neg_x_y(float %x, float %y) {
ret float %r
}
+define float @fsub_neg_y(float %x, float %y) {
+; UNSAFE-LABEL: fsub_neg_y:
+; UNSAFE: # %bb.0:
+; UNSAFE-NEXT: mulss {{.*}}(%rip), %xmm0
+; UNSAFE-NEXT: subss %xmm1, %xmm0
+; UNSAFE-NEXT: addss %xmm1, %xmm0
+; UNSAFE-NEXT: retq
+ %mul = fmul float %x, 5.000000e+00
+ %add = fadd float %mul, %y
+ %r = fsub nsz reassoc float %y, %add
+ ret float %r
+}
+
define float @fsub_negzero(float %x) {
; STRICT-LABEL: fsub_negzero:
; STRICT: # %bb.0:
OpenPOWER on IntegriCloud