summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/test/Transforms/InstCombine/fsub.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/fsub.ll b/llvm/test/Transforms/InstCombine/fsub.ll
index 33f994da29b..f4d971c7ff1 100644
--- a/llvm/test/Transforms/InstCombine/fsub.ll
+++ b/llvm/test/Transforms/InstCombine/fsub.ll
@@ -14,6 +14,17 @@ define float @test1(float %x, float %y) {
ret float %t2
}
+define float @test1_unary(float %x, float %y) {
+; CHECK-LABEL: @test1_unary(
+; CHECK-NEXT: [[T1:%.*]] = fsub float [[X:%.*]], [[Y:%.*]]
+; CHECK-NEXT: [[T2:%.*]] = fneg float [[T1]]
+; CHECK-NEXT: ret float [[T2]]
+;
+ %t1 = fsub float %x, %y
+ %t2 = fneg float %t1
+ ret float %t2
+}
+
; Can't do anything with the test above because -0.0 - 0.0 = -0.0, but if we have nsz:
; -(X - Y) --> Y - X
OpenPOWER on IntegriCloud