]> granicus.if.org Git - llvm/commitdiff
[NFC][InstCombine] Add a unary FNeg test to fsub.ll.
authorCameron McInally <cameron.mcinally@nyu.edu>
Wed, 29 May 2019 16:50:14 +0000 (16:50 +0000)
committerCameron McInally <cameron.mcinally@nyu.edu>
Wed, 29 May 2019 16:50:14 +0000 (16:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361988 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/fsub.ll

index 33f994da29b7f41860a592ddd037d20e11279b76..f4d971c7ff1747fba2b0ceaee77d0fc8add362f8 100644 (file)
@@ -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