diff options
author | dorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-05 09:54:20 +0000 |
---|---|---|
committer | dorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-05 09:54:20 +0000 |
commit | e12906b9575f3225ead0f4a1095647b01a9471ce (patch) | |
tree | 26cd50c3f350a2ee9a8127ba71ee3f88ea837a07 /gcc/tree-vectorizer.h | |
parent | 8998938d29c405a1216f648467f4a39484898f1c (diff) | |
download | gcc-e12906b9575f3225ead0f4a1095647b01a9471ce.tar.gz |
* tree-flow.h (stmt_ann_d): Move aux to ...
(tree_ann_common_d): ... here.
* tree-ssa-loop-im.c (LIM_DATA, determine_invariantness_stmt,
move_computations_stmt, schedule_sm): Update references to
aux.
* tree-vectorizer.h (set_stmt_info, vinfo_for_stmt): Likewise.
* tree-vect-transform.c (vect_create_index_for_vector_ref): Update
call to set_stmt_info.
(vect_transform_loop): Likewise.
* tree-vectorizer.c (new_loop_vec_info, destroy_loop_vec_info):
Likewise.
* tree-vect-analyze.c (vect_analyze_scalar_cycles): Made void instead of
bool.
(vect_mark_relevant): Takes two additional arguments - live_p and
relevant_p. Set RELEVANT_P and LIVE_P according to these arguments.
(vect_stmt_relevant_p): Differentiate between a live stmt and a
relevant stmt. Return two values = live_p and relevant_p.
(vect_mark_stmts_to_be_vectorized): Call vect_mark_relevant and
vect_stmt_relevant_p with additional arguments. Phis are no longer
put into the worklist (analyzed seperately in analyze_scalar_cycles).
(vect_determine_vectorization_factor): Also check for LIVE_P, because a
stmt that is marked as irrelevant and live, cause it's only used out
side the loop, may need to be vectorized (e.g. reduction).
(vect_analyze_operations): Examine phis. Call
vectorizable_live_operation for for LIVE_P stmts. Check if
need_to_vectorize.
(vect_analyze_scalar_cycles): Update documentation. Don't fail
vectorization - just classify the scalar cycles created by the loop
phis. Call vect_is_simple_reduction.
(vect_analyze_loop): Call to analyze_scalar_cycles moved earlier.
* tree-vect-transform.c (vect_create_index_for_vector_ref): Update
call to set_stmt_info.
(vect_get_vec_def_for_operand): Code reorganized - the code that
classifies the type of use was factored out to vect_is_simple_use.
(vectorizable_store, vect_is_simple_cond): Call vect_is_simple_use with
additional arguments.
(vectorizable_assignment): Likewise. Also make sure the stmt is relevant
and computes a loop_vec_def.
(vectorizable_operation, vectorizable_load, vectorizable_condition):
Likewise.
(vectorizable_live_operation): New.
(vect_transform_stmt): Handle LIVE_P stmts.
* tree-vectorizer.c (new_stmt_vec_info): Initialize the new fields
STMT_VINFO_LIVE_P and STMT_VINFO_DEF_TYPE.
(new_loop_vec_info, destroy_loop_vec_info): Also handle phis.
(vect_is_simple_use): Determine the type of the def and return it
in a new function argument. Consider vect_reduction_def and
vect_induction_def, but for now these are not supported.
(vect_is_simple_reduction): New. Empty for now.
* tree-vectorizer.h (vect_def_type): New enum type.
(_stmt_vec_info): Added new fields - live and _stmt_vec_info.
(STMT_VINFO_LIVE_P, STMT_VINFO_DEF_TYPE): New accessor macros.
(vect_is_simple_use): New arguments added to function declaration.
(vect_is_simple_reduction): New function declaration.
(vectorizable_live_operation): New function declaration.
* tree-vect-analyze.c (vect_can_advance_ivs_p): Add debug printout.
(vect_can_advance_ivs_p): Likewise.
* tree-vect-transform.c (vect_update_ivs_after_vectorizer): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100617 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r-- | gcc/tree-vectorizer.h | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 30a7830b675..739da71fea9 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -56,6 +56,16 @@ enum dr_alignment_support { dr_aligned }; +/* Define type of def-use cross-iteraiton cycle. */ +enum vect_def_type { + vect_constant_def, + vect_invariant_def, + vect_loop_def, + vect_induction_def, + vect_reduction_def, + vect_unknown_def_type +}; + /* Define verbosity levels. */ enum verbosity_levels { REPORT_NONE, @@ -163,6 +173,10 @@ typedef struct _stmt_vec_info { indicates whether the stmt needs to be vectorized. */ bool relevant; + /* Indicates whether this stmts is part of a computation whose result is + used outside the loop. */ + bool live; + /* The vector type to be used. */ tree vectype; @@ -215,6 +229,10 @@ typedef struct _stmt_vec_info { /* Alignment information. The offset of the data-reference from its base in bytes. */ tree misalignment; + + /* Classify the def of this stmt. */ + enum vect_def_type def_type; + } *stmt_vec_info; /* Access Functions. */ @@ -222,6 +240,7 @@ typedef struct _stmt_vec_info { #define STMT_VINFO_STMT(S) (S)->stmt #define STMT_VINFO_LOOP_VINFO(S) (S)->loop_vinfo #define STMT_VINFO_RELEVANT_P(S) (S)->relevant +#define STMT_VINFO_LIVE_P(S) (S)->live #define STMT_VINFO_VECTYPE(S) (S)->vectype #define STMT_VINFO_VEC_STMT(S) (S)->vectorized_stmt #define STMT_VINFO_DATA_REF(S) (S)->data_ref_info @@ -233,22 +252,23 @@ typedef struct _stmt_vec_info { #define STMT_VINFO_VECT_STEP(S) (S)->step #define STMT_VINFO_VECT_BASE_ALIGNED_P(S) (S)->base_aligned_p #define STMT_VINFO_VECT_MISALIGNMENT(S) (S)->misalignment +#define STMT_VINFO_DEF_TYPE(S) (S)->def_type -static inline void set_stmt_info (stmt_ann_t ann, stmt_vec_info stmt_info); +static inline void set_stmt_info (tree_ann_t ann, stmt_vec_info stmt_info); static inline stmt_vec_info vinfo_for_stmt (tree stmt); static inline void -set_stmt_info (stmt_ann_t ann, stmt_vec_info stmt_info) +set_stmt_info (tree_ann_t ann, stmt_vec_info stmt_info) { if (ann) - ann->aux = (char *) stmt_info; + ann->common.aux = (char *) stmt_info; } static inline stmt_vec_info vinfo_for_stmt (tree stmt) { - stmt_ann_t ann = stmt_ann (stmt); - return ann ? (stmt_vec_info) ann->aux : NULL; + tree_ann_t ann = tree_ann (stmt); + return ann ? (stmt_vec_info) ann->common.aux : NULL; } /*-----------------------------------------------------------------*/ @@ -309,8 +329,10 @@ extern void slpeel_verify_cfg_after_peeling (struct loop *, struct loop *); /** In tree-vectorizer.c **/ extern tree vect_strip_conversion (tree); extern tree get_vectype_for_scalar_type (tree); -extern bool vect_is_simple_use (tree , loop_vec_info, tree *); +extern bool vect_is_simple_use (tree, loop_vec_info, tree *, tree *, + enum vect_def_type *); extern bool vect_is_simple_iv_evolution (unsigned, tree, tree *, tree *); +extern tree vect_is_simple_reduction (struct loop *, tree); extern bool vect_can_force_dr_alignment_p (tree, unsigned int); extern enum dr_alignment_support vect_supportable_dr_alignment (struct data_reference *); @@ -331,6 +353,7 @@ extern bool vectorizable_store (tree, block_stmt_iterator *, tree *); extern bool vectorizable_operation (tree, block_stmt_iterator *, tree *); extern bool vectorizable_assignment (tree, block_stmt_iterator *, tree *); extern bool vectorizable_condition (tree, block_stmt_iterator *, tree *); +extern bool vectorizable_live_operation (tree, block_stmt_iterator *, tree *); /* Driver for transformation stage. */ extern void vect_transform_loop (loop_vec_info, struct loops *); |