diff options
author | Sanjay Patel <spatel@rotateright.com> | 2018-02-20 22:46:38 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2018-02-20 22:46:38 +0000 |
commit | 088f4690f5de49eee7619d4167096f9dd53608be (patch) | |
tree | 090bfce28f1c7410380c6ea74c100dc39fcd6917 | |
parent | 63dd97513b4999bfa74f7d810cd592caede6ac02 (diff) | |
download | bcm5719-llvm-088f4690f5de49eee7619d4167096f9dd53608be.tar.gz bcm5719-llvm-088f4690f5de49eee7619d4167096f9dd53608be.zip |
[InstCombine] add test for vector -X/-Y; NFC
m_FNeg doesn't match vector types.
llvm-svn: 325637
-rw-r--r-- | llvm/test/Transforms/InstCombine/fdiv.ll | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/llvm/test/Transforms/InstCombine/fdiv.ll b/llvm/test/Transforms/InstCombine/fdiv.ll index 3a2c62c5071..c02b2b41a4b 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> <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) { |