diff options
author | Ira Rosen <irar@il.ibm.com> | 2008-09-22 07:55:39 +0000 |
---|---|---|
committer | Ira Rosen <irar@gcc.gnu.org> | 2008-09-22 07:55:39 +0000 |
commit | 5e038cad0bb468177c7adad1faebf3465ecda0fd (patch) | |
tree | 083ed4affd0a185e5e877ef640693c7f6195fbb4 /gcc/tree-vectorizer.h | |
parent | c801c273a6b8080f3fce824b3872fae899385618 (diff) | |
download | gcc-5e038cad0bb468177c7adad1faebf3465ecda0fd.zip gcc-5e038cad0bb468177c7adad1faebf3465ecda0fd.tar.gz gcc-5e038cad0bb468177c7adad1faebf3465ecda0fd.tar.bz2 |
re PR tree-optimization/37482 (definition in block 51 follows the use for SSA_NAME with -maltivec)
PR tree-optimization/37482
* tree-vectorizer.h (struct _slp_instance): Add new field.
(SLP_INSTANCE_FIRST_LOAD_STMT): New.
(get_earlier_stmt): New function.
* tree-vect-analyze.c (vect_find_first_load_in_slp_instance): New
function.
(vect_analyze_slp_instance): Set SLP_INSTANCE_FIRST_LOAD_STMT.
* tree-vect-transform.c (vect_finish_stmt_generation): Remove the
asserts that GSI points to the scalar statement being vectorized.
Set new statement location according to GSI.
(vect_schedule_slp_instance): Use GSI of
SLP_INSTANCE_FIRST_LOAD_STMT when vectorizing loads.
From-SVN: r140544
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r-- | gcc/tree-vectorizer.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 678dc59..84bd8cc 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -133,6 +133,10 @@ typedef struct _slp_instance { /* The group of nodes that contain loads of this SLP instance. */ VEC (slp_tree, heap) *loads; + + /* The first scalar load of the instance. The created vector loads will be + inserted before this statement. */ + gimple first_load; } *slp_instance; DEF_VEC_P(slp_instance); @@ -146,6 +150,7 @@ DEF_VEC_ALLOC_P(slp_instance, heap); #define SLP_INSTANCE_INSIDE_OF_LOOP_COST(S) (S)->cost.inside_of_loop #define SLP_INSTANCE_LOAD_PERMUTATION(S) (S)->load_permutation #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 @@ -578,6 +583,32 @@ set_vinfo_for_stmt (gimple stmt, stmt_vec_info info) VEC_replace (vec_void_p, stmt_vec_info_vec, uid - 1, (vec_void_p) info); } +static inline gimple +get_earlier_stmt (gimple stmt1, gimple stmt2) +{ + unsigned int uid1, uid2; + + if (stmt1 == NULL) + return stmt2; + + if (stmt2 == NULL) + return stmt1; + + uid1 = gimple_uid (stmt1); + uid2 = gimple_uid (stmt2); + + if (uid1 == 0 || uid2 == 0) + return NULL; + + gcc_assert (uid1 <= VEC_length (vec_void_p, stmt_vec_info_vec)); + gcc_assert (uid2 <= VEC_length (vec_void_p, stmt_vec_info_vec)); + + if (uid1 < uid2) + return stmt1; + else + return stmt2; +} + static inline bool is_pattern_stmt_p (stmt_vec_info stmt_info) { |