[llvm] r325637 - [InstCombine] add test for vector -X/-Y; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 14:46:38 PST 2018


Author: spatel
Date: Tue Feb 20 14:46:38 2018
New Revision: 325637

URL: http://llvm.org/viewvc/llvm-project?rev=325637&view=rev
Log:
[InstCombine] add test for vector -X/-Y; NFC

m_FNeg doesn't match vector types.

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

Modified: llvm/trunk/test/Transforms/InstCombine/fdiv.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/fdiv.ll?rev=325637&r1=325636&r2=325637&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/fdiv.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/fdiv.ll Tue Feb 20 14:46:38 2018
@@ -178,8 +178,8 @@ define float @div_with_div_denominator_e
   ret float %div2
 }
 
-define float @fdiv_fneg_fneg(float %x, float %y) {
-; CHECK-LABEL: @fdiv_fneg_fneg(
+define float @fneg_fneg(float %x, float %y) {
+; CHECK-LABEL: @fneg_fneg(
 ; CHECK-NEXT:    [[DIV:%.*]] = fdiv float [[X:%.*]], [[Y:%.*]]
 ; CHECK-NEXT:    ret float [[DIV]]
 ;
@@ -191,8 +191,8 @@ define float @fdiv_fneg_fneg(float %x, f
 
 ; The test above shows that no FMF are needed, but show that we are not dropping FMF.
 
-define float @fdiv_fneg_fneg_fast(float %x, float %y) {
-; CHECK-LABEL: @fdiv_fneg_fneg_fast(
+define float @fneg_fneg_fast(float %x, float %y) {
+; CHECK-LABEL: @fneg_fneg_fast(
 ; CHECK-NEXT:    [[DIV:%.*]] = fdiv fast float [[X:%.*]], [[Y:%.*]]
 ; CHECK-NEXT:    ret float [[DIV]]
 ;
@@ -202,6 +202,19 @@ define float @fdiv_fneg_fneg_fast(float
   ret float %div
 }
 
+define <2 x float> @fneg_fneg_vec(<2 x float> %x, <2 x float> %y) {
+; CHECK-LABEL: @fneg_fneg_vec(
+; CHECK-NEXT:    [[XNEG:%.*]] = fsub <2 x float> <float -0.000000e+00, float -0.000000e+00>, [[X:%.*]]
+; CHECK-NEXT:    [[YNEG:%.*]] = fsub <2 x float> <float -0.000000e+00, float -0.000000e+00>, [[Y:%.*]]
+; CHECK-NEXT:    [[DIV:%.*]] = fdiv <2 x float> [[XNEG]], [[YNEG]]
+; CHECK-NEXT:    ret <2 x float> [[DIV]]
+;
+  %xneg = fsub <2 x float> <float -0.0, float -0.0>, %x
+  %yneg = fsub <2 x float> <float -0.0, float -0.0>, %y
+  %div = fdiv <2 x float> %xneg, %yneg
+  ret <2 x float> %div
+}
+
 ; X / (X * Y) --> 1.0 / Y
 
 define float @div_factor(float %x, float %y) {




More information about the llvm-commits mailing list