From: Sanjay Patel Date: Tue, 20 Feb 2018 22:46:38 +0000 (+0000) Subject: [InstCombine] add test for vector -X/-Y; NFC X-Git-Tag: llvmorg-7.0.0-rc1~12393 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=088f4690f5de49eee7619d4167096f9dd53608be;p=platform%2Fupstream%2Fllvm.git [InstCombine] add test for vector -X/-Y; NFC m_FNeg doesn't match vector types. llvm-svn: 325637 --- diff --git a/llvm/test/Transforms/InstCombine/fdiv.ll b/llvm/test/Transforms/InstCombine/fdiv.ll index 3a2c62c50712..c02b2b41a4b9 100644 --- a/llvm/test/Transforms/InstCombine/fdiv.ll +++ b/llvm/test/Transforms/InstCombine/fdiv.ll @@ -178,8 +178,8 @@ define float @div_with_div_denominator_extra_use(float %x, float %y, float %z) { 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, float %y) { ; 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 %x, float %y) { 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> , [[X:%.*]] +; CHECK-NEXT: [[YNEG:%.*]] = fsub <2 x float> , [[Y:%.*]] +; CHECK-NEXT: [[DIV:%.*]] = fdiv <2 x float> [[XNEG]], [[YNEG]] +; CHECK-NEXT: ret <2 x float> [[DIV]] +; + %xneg = fsub <2 x float> , %x + %yneg = fsub <2 x float> , %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) {