Commit 2aacf3c3 by Ira Rosen Committed by Ira Rosen

tree-vect-loop.c (vect_create_epilog_for_reduction): Use the result of multiple…

tree-vect-loop.c (vect_create_epilog_for_reduction): Use the result of multiple results reduction when...


        * tree-vect-loop.c (vect_create_epilog_for_reduction): Use the
        result of multiple results reduction when extracting the final
        value using scalar code.

From-SVN: r177426
parent 0f36b2da
2011-08-05 Ira Rosen <ira.rosen@linaro.org>
* tree-vect-loop.c (vect_create_epilog_for_reduction): Use the
result of multiple results reduction when extracting the final
value using scalar code.
2011-08-05 Richard Guenther <rguenther@suse.de> 2011-08-05 Richard Guenther <rguenther@suse.de>
PR tree-optimization/49984 PR tree-optimization/49984
......
...@@ -3706,13 +3706,13 @@ vect_create_epilog_for_reduction (VEC (tree, heap) *vect_defs, gimple stmt, ...@@ -3706,13 +3706,13 @@ vect_create_epilog_for_reduction (VEC (tree, heap) *vect_defs, gimple stmt,
{ {
tree first_vect = PHI_RESULT (VEC_index (gimple, new_phis, 0)); tree first_vect = PHI_RESULT (VEC_index (gimple, new_phis, 0));
tree tmp; tree tmp;
gimple new_vec_stmt = NULL;
vec_dest = vect_create_destination_var (scalar_dest, vectype); vec_dest = vect_create_destination_var (scalar_dest, vectype);
for (k = 1; k < VEC_length (gimple, new_phis); k++) for (k = 1; k < VEC_length (gimple, new_phis); k++)
{ {
gimple next_phi = VEC_index (gimple, new_phis, k); gimple next_phi = VEC_index (gimple, new_phis, k);
tree second_vect = PHI_RESULT (next_phi); tree second_vect = PHI_RESULT (next_phi);
gimple new_vec_stmt;
tmp = build2 (code, vectype, first_vect, second_vect); tmp = build2 (code, vectype, first_vect, second_vect);
new_vec_stmt = gimple_build_assign (vec_dest, tmp); new_vec_stmt = gimple_build_assign (vec_dest, tmp);
...@@ -3722,6 +3722,11 @@ vect_create_epilog_for_reduction (VEC (tree, heap) *vect_defs, gimple stmt, ...@@ -3722,6 +3722,11 @@ vect_create_epilog_for_reduction (VEC (tree, heap) *vect_defs, gimple stmt,
} }
new_phi_result = first_vect; new_phi_result = first_vect;
if (new_vec_stmt)
{
VEC_truncate (gimple, new_phis, 0);
VEC_safe_push (gimple, heap, new_phis, new_vec_stmt);
}
} }
else else
new_phi_result = PHI_RESULT (VEC_index (gimple, new_phis, 0)); new_phi_result = PHI_RESULT (VEC_index (gimple, new_phis, 0));
...@@ -3832,7 +3837,10 @@ vect_create_epilog_for_reduction (VEC (tree, heap) *vect_defs, gimple stmt, ...@@ -3832,7 +3837,10 @@ vect_create_epilog_for_reduction (VEC (tree, heap) *vect_defs, gimple stmt,
vec_size_in_bits = tree_low_cst (TYPE_SIZE (vectype), 1); vec_size_in_bits = tree_low_cst (TYPE_SIZE (vectype), 1);
FOR_EACH_VEC_ELT (gimple, new_phis, i, new_phi) FOR_EACH_VEC_ELT (gimple, new_phis, i, new_phi)
{ {
vec_temp = PHI_RESULT (new_phi); if (gimple_code (new_phi) == GIMPLE_PHI)
vec_temp = PHI_RESULT (new_phi);
else
vec_temp = gimple_assign_lhs (new_phi);
rhs = build3 (BIT_FIELD_REF, scalar_type, vec_temp, bitsize, rhs = build3 (BIT_FIELD_REF, scalar_type, vec_temp, bitsize,
bitsize_zero_node); bitsize_zero_node);
epilog_stmt = gimple_build_assign (new_scalar_dest, rhs); epilog_stmt = gimple_build_assign (new_scalar_dest, rhs);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment