From 2a5825f23bd387d239592b1efd0e8487dd83a6e4 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 15 Jun 2016 09:53:07 +0000 Subject: [PATCH] tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Do not consider dependences between accesses that belong to the same group. 2016-06-15 Richard Biener * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Do not consider dependences between accesses that belong to the same group. (vect_analyze_data_ref_dependences): Do not analyze read-read or self-dependences. * gcc.dg/vect/bb-slp-pattern-2.c: Disable loop vectorization. From-SVN: r237473 --- gcc/ChangeLog | 8 ++++++++ gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/vect/bb-slp-pattern-2.c | 1 + gcc/tree-vect-data-refs.c | 8 +++++++- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 907bb06bee9..f593bd52b70 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2016-06-15 Richard Biener + + * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Do + not consider dependences between accesses that belong to the + same group. + (vect_analyze_data_ref_dependences): Do not analyze read-read + or self-dependences. + 2016-06-14 David Malcolm * spellcheck-tree.c: Include spellcheck-tree.h rather than diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 016045f5368..3eaaa91b033 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2016-06-15 Richard Biener + + * gcc.dg/vect/bb-slp-pattern-2.c: Disable loop vectorization. + 2016-06-14 Bill Schmidt * gcc.target/powerpc/vsx-elemrev-2.c: Change effective target diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pattern-2.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pattern-2.c index 4635626b9b6..d32cb758591 100644 --- a/gcc/testsuite/gcc.dg/vect/bb-slp-pattern-2.c +++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pattern-2.c @@ -1,4 +1,5 @@ /* { dg-require-effective-target vect_condition } */ +/* { dg-additional-options "-fno-tree-vectorize -ftree-slp-vectorize -ftree-loop-if-convert" } */ #include "tree-vect.h" diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 084469f2afe..0ab8e6bf7f3 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -227,6 +227,12 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr, || (DR_IS_READ (dra) && DR_IS_READ (drb))) return false; + /* We do not have to consider dependences between accesses that belong + to the same group. */ + if (GROUP_FIRST_ELEMENT (stmtinfo_a) + && GROUP_FIRST_ELEMENT (stmtinfo_a) == GROUP_FIRST_ELEMENT (stmtinfo_b)) + return false; + /* Even if we have an anti-dependence then, as the vectorized loop covers at least two scalar iterations, there is always also a true dependence. As the vectorizer does not re-order loads and stores we can ignore @@ -469,7 +475,7 @@ vect_analyze_data_ref_dependences (loop_vec_info loop_vinfo, int *max_vf) LOOP_VINFO_NO_DATA_DEPENDENCIES (loop_vinfo) = true; if (!compute_all_dependences (LOOP_VINFO_DATAREFS (loop_vinfo), &LOOP_VINFO_DDRS (loop_vinfo), - LOOP_VINFO_LOOP_NEST (loop_vinfo), true)) + LOOP_VINFO_LOOP_NEST (loop_vinfo), false)) return false; FOR_EACH_VEC_ELT (LOOP_VINFO_DDRS (loop_vinfo), i, ddr) -- 2.30.2