diff options
author | irar <irar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-21 13:36:56 +0000 |
---|---|---|
committer | irar <irar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-21 13:36:56 +0000 |
commit | 09e31a48a894f848c041ecb59bba70084892cba9 (patch) | |
tree | 300d18c5421de122b062f8b293724c24ba1cf14b /gcc/tree-vect-slp.c | |
parent | 20e4f1c1b873e306a4eef23aa860f9c89a1d2b74 (diff) | |
download | gcc-09e31a48a894f848c041ecb59bba70084892cba9.tar.gz |
PR tree-optimization/46049
PR tree-optimization/46052
* tree-vectorizer.h (enum stmt_vec_info_type): Add new value for
shift.
(vect_get_slp_defs): Add arguments.
* tree-vect-loop.c (vect_create_epilog_for_reduction): Pass scalar
operands to vect_get_slp_defs.
(vectorizable_reduction): Fix comment, pass scalar operands to
vect_get_slp_defs.
* tree-vect-stmts.c (vect_get_vec_def_for_operand): Use operand's
type to determine number of units in the created vector.
(vect_get_vec_defs): Pass scalar operands to vect_get_slp_defs.
(vectorizable_conversion): Fix comment.
(vectorizable_shift): New function.
(vectorizable_operation): Move code that handles shifts to
vectorizable_shift.
(vectorizable_type_demotion): Fix comment, pass scalar operands to
vect_get_slp_defs.
(vectorizable_type_promotion, vectorizable_store): Likewise.
(vectorizable_condition): Fix comment.
(vect_analyze_stmt): Call vectorizable_shift.
(vect_transform_stmt): Likewise.
* tree-vect-slp.c (vect_get_constant_vectors): Add new argument.
Use it as the operand to create vectors for, except reduction
initial definition and store. Use operands type.
(vect_get_slp_defs): Add new arguments. Pass them to
vect_get_constant_vectors.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165777 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-slp.c')
-rw-r--r-- | gcc/tree-vect-slp.c | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index 935c578b5e6..7a69db05ebb 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -1817,7 +1817,8 @@ vect_update_slp_costs_according_to_vf (loop_vec_info loop_vinfo) it is -1. */ static void -vect_get_constant_vectors (slp_tree slp_node, VEC(tree,heap) **vec_oprnds, +vect_get_constant_vectors (tree op, slp_tree slp_node, + VEC (tree, heap) **vec_oprnds, unsigned int op_num, unsigned int number_of_vectors, int reduc_index) { @@ -1829,7 +1830,7 @@ vect_get_constant_vectors (slp_tree slp_node, VEC(tree,heap) **vec_oprnds, tree t = NULL_TREE; int j, number_of_places_left_in_vector; tree vector_type; - tree op, vop; + tree vop; int group_size = VEC_length (gimple, stmts); unsigned int vec_num, i; int number_of_copies = 1; @@ -1847,7 +1848,7 @@ vect_get_constant_vectors (slp_tree slp_node, VEC(tree,heap) **vec_oprnds, } op_num = reduc_index - 1; - op = gimple_op (stmt, op_num + 1); + op = gimple_op (stmt, reduc_index); /* For additional copies (see the explanation of NUMBER_OF_COPIES below) we need either neutral operands or the original operands. See get_initial_def_for_reduction() for details. */ @@ -1889,25 +1890,16 @@ vect_get_constant_vectors (slp_tree slp_node, VEC(tree,heap) **vec_oprnds, op = gimple_assign_rhs1 (stmt); } else - { - is_store = false; - op = gimple_op (stmt, op_num + 1); - } + is_store = false; + + gcc_assert (op); if (CONSTANT_CLASS_P (op)) constant_p = true; else constant_p = false; - /* For POINTER_PLUS_EXPR we use the type of the constant/invariant itself. - If OP is the first operand of POINTER_PLUS_EXPR, its type is the type of - the statement, so it's OK to use OP's type for both first and second - operands. */ - if (code == POINTER_PLUS_EXPR) - vector_type = get_vectype_for_scalar_type (TREE_TYPE (op)); - else - vector_type = STMT_VINFO_VECTYPE (stmt_vinfo); - + vector_type = get_vectype_for_scalar_type (TREE_TYPE (op)); gcc_assert (vector_type); nunits = TYPE_VECTOR_SUBPARTS (vector_type); @@ -2043,7 +2035,8 @@ vect_get_slp_vect_defs (slp_tree slp_node, VEC (tree,heap) **vec_oprnds) the right node. This is used when the second operand must remain scalar. */ void -vect_get_slp_defs (slp_tree slp_node, VEC (tree,heap) **vec_oprnds0, +vect_get_slp_defs (tree op0, tree op1, slp_tree slp_node, + VEC (tree,heap) **vec_oprnds0, VEC (tree,heap) **vec_oprnds1, int reduc_index) { gimple first_stmt; @@ -2083,7 +2076,7 @@ vect_get_slp_defs (slp_tree slp_node, VEC (tree,heap) **vec_oprnds0, vect_get_slp_vect_defs (SLP_TREE_LEFT (slp_node), vec_oprnds0); else /* Build vectors from scalar defs. */ - vect_get_constant_vectors (slp_node, vec_oprnds0, 0, number_of_vects, + vect_get_constant_vectors (op0, slp_node, vec_oprnds0, 0, number_of_vects, reduc_index); if (STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt))) @@ -2113,7 +2106,8 @@ vect_get_slp_defs (slp_tree slp_node, VEC (tree,heap) **vec_oprnds0, vect_get_slp_vect_defs (SLP_TREE_RIGHT (slp_node), vec_oprnds1); else /* Build vectors from scalar defs. */ - vect_get_constant_vectors (slp_node, vec_oprnds1, 1, number_of_vects, -1); + vect_get_constant_vectors (op1, slp_node, vec_oprnds1, 1, number_of_vects, + -1); } |