diff options
author | Ira Rosen <irar@il.ibm.com> | 2008-08-19 08:31:41 +0000 |
---|---|---|
committer | Ira Rosen <irar@gcc.gnu.org> | 2008-08-19 08:31:41 +0000 |
commit | 5d59337297f9410a407e2e8e89f38ebbc9aa40df (patch) | |
tree | f4481b3ce0ab856f0a57386df3e28b42d737975d /gcc/tree-vectorizer.h | |
parent | 45ea82c11f4e9984a8f902f1e70913d5472911d3 (diff) | |
download | gcc-5d59337297f9410a407e2e8e89f38ebbc9aa40df.zip gcc-5d59337297f9410a407e2e8e89f38ebbc9aa40df.tar.gz gcc-5d59337297f9410a407e2e8e89f38ebbc9aa40df.tar.bz2 |
tree-vectorizer.c (supportable_widening_operation): Support multi-step conversion...
* tree-vectorizer.c (supportable_widening_operation): Support
multi-step conversion, return the number of steps in such conversion
and the required intermediate types.
(supportable_narrowing_operation): Likewise.
* tree-vectorizer.h (vect_pow2): New function.
(supportable_widening_operation): Change argument types.
(supportable_narrowing_operation): Likewise.
(vectorizable_type_promotion): Add an argument.
(vectorizable_type_demotion): Likewise.
* tree-vect-analyze.c (vect_analyze_operations): Call
vectorizable_type_promotion and vectorizable_type_demotion with
additional argument.
(vect_get_and_check_slp_defs): Detect patterns.
(vect_build_slp_tree): Add an argument, don't fail in case of multiple
types.
(vect_analyze_slp_instance): Don't fail in case of multiple types. Call
vect_build_slp_tree with correct arguments. Calculate unrolling factor
according to the smallest type in the loop.
(vect_detect_hybrid_slp_stmts): Include statements from patterns.
* tree-vect-patterns.c (vect_recog_widen_mult_pattern): Call
supportable_widening_operation with correct arguments.
* tree-vect-transform.c (vect_get_slp_defs): Allocate output vector
operands lists according to the number of vector statements in left
or right node, if exists.
(vect_gen_widened_results_half): Remove unused argument.
(vectorizable_conversion): Call supportable_widening_operation,
supportable_narrowing_operation, and vect_gen_widened_results_half
with correct arguments.
(vectorizable_assignment): Change documentation, support multiple
types in SLP.
(vectorizable_operation): Likewise.
(vect_get_loop_based_defs): New function.
(vect_create_vectorized_demotion_stmts): Likewise.
(vectorizable_type_demotion): Support loop-aware SLP and general
multi-step conversion. Call vect_get_loop_based_defs and
vect_create_vectorized_demotion_stmts for transformation.
(vect_create_vectorized_promotion_stmts): New function.
(vectorizable_type_promotion): Support loop-aware SLP and general
multi-step conversion. Call vect_create_vectorized_promotion_stmts
for transformation.
(vectorizable_store): Change documentation, support multiple
types in SLP.
(vectorizable_load): Likewise.
(vect_transform_stmt): Pass SLP_NODE to
vectorizable_type_promotion and vectorizable_type_demotion.
(vect_schedule_slp_instance): Move here the calculation of number
of vectorized statements for each node from...
(vect_schedule_slp): ... here.
(vect_transform_loop): Call vect_schedule_slp without the last
argument.
From-SVN: r139225
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r-- | gcc/tree-vectorizer.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index cf7c5b1..a22353c 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -522,6 +522,10 @@ typedef struct _stmt_vec_info { #define TARG_VEC_STORE_COST 1 #endif +/* The maximum number of intermediate steps required in multi-step type + conversion. */ +#define MAX_INTERM_CVT_STEPS 3 + /* Avoid GTY(()) on stmt_vec_info. */ typedef void *vec_void_p; DEF_VEC_P (vec_void_p); @@ -602,6 +606,16 @@ stmt_vinfo_set_outside_of_loop_cost (stmt_vec_info stmt_info, slp_tree slp_node, STMT_VINFO_OUTSIDE_OF_LOOP_COST (stmt_info) = cost; } +static inline int +vect_pow2 (int x) +{ + int i, res = 1; + + for (i = 0; i < x; i++) + res *= 2; + + return res; +} /*-----------------------------------------------------------------*/ /* Info on data references alignment. */ @@ -671,9 +685,10 @@ extern enum dr_alignment_support vect_supportable_dr_alignment (struct data_reference *); extern bool reduction_code_for_scalar_code (enum tree_code, enum tree_code *); extern bool supportable_widening_operation (enum tree_code, gimple, tree, - tree *, tree *, enum tree_code *, enum tree_code *, bool *, tree *); + tree *, tree *, enum tree_code *, enum tree_code *, + int *, VEC (tree, heap) **); extern bool supportable_narrowing_operation (enum tree_code, const_gimple, - const_tree, enum tree_code *, bool *, tree *); + tree, enum tree_code *, int *, VEC (tree, heap) **); /* Creation and deletion of loop and stmt info structs. */ extern loop_vec_info new_loop_vec_info (struct loop *loop); @@ -705,9 +720,9 @@ extern bool vectorizable_store (gimple, gimple_stmt_iterator *, gimple *, extern bool vectorizable_operation (gimple, gimple_stmt_iterator *, gimple *, slp_tree); extern bool vectorizable_type_promotion (gimple, gimple_stmt_iterator *, - gimple *); + gimple *, slp_tree); extern bool vectorizable_type_demotion (gimple, gimple_stmt_iterator *, - gimple *); + gimple *, slp_tree); extern bool vectorizable_conversion (gimple, gimple_stmt_iterator *, gimple *, slp_tree); extern bool vectorizable_assignment (gimple, gimple_stmt_iterator *, gimple *, |