From b0f64919e44ffca149e29f0225c3e810b98901c1 Mon Sep 17 00:00:00 2001 From: irar Date: Thu, 3 Nov 2011 08:44:35 +0000 Subject: PR tree-optimization/50912 * tree-vectorizer.h (slp_void_p): New. (struct _slp_tree): Replace left and right with children. Update documentation. (struct _slp_oprnd_info): New. (vect_get_vec_defs): Declare. (vect_get_slp_defs): Update arguments. * tree-vect-loop.c (vect_create_epilog_for_reduction): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_reduction): Likewise. * tree-vect-stmts.c (vect_get_vec_defs): Remove static, add argument. Update call to vect_get_slp_defs. (vectorizable_conversion): Update call to vect_get_vec_defs. (vectorizable_assignment, vectorizable_shift, vectorizable_operation): Likewise. (vectorizable_type_demotion): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_type_promotion, vectorizable_store): Likewise. (vect_analyze_stmt): Fix typo. * tree-vect-slp.c (vect_free_slp_tree): Update SLP tree traversal. (vect_print_slp_tree, vect_mark_slp_stmts, vect_mark_slp_stmts_relevant, vect_slp_rearrange_stmts, vect_detect_hybrid_slp_stmts, vect_slp_analyze_node_operations, vect_schedule_slp_instance): Likewise. (vect_create_new_slp_node): New. (vect_create_oprnd_info, vect_free_oprnd_info): Likewise. (vect_get_and_check_slp_defs): Pass information about defs using oprnds_info, allow any number of operands. (vect_build_slp_tree): Likewise. Update calls to vect_get_and_check_slp_defs. Fix comments. (vect_analyze_slp_instance): Move node creation to vect_create_new_slp_node. (vect_get_slp_defs): Allow any number of operands. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180819 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vect-loop.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gcc/tree-vect-loop.c') diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index a04099fc06a..15988998687 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -3537,8 +3537,8 @@ vect_create_epilog_for_reduction (VEC (tree, heap) *vect_defs, gimple stmt, /* Get the loop-entry arguments. */ if (slp_node) - vect_get_slp_defs (reduction_op, NULL_TREE, slp_node, &vec_initial_defs, - NULL, reduc_index); + vect_get_vec_defs (reduction_op, NULL_TREE, stmt, &vec_initial_defs, + NULL, slp_node, reduc_index); else { vec_initial_defs = VEC_alloc (tree, heap, 1); @@ -4792,8 +4792,8 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi, } if (slp_node) - vect_get_slp_defs (op0, op1, slp_node, &vec_oprnds0, &vec_oprnds1, - -1); + vect_get_vec_defs (op0, op1, stmt, &vec_oprnds0, &vec_oprnds1, + slp_node, -1); else { loop_vec_def0 = vect_get_vec_def_for_operand (ops[!reduc_index], -- cgit v1.2.1 From f2104a5407d5a8d2fac30d7c306f571632a344dc Mon Sep 17 00:00:00 2001 From: irar Date: Sun, 6 Nov 2011 09:01:45 +0000 Subject: * tree-vectorizer.h (vectorizable_condition): Add argument. * tree-vect-loop.c (vectorizable_reduction): Fail for condition in SLP. Update calls to vectorizable_condition. * tree-vect-stmts.c (vect_is_simple_cond): Add basic block info to the arguments. Pass it to vect_is_simple_use_1. (vectorizable_condition): Add slp_node to the arguments. Support vectorization of basic blocks. Fail for reduction in SLP. Update calls to vect_is_simple_cond and vect_is_simple_use. Support SLP: call vect_get_slp_defs to get vector operands. (vect_analyze_stmt): Update calls to vectorizable_condition. (vect_transform_stmt): Likewise. * tree-vect-slp.c (vect_create_new_slp_node): Handle COND_EXPR. (vect_get_and_check_slp_defs): Handle COND_EXPR. Allow pattern def stmts. (vect_build_slp_tree): Handle COND_EXPR. (vect_analyze_slp_instance): Push pattern statements to root node. (vect_get_constant_vectors): Fix comments. Handle COND_EXPR. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181026 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vect-loop.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gcc/tree-vect-loop.c') diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 15988998687..a209b4bb14d 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -4416,6 +4416,9 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi, gcc_unreachable (); } + if (code == COND_EXPR && slp_node) + return false; + scalar_dest = gimple_assign_lhs (stmt); scalar_type = TREE_TYPE (scalar_dest); if (!POINTER_TYPE_P (scalar_type) && !INTEGRAL_TYPE_P (scalar_type) @@ -4502,7 +4505,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi, if (code == COND_EXPR) { - if (!vectorizable_condition (stmt, gsi, NULL, ops[reduc_index], 0)) + if (!vectorizable_condition (stmt, gsi, NULL, ops[reduc_index], 0, NULL)) { if (vect_print_dump_info (REPORT_DETAILS)) fprintf (vect_dump, "unsupported condition in reduction"); @@ -4774,7 +4777,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi, gcc_assert (!slp_node); vectorizable_condition (stmt, gsi, vec_stmt, PHI_RESULT (VEC_index (gimple, phis, 0)), - reduc_index); + reduc_index, NULL); /* Multiple types are not supported for condition. */ break; } -- cgit v1.2.1