[llvm] r361988 - [NFC][InstCombine] Add a unary FNeg test to fsub.ll.

Cameron McInally via llvm-commits llvm-commits at lists.llvm.org
Wed May 29 09:50:14 PDT 2019


Author: mcinally
Date: Wed May 29 09:50:14 2019
New Revision: 361988

URL: http://llvm.org/viewvc/llvm-project?rev=361988&view=rev
Log:
[NFC][InstCombine] Add a unary FNeg test to fsub.ll.

Modified:
    llvm/trunk/test/Transforms/InstCombine/fsub.ll

Modified: llvm/trunk/test/Transforms/InstCombine/fsub.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/fsub.ll?rev=361988&r1=361987&r2=361988&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/fsub.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/fsub.ll Wed May 29 09:50:14 2019
@@ -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
 




More information about the llvm-commits mailing list