diff options
author | Richard Biener <rguenther@suse.de> | 2013-04-09 12:39:22 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2013-04-09 12:39:22 +0000 |
commit | d755c7effcc51ce47536c1cb9edd87ed176ebc1a (patch) | |
tree | 2c8bd0affb55d76dfbc3479c59b2a8b47dc84ce1 /gcc | |
parent | 3d741091eef9e0d94e4773371542f5a3a6a00cbb (diff) | |
download | gcc-d755c7effcc51ce47536c1cb9edd87ed176ebc1a.zip gcc-d755c7effcc51ce47536c1cb9edd87ed176ebc1a.tar.gz gcc-d755c7effcc51ce47536c1cb9edd87ed176ebc1a.tar.bz2 |
tree-vectorizer.h (slp_void_p): Remove.
2013-04-09 Richard Biener <rguenther@suse.de>
* tree-vectorizer.h (slp_void_p): Remove.
(slp_tree): Typedef before _slp_tree declaration.
(struct _slp_tree): Use a vector of slp_tree as children.
(vect_get_place_in_interleaving_chain): Remove.
* tree-vect-data-refs.c (vect_get_place_in_interleaving_chain):
Move ...
* tree-vect-slp.c (vect_get_place_in_interleaving_chain): ... here
and make static.
(vect_free_slp_tree, 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, vect_remove_slp_scalar_calls):
Use slp_node instead of slp_void_p and adjust.
From-SVN: r197629
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/tree-vect-data-refs.c | 25 | ||||
-rw-r--r-- | gcc/tree-vect-slp.c | 76 | ||||
-rw-r--r-- | gcc/tree-vectorizer.h | 9 |
4 files changed, 66 insertions, 60 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 248ee1e..4238259 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,21 @@ 2013-04-09 Richard Biener <rguenther@suse.de> + * tree-vectorizer.h (slp_void_p): Remove. + (slp_tree): Typedef before _slp_tree declaration. + (struct _slp_tree): Use a vector of slp_tree as children. + (vect_get_place_in_interleaving_chain): Remove. + * tree-vect-data-refs.c (vect_get_place_in_interleaving_chain): + Move ... + * tree-vect-slp.c (vect_get_place_in_interleaving_chain): ... here + and make static. + (vect_free_slp_tree, 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, vect_remove_slp_scalar_calls): + Use slp_node instead of slp_void_p and adjust. + +2013-04-09 Richard Biener <rguenther@suse.de> + * tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa): Avoid work that is not necessary. diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 14593b5..e20ab1f 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -129,31 +129,6 @@ vect_get_smallest_scalar_type (gimple stmt, HOST_WIDE_INT *lhs_size_unit, } -/* Find the place of the data-ref in STMT in the interleaving chain that starts - from FIRST_STMT. Return -1 if the data-ref is not a part of the chain. */ - -int -vect_get_place_in_interleaving_chain (gimple stmt, gimple first_stmt) -{ - gimple next_stmt = first_stmt; - int result = 0; - - if (first_stmt != GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt))) - return -1; - - while (next_stmt && next_stmt != stmt) - { - result++; - next_stmt = GROUP_NEXT_ELEMENT (vinfo_for_stmt (next_stmt)); - } - - if (next_stmt) - return result; - else - return -1; -} - - /* Check if data references pointed by DR_I and DR_J are same or belong to same interleaving group. Return FALSE if drs are different, otherwise return TRUE. */ diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index 4a5317d..3413106 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -67,13 +67,13 @@ static void vect_free_slp_tree (slp_tree node) { int i; - slp_void_p child; + slp_tree child; if (!node) return; FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child) - vect_free_slp_tree ((slp_tree) child); + vect_free_slp_tree (child); SLP_TREE_CHILDREN (node).release (); SLP_TREE_SCALAR_STMTS (node).release (); @@ -168,6 +168,31 @@ vect_free_oprnd_info (vec<slp_oprnd_info> &oprnds_info) } +/* Find the place of the data-ref in STMT in the interleaving chain that starts + from FIRST_STMT. Return -1 if the data-ref is not a part of the chain. */ + +static int +vect_get_place_in_interleaving_chain (gimple stmt, gimple first_stmt) +{ + gimple next_stmt = first_stmt; + int result = 0; + + if (first_stmt != GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt))) + return -1; + + do + { + if (next_stmt == stmt) + return result; + result++; + next_stmt = GROUP_NEXT_ELEMENT (vinfo_for_stmt (next_stmt)); + } + while (next_stmt); + + return -1; +} + + /* Get the defs for the rhs of STMT (collect them in OPRNDS_INFO), check that they are of a valid type and that they match the defs of the first stmt of the SLP group (stored in OPRNDS_INFO). */ @@ -991,7 +1016,7 @@ vect_print_slp_tree (int dump_kind, slp_tree node) { int i; gimple stmt; - slp_void_p child; + slp_tree child; if (!node) return; @@ -1005,7 +1030,7 @@ vect_print_slp_tree (int dump_kind, slp_tree node) dump_printf (dump_kind, "\n"); FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child) - vect_print_slp_tree (dump_kind, (slp_tree) child); + vect_print_slp_tree (dump_kind, child); } @@ -1019,7 +1044,7 @@ vect_mark_slp_stmts (slp_tree node, enum slp_vect_type mark, int j) { int i; gimple stmt; - slp_void_p child; + slp_tree child; if (!node) return; @@ -1029,7 +1054,7 @@ vect_mark_slp_stmts (slp_tree node, enum slp_vect_type mark, int j) STMT_SLP_TYPE (vinfo_for_stmt (stmt)) = mark; FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child) - vect_mark_slp_stmts ((slp_tree) child, mark, j); + vect_mark_slp_stmts (child, mark, j); } @@ -1041,7 +1066,7 @@ vect_mark_slp_stmts_relevant (slp_tree node) int i; gimple stmt; stmt_vec_info stmt_info; - slp_void_p child; + slp_tree child; if (!node) return; @@ -1055,7 +1080,7 @@ vect_mark_slp_stmts_relevant (slp_tree node) } FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child) - vect_mark_slp_stmts_relevant ((slp_tree) child); + vect_mark_slp_stmts_relevant (child); } @@ -1129,26 +1154,18 @@ vect_slp_rearrange_stmts (slp_tree node, unsigned int group_size, { gimple stmt; vec<gimple> tmp_stmts; - unsigned int index, i; - slp_void_p child; - - if (!node) - return; + unsigned int i; + slp_tree child; FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child) - vect_slp_rearrange_stmts ((slp_tree) child, group_size, permutation); + vect_slp_rearrange_stmts (child, group_size, permutation); gcc_assert (group_size == SLP_TREE_SCALAR_STMTS (node).length ()); tmp_stmts.create (group_size); - - for (i = 0; i < group_size; i++) - tmp_stmts.safe_push (NULL); + tmp_stmts.quick_grow_cleared (group_size); FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, stmt) - { - index = permutation[i]; - tmp_stmts[index] = stmt; - } + tmp_stmts[permutation[i]] = stmt; SLP_TREE_SCALAR_STMTS (node).release (); SLP_TREE_SCALAR_STMTS (node) = tmp_stmts; @@ -1824,7 +1841,7 @@ vect_detect_hybrid_slp_stmts (slp_tree node) imm_use_iterator imm_iter; gimple use_stmt; stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt); - slp_void_p child; + slp_tree child; loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo); struct loop *loop = NULL; bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_vinfo); @@ -1855,7 +1872,7 @@ vect_detect_hybrid_slp_stmts (slp_tree node) vect_mark_slp_stmts (node, hybrid, i); FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child) - vect_detect_hybrid_slp_stmts ((slp_tree) child); + vect_detect_hybrid_slp_stmts (child); } @@ -1953,13 +1970,13 @@ vect_slp_analyze_node_operations (bb_vec_info bb_vinfo, slp_tree node) bool dummy; int i; gimple stmt; - slp_void_p child; + slp_tree child; if (!node) return true; FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child) - if (!vect_slp_analyze_node_operations (bb_vinfo, (slp_tree) child)) + if (!vect_slp_analyze_node_operations (bb_vinfo, child)) return false; FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, stmt) @@ -3014,14 +3031,13 @@ vect_schedule_slp_instance (slp_tree node, slp_instance instance, tree vectype; int i; slp_tree loads_node; - slp_void_p child; + slp_tree child; if (!node) return false; FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child) - vect_schedule_slp_instance ((slp_tree) child, instance, - vectorization_factor); + vect_schedule_slp_instance (child, instance, vectorization_factor); stmt = SLP_TREE_SCALAR_STMTS (node)[0]; stmt_info = vinfo_for_stmt (stmt); @@ -3111,7 +3127,7 @@ vect_remove_slp_scalar_calls (slp_tree node) gimple stmt, new_stmt; gimple_stmt_iterator gsi; int i; - slp_void_p child; + slp_tree child; tree lhs; stmt_vec_info stmt_info; @@ -3119,7 +3135,7 @@ vect_remove_slp_scalar_calls (slp_tree node) return; FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child) - vect_remove_slp_scalar_calls ((slp_tree) child); + vect_remove_slp_scalar_calls (child); FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, stmt) { diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 6c08979..1a233a0 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -97,13 +97,13 @@ add_stmt_info_to_vec (stmt_vector_for_cost *stmt_cost_vec, int count, /************************************************************************ SLP ************************************************************************/ -typedef void *slp_void_p; +typedef struct _slp_tree *slp_tree; /* 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 { +struct _slp_tree { /* Nodes that contain def-stmts of this node statements operands. */ - vec<slp_void_p> children; + vec<slp_tree> children; /* A group of scalar stmts to be vectorized together. */ vec<gimple> stmts; /* Vectorized stmt/s. */ @@ -113,7 +113,7 @@ typedef struct _slp_tree { scalar elements in one scalar iteration (GROUP_SIZE) multiplied by VF divided by vector size. */ unsigned int vec_stmts_size; -} *slp_tree; +}; /* SLP instance is a sequence of stmts in a loop that can be packed into @@ -941,7 +941,6 @@ extern tree vect_setup_realignment (gimple, gimple_stmt_iterator *, tree *, extern void vect_transform_grouped_load (gimple, vec<tree> , int, gimple_stmt_iterator *); extern void vect_record_grouped_load_vectors (gimple, vec<tree> ); -extern int vect_get_place_in_interleaving_chain (gimple, gimple); extern tree vect_get_new_vect_var (tree, enum vect_var_kind, const char *); extern tree vect_create_addr_base_for_vector_ref (gimple, gimple_seq *, tree, struct loop *); |