aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-analyze.c
diff options
context:
space:
mode:
authorIra Rosen <irar@il.ibm.com>2008-05-14 12:28:53 +0000
committerIra Rosen <irar@gcc.gnu.org>2008-05-14 12:28:53 +0000
commit2b8775f335a64ac0c7a4d32b38ee50463862d6fb (patch)
treec7ff13c57cdad9e84c367b272fa1e312faad8a01 /gcc/tree-vect-analyze.c
parentd70dcf2945e7e09446f3a03f1b12ced3543f9d33 (diff)
downloadgcc-2b8775f335a64ac0c7a4d32b38ee50463862d6fb.zip
gcc-2b8775f335a64ac0c7a4d32b38ee50463862d6fb.tar.gz
gcc-2b8775f335a64ac0c7a4d32b38ee50463862d6fb.tar.bz2
re PR tree-optimization/36098 (435.gromacs miscompares at -O3)
PR tree-optimization/36098 * tree-vect-analyze.c (vect_analyze_group_access): Set the gap value for the first load in the group in case of a gap. (vect_build_slp_tree): Check that there are no gaps in loads. From-SVN: r135290
Diffstat (limited to 'gcc/tree-vect-analyze.c')
-rw-r--r--gcc/tree-vect-analyze.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c
index 0ef7f9c..1e2012f 100644
--- a/gcc/tree-vect-analyze.c
+++ b/gcc/tree-vect-analyze.c
@@ -2230,7 +2230,13 @@ vect_analyze_group_access (struct data_reference *dr)
if (dr_step != count_in_bytes)
{
if (DR_IS_READ (dr))
- slp_impossible = true;
+ {
+ slp_impossible = true;
+ /* There is a gap after the last load in the group. This gap is a
+ difference between the stride and the number of elements. When
+ there is no gap, this difference should be 0. */
+ DR_GROUP_GAP (vinfo_for_stmt (stmt)) = stride - count;
+ }
else
{
if (vect_print_dump_info (REPORT_DETAILS))
@@ -2644,7 +2650,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, slp_tree *node,
enum machine_mode vec_mode;
tree first_stmt_const_oprnd = NULL_TREE;
struct data_reference *first_dr;
-
+
/* For every stmt in NODE find its def stmt/s. */
for (i = 0; VEC_iterate (tree, stmts, i, stmt); i++)
{
@@ -2776,15 +2782,17 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, slp_tree *node,
if (i == 0)
{
/* First stmt of the SLP group should be the first load of
- the interleaving loop if data permutation is not
- allowed. */
- if (DR_GROUP_FIRST_DR (vinfo_for_stmt (stmt)) != stmt)
+ the interleaving loop if data permutation is not allowed.
+ Check that there is no gap between the loads. */
+ if (DR_GROUP_FIRST_DR (vinfo_for_stmt (stmt)) != stmt
+ || DR_GROUP_GAP (vinfo_for_stmt (stmt)) != 0)
{
- /* FORNOW: data permutations are not supported. */
+ /* FORNOW: data permutations and gaps in loads are not
+ supported. */
if (vect_print_dump_info (REPORT_SLP))
{
fprintf (vect_dump, "Build SLP failed: strided "
- " loads need permutation ");
+ " loads need permutation or have gaps ");
print_generic_expr (vect_dump, stmt, TDF_SLIM);
}
@@ -2811,13 +2819,17 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, slp_tree *node,
}
else
{
- if (DR_GROUP_NEXT_DR (vinfo_for_stmt (prev_stmt)) != stmt)
+ /* Check that we have consecutive loads from interleaving
+ chain and that there is no gap between the loads. */
+ if (DR_GROUP_NEXT_DR (vinfo_for_stmt (prev_stmt)) != stmt
+ || DR_GROUP_GAP (vinfo_for_stmt (stmt)) != 1)
{
- /* FORNOW: data permutations are not supported. */
+ /* FORNOW: data permutations and gaps in loads are not
+ supported. */
if (vect_print_dump_info (REPORT_SLP))
{
fprintf (vect_dump, "Build SLP failed: strided "
- " loads need permutation ");
+ " loads need permutation or have gaps ");
print_generic_expr (vect_dump, stmt, TDF_SLIM);
}
return false;