From a64b9c261d9d2c12b98bd14f5f1bf27e3bcb6bdd Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 28 Mar 2013 09:55:15 +0000 Subject: re PR tree-optimization/37021 (Fortran Complex reduction / multiplication not vectorized) 2013-03-28 Richard Biener PR tree-optimization/37021 * tree-vect-slp.c (vect_build_slp_tree): When not unrolling do not restrict gaps between groups. * tree-vect-stmts.c (vectorizable_load): Properly account for a gap between groups. * gcc.dg/vect/fast-math-slp-38.c: New testcase. * gcc.dg/vect/O3-pr36098.c: Un-XFAIL. From-SVN: r197189 --- gcc/tree-vect-slp.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'gcc/tree-vect-slp.c') diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index 8ef5d06..e925f57 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -740,11 +740,16 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, else { /* Load. */ - /* FORNOW: Check that there is no gap between the loads. */ - if ((GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) == stmt - && GROUP_GAP (vinfo_for_stmt (stmt)) != 0) - || (GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) != stmt - && GROUP_GAP (vinfo_for_stmt (stmt)) != 1)) + /* FORNOW: Check that there is no gap between the loads + and no gap between the groups when we need to load + multiple groups at once. + ??? We should enhance this to only disallow gaps + inside vectors. */ + if ((ncopies > 1 + && GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) == stmt + && GROUP_GAP (vinfo_for_stmt (stmt)) != 0) + || (GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) != stmt + && GROUP_GAP (vinfo_for_stmt (stmt)) != 1)) { if (dump_enabled_p ()) { @@ -762,7 +767,10 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, /* Check that the size of interleaved loads group is not greater than the SLP group size. */ if (loop_vinfo - && GROUP_SIZE (vinfo_for_stmt (stmt)) > ncopies * group_size) + && GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) == stmt + && ((GROUP_SIZE (vinfo_for_stmt (stmt)) + - GROUP_GAP (vinfo_for_stmt (stmt))) + > ncopies * group_size)) { if (dump_enabled_p ()) { -- cgit v1.1