diff options
author | Richard Biener <rguenther@suse.de> | 2019-10-21 11:34:00 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2019-10-21 11:34:00 +0000 |
commit | 30c0d1e3cf8b03992e08cfd00ccf1fcb638d3c03 (patch) | |
tree | b33b83c1349ea50a692fcf52dd3a36aace307184 /gcc/tree-vect-loop.c | |
parent | ae7f3143a3876378d051e64c8e68718f27c41075 (diff) | |
download | gcc-30c0d1e3cf8b03992e08cfd00ccf1fcb638d3c03.zip gcc-30c0d1e3cf8b03992e08cfd00ccf1fcb638d3c03.tar.gz gcc-30c0d1e3cf8b03992e08cfd00ccf1fcb638d3c03.tar.bz2 |
tree-vectorizer.h (_slp_tree::ops): New member.
2019-10-21 Richard Biener <rguenther@suse.de>
* tree-vectorizer.h (_slp_tree::ops): New member.
(SLP_TREE_SCALAR_OPS): New.
(vect_get_slp_defs): Adjust prototype.
* tree-vect-slp.c (vect_free_slp_tree): Release
SLP_TREE_SCALAR_OPS.
(vect_create_new_slp_node): Initialize it. New overload for
initializing by an operands array.
(_slp_oprnd_info::ops): New member.
(vect_create_oprnd_info): Initialize it.
(vect_free_oprnd_info): Release it.
(vect_get_and_check_slp_defs): Populate the operands array.
Do not swap operands in the IL when not necessary.
(vect_build_slp_tree_2): Build SLP nodes for invariant operands.
Record SLP_TREE_SCALAR_OPS for all invariant nodes. Also
swap operands in the operands array. Do not swap operands in
the IL.
(vect_slp_rearrange_stmts): Re-arrange SLP_TREE_SCALAR_OPS as well.
(vect_gather_slp_loads): Fix.
(vect_detect_hybrid_slp_stmts): Likewise.
(vect_slp_analyze_node_operations_1): Search for a internal
def child for computing reduction SLP_TREE_NUMBER_OF_VEC_STMTS.
(vect_slp_analyze_node_operations): Skip ops-only stmts for
the def-type push/pop dance.
(vect_get_constant_vectors): Compute number_of_vectors here.
Use SLP_TREE_SCALAR_OPS and simplify greatly.
(vect_get_slp_vect_defs): Use gimple_get_lhs also for PHIs.
(vect_get_slp_defs): Simplify greatly.
* tree-vect-loop.c (vectorize_fold_left_reduction): Simplify.
(vect_transform_reduction): Likewise.
* tree-vect-stmts.c (vect_get_vec_defs): Simplify.
(vectorizable_call): Likewise.
(vectorizable_operation): Likewise.
(vectorizable_load): Likewise.
(vectorizable_condition): Likewise.
(vectorizable_comparison): Likewise.
From-SVN: r277241
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r-- | gcc/tree-vect-loop.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index a7f19ca..9efb797 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -5312,10 +5312,7 @@ vectorize_fold_left_reduction (stmt_vec_info stmt_info, if (slp_node) { auto_vec<vec<tree> > vec_defs (2); - auto_vec<tree> sops(2); - sops.quick_push (ops[0]); - sops.quick_push (ops[1]); - vect_get_slp_defs (sops, slp_node, &vec_defs); + vect_get_slp_defs (slp_node, &vec_defs); vec_oprnds0.safe_splice (vec_defs[1 - reduc_index]); vec_defs[0].release (); vec_defs[1].release (); @@ -6484,16 +6481,8 @@ vect_transform_reduction (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, { /* Get vec defs for all the operands except the reduction index, ensuring the ordering of the ops in the vector is kept. */ - auto_vec<tree, 3> slp_ops; auto_vec<vec<tree>, 3> vec_defs; - - slp_ops.quick_push (ops[0]); - slp_ops.quick_push (ops[1]); - if (op_type == ternary_op) - slp_ops.quick_push (ops[2]); - - vect_get_slp_defs (slp_ops, slp_node, &vec_defs); - + vect_get_slp_defs (slp_node, &vec_defs); vec_oprnds0.safe_splice (vec_defs[0]); vec_defs[0].release (); vec_oprnds1.safe_splice (vec_defs[1]); |