summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorirar <irar@138bc75d-0d04-0410-961f-82ee72b054a4>2010-04-22 18:03:01 +0000
committerirar <irar@138bc75d-0d04-0410-961f-82ee72b054a4>2010-04-22 18:03:01 +0000
commit47deb25f3ff06300c472e86057fb4afffdac6f8d (patch)
tree144fa12816f0643bd8e04966503f8528729a0649 /gcc/tree-vect-loop.c
parentec2329cf169318003926e5933019dbeee5f1f1e9 (diff)
downloadgcc-47deb25f3ff06300c472e86057fb4afffdac6f8d.tar.gz
PR tree-optimization/43482
* tree-vect-loop.c (vect_create_epilog_for_reduction): Handle loop unrolling in update of exit phis. Fix comment. * tree-vect-slp.c (vect_analyze_slp): Check that there are at least two reduction statements in the loop before starting SLP analysis. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158650 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index e6e9008ea37..83b823d84bf 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -2961,7 +2961,7 @@ vect_create_epilog_for_reduction (VEC (tree, heap) *vect_defs, gimple stmt,
enum vect_def_type dt = vect_unknown_def_type;
int j, i;
VEC (tree, heap) *scalar_results = NULL;
- int group_size = 1, k, ratio;
+ unsigned int group_size = 1, k, ratio;
VEC (tree, heap) *vec_initial_defs = NULL;
VEC (gimple, heap) *phis;
@@ -3439,7 +3439,8 @@ vect_finalize_reduction:
v_out2 = reduce <v_out1>
s_out3 = extract_field <v_out2, 0>
s_out4 = adjust_result <s_out3>
- use <s_out4> */
+ use <s_out4>
+ use <s_out4> */
/* In SLP we may have several statements in NEW_PHIS and REDUCTION_PHIS (in
case that GROUP_SIZE is greater than vectorization factor). Therefore, we
@@ -3447,8 +3448,13 @@ vect_finalize_reduction:
(GROUP_SIZE / number of new vector stmts) scalar results correspond to
the first vector stmt, etc.
(RATIO is equal to (GROUP_SIZE / number of new vector stmts)). */
- ratio = group_size / VEC_length (gimple, new_phis);
- gcc_assert (!(group_size % VEC_length (gimple, new_phis)));
+ if (group_size > VEC_length (gimple, new_phis))
+ {
+ ratio = group_size / VEC_length (gimple, new_phis);
+ gcc_assert (!(group_size % VEC_length (gimple, new_phis)));
+ }
+ else
+ ratio = 1;
for (k = 0; k < group_size; k++)
{