diff options
author | irar <irar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-03 08:44:35 +0000 |
---|---|---|
committer | irar <irar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-03 08:44:35 +0000 |
commit | b0f64919e44ffca149e29f0225c3e810b98901c1 (patch) | |
tree | 4a3e5280c77376f6cbc8b2adb845491b1fb646f8 /gcc/tree-vectorizer.h | |
parent | 95de80bc124bba09d4cf629e4ebcaae326f2aea1 (diff) | |
download | gcc-b0f64919e44ffca149e29f0225c3e810b98901c1.tar.gz |
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
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r-- | gcc/tree-vectorizer.h | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 6703edb5ee0..bcbc32cbd95 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -73,15 +73,15 @@ enum vect_def_type { /************************************************************************ SLP ************************************************************************/ +typedef void *slp_void_p; +DEF_VEC_P (slp_void_p); +DEF_VEC_ALLOC_P (slp_void_p, heap); -/* A computation tree of an SLP instance. Each node corresponds to a group of +/* A computation tree of an SLP instance. Each node corresponds to a group of stmts to be packed in a SIMD stmt. */ typedef struct _slp_tree { - /* Only binary and unary operations are supported. LEFT child corresponds to - the first operand and RIGHT child to the second if the operation is - binary. */ - struct _slp_tree *left; - struct _slp_tree *right; + /* Nodes that contain def-stmts of this node statements operands. */ + VEC (slp_void_p, heap) *children; /* A group of scalar stmts to be vectorized together. */ VEC (gimple, heap) *stmts; /* Vectorized stmt/s. */ @@ -146,14 +146,32 @@ DEF_VEC_ALLOC_P(slp_instance, heap); #define SLP_INSTANCE_LOADS(S) (S)->loads #define SLP_INSTANCE_FIRST_LOAD_STMT(S) (S)->first_load -#define SLP_TREE_LEFT(S) (S)->left -#define SLP_TREE_RIGHT(S) (S)->right +#define SLP_TREE_CHILDREN(S) (S)->children #define SLP_TREE_SCALAR_STMTS(S) (S)->stmts #define SLP_TREE_VEC_STMTS(S) (S)->vec_stmts #define SLP_TREE_NUMBER_OF_VEC_STMTS(S) (S)->vec_stmts_size #define SLP_TREE_OUTSIDE_OF_LOOP_COST(S) (S)->cost.outside_of_loop #define SLP_TREE_INSIDE_OF_LOOP_COST(S) (S)->cost.inside_of_loop +/* This structure is used in creation of an SLP tree. Each instance + corresponds to the same operand in a group of scalar stmts in an SLP + node. */ +typedef struct _slp_oprnd_info +{ + /* Def-stmts for the operands. */ + VEC (gimple, heap) *def_stmts; + /* Information about the first statement, its vector def-type, type, the + operand itself in case it's constant, and an indication if it's a pattern + stmt. */ + enum vect_def_type first_dt; + tree first_def_type; + tree first_const_oprnd; + bool first_pattern; +} *slp_oprnd_info; + +DEF_VEC_P(slp_oprnd_info); +DEF_VEC_ALLOC_P(slp_oprnd_info, heap); + typedef struct _vect_peel_info { @@ -824,6 +842,8 @@ extern void vect_get_load_cost (struct data_reference *, int, bool, unsigned int *, unsigned int *); extern void vect_get_store_cost (struct data_reference *, int, unsigned int *); extern bool vect_supportable_shift (enum tree_code, tree); +extern void vect_get_vec_defs (tree, tree, gimple, VEC (tree, heap) **, + VEC (tree, heap) **, slp_tree, int); /* In tree-vect-data-refs.c. */ extern bool vect_can_force_dr_alignment_p (const_tree, unsigned int); @@ -891,8 +911,9 @@ extern void vect_update_slp_costs_according_to_vf (loop_vec_info); extern bool vect_analyze_slp (loop_vec_info, bb_vec_info); extern bool vect_make_slp_decision (loop_vec_info); extern void vect_detect_hybrid_slp (loop_vec_info); -extern void vect_get_slp_defs (tree, tree, slp_tree, VEC (tree,heap) **, - VEC (tree,heap) **, int); +extern void vect_get_slp_defs (VEC (tree, heap) *, slp_tree, + VEC (slp_void_p, heap) **, int); + extern LOC find_bb_location (basic_block); extern bb_vec_info vect_slp_analyze_bb (basic_block); extern void vect_slp_transform_bb (basic_block); |