[llvm] r329418 - [InstCombine] add test for fsub+fneg with extra use; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 6 09:30:53 PDT 2018


Author: spatel
Date: Fri Apr  6 09:30:52 2018
New Revision: 329418

URL: http://llvm.org/viewvc/llvm-project?rev=329418&view=rev
Log:
[InstCombine] add test for fsub+fneg with extra use; NFC

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=329418&r1=329417&r2=329418&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/fsub.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/fsub.ll Fri Apr  6 09:30:52 2018
@@ -27,6 +27,21 @@ define float @neg_sub_nsz(float %x, floa
   ret float %t2
 }
 
+declare void @use(float)
+
+define float @neg_sub_nsz_extra_use(float %x, float %y) {
+; CHECK-LABEL: @neg_sub_nsz_extra_use(
+; CHECK-NEXT:    [[T1:%.*]] = fsub float [[X:%.*]], [[Y:%.*]]
+; CHECK-NEXT:    [[T2:%.*]] = fsub nsz float [[Y]], [[X]]
+; CHECK-NEXT:    call void @use(float [[T1]])
+; CHECK-NEXT:    ret float [[T2]]
+;
+  %t1 = fsub float %x, %y
+  %t2 = fsub nsz float -0.0, %t1
+  call void @use(float %t1)
+  ret float %t2
+}
+
 ; With nsz: Z - (X - Y) --> Z + (Y - X)
 
 define float @sub_sub_nsz(float %x, float %y, float %z) {




More information about the llvm-commits mailing list