Commit 8340e4fc by Bin Cheng Committed by Bin Cheng

re PR tree-optimization/69848 (poor vectorization of a loop from SPEC2006 464.h264ref)

	PR tree-optimization/69848
	* tree-vect-loop.c (vectorizable_reduction): Don't factor
	comparison expr out of VEC_COND_EXPR for COND_REDUCTION.

From-SVN: r236447
parent e1fe3c69
2016-05-19 Bin Cheng <bin.cheng@arm.com>
PR tree-optimization/69848
* tree-vect-loop.c (vectorizable_reduction): Don't factor
comparison expr out of VEC_COND_EXPR for COND_REDUCTION.
2016-05-19 Segher Boessenkool <segher@kernel.crashing.org> 2016-05-19 Segher Boessenkool <segher@kernel.crashing.org>
* function.c (thread_prologue_and_epilogue_insn): Move the * function.c (thread_prologue_and_epilogue_insn): Move the
......
...@@ -6159,21 +6159,14 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi, ...@@ -6159,21 +6159,14 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
Finally, we update the phi (NEW_PHI_TREE) to take the value of Finally, we update the phi (NEW_PHI_TREE) to take the value of
the new cond_expr (INDEX_COND_EXPR). */ the new cond_expr (INDEX_COND_EXPR). */
/* Turn the condition from vec_stmt into an ssa name. */ /* Duplicate the condition from vec_stmt. */
gimple_stmt_iterator vec_stmt_gsi = gsi_for_stmt (*vec_stmt); tree ccompare = unshare_expr (gimple_assign_rhs1 (*vec_stmt));
tree ccompare = gimple_assign_rhs1 (*vec_stmt);
tree ccompare_name = make_ssa_name (TREE_TYPE (ccompare));
gimple *ccompare_stmt = gimple_build_assign (ccompare_name,
ccompare);
gsi_insert_before (&vec_stmt_gsi, ccompare_stmt, GSI_SAME_STMT);
gimple_assign_set_rhs1 (*vec_stmt, ccompare_name);
update_stmt (*vec_stmt);
/* Create a conditional, where the condition is taken from vec_stmt /* Create a conditional, where the condition is taken from vec_stmt
(CCOMPARE_NAME), then is the induction index (INDEX_BEFORE_INCR) (CCOMPARE), then is the induction index (INDEX_BEFORE_INCR) and
and else is the phi (NEW_PHI_TREE). */ else is the phi (NEW_PHI_TREE). */
tree index_cond_expr = build3 (VEC_COND_EXPR, cr_index_vector_type, tree index_cond_expr = build3 (VEC_COND_EXPR, cr_index_vector_type,
ccompare_name, indx_before_incr, ccompare, indx_before_incr,
new_phi_tree); new_phi_tree);
cond_name = make_ssa_name (cr_index_vector_type); cond_name = make_ssa_name (cr_index_vector_type);
gimple *index_condition = gimple_build_assign (cond_name, gimple *index_condition = gimple_build_assign (cond_name,
......
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