Mercurial > hg > CbC > CbC_gcc
diff gcc/tree-vectorizer.h @ 63:b7f97abdc517 gcc-4.6-20100522
update gcc from gcc-4.5.0 to gcc-4.6
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 24 May 2010 12:47:05 +0900 |
parents | 77e2b8dfacca |
children | f6334be47118 |
line wrap: on
line diff
--- a/gcc/tree-vectorizer.h Fri Feb 12 23:41:23 2010 +0900 +++ b/gcc/tree-vectorizer.h Mon May 24 12:47:05 2010 +0900 @@ -1,6 +1,6 @@ /* Vectorizer - Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free - Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. Contributed by Dorit Naishlos <dorit@il.ibm.com> This file is part of GCC. @@ -66,6 +66,10 @@ vect_unknown_def_type }; +#define VECTORIZABLE_CYCLE_DEF(D) (((D) == vect_reduction_def) \ + || ((D) == vect_double_reduction_def) \ + || ((D) == vect_nested_cycle)) + /* Define verbosity levels. */ enum verbosity_levels { REPORT_NONE, @@ -194,6 +198,9 @@ /* Unrolling factor */ int vectorization_factor; + /* The loop location in the source. */ + LOC loop_line_number; + /* Unknown DRs according to which loop was peeled. */ struct data_reference *unaligned_dr; @@ -224,9 +231,6 @@ runtime (loop versioning) misalignment check. */ VEC(gimple,heap) *may_misalign_stmts; - /* The loop location in the source. */ - LOC loop_line_number; - /* All interleaving chains of stores in the loop, represented by the first stmt in the chain. */ VEC(gimple, heap) *strided_stores; @@ -238,6 +242,9 @@ /* The unrolling factor needed to SLP the loop. In case of that pure SLP is applied to the loop, i.e., no unrolling is needed, this is 1. */ unsigned slp_unrolling_factor; + + /* Reduction cycles detected in the loop. Used in loop-aware SLP. */ + VEC (gimple, heap) *reductions; } *loop_vec_info; /* Access Functions. */ @@ -262,6 +269,7 @@ #define LOOP_VINFO_STRIDED_STORES(L) (L)->strided_stores #define LOOP_VINFO_SLP_INSTANCES(L) (L)->slp_instances #define LOOP_VINFO_SLP_UNROLLING_FACTOR(L) (L)->slp_unrolling_factor +#define LOOP_VINFO_REDUCTIONS(L) (L)->reductions #define LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT(L) \ VEC_length (gimple, (L)->may_misalign_stmts) > 0 @@ -390,22 +398,24 @@ enum stmt_vec_info_type type; + /* Indicates whether this stmts is part of a computation whose result is + used outside the loop. */ + bool live; + + /* Stmt is part of some pattern (computation idiom) */ + bool in_pattern_p; + + /* For loads only, if there is a store with the same location, this field is + TRUE. */ + bool read_write_dep; + /* The stmt to which this info struct refers to. */ gimple stmt; /* The loop_vec_info with respect to which STMT is vectorized. */ loop_vec_info loop_vinfo; - /* Not all stmts in the loop need to be vectorized. e.g, the increment - of the loop induction variable and computation of array indexes. relevant - indicates whether the stmt needs to be vectorized. */ - enum vect_relevant 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. */ + /* The vector type to be used for the LHS of this statement. */ tree vectype; /* The vectorized version of the stmt. */ @@ -428,9 +438,6 @@ tree dr_step; tree dr_aligned_to; - /* Stmt is part of some pattern (computation idiom) */ - bool in_pattern_p; - /* Used for various bookkeeping purposes, generally holding a pointer to some other stmt S that is in some way "related" to this stmt. Current use of this field is: @@ -449,11 +456,17 @@ /* Classify the def of this stmt. */ enum vect_def_type def_type; + /* Whether the stmt is SLPed, loop-based vectorized, or both. */ + enum slp_vect_type slp_type; + /* Interleaving info. */ /* First data-ref in the interleaving group. */ gimple first_dr; /* Pointer to the next data-ref in the group. */ gimple next_dr; + /* In case that two or more stmts share data-ref, this is the pointer to the + previously detected stmt with the same dr. */ + gimple same_dr_stmt; /* The size of the interleaving group. */ unsigned int size; /* For stores, number of stores from this group seen. We vectorize the last @@ -462,12 +475,11 @@ /* For loads only, the gap from the previous load. For consecutive loads, GAP is 1. */ unsigned int gap; - /* In case that two or more stmts share data-ref, this is the pointer to the - previously detected stmt with the same dr. */ - gimple same_dr_stmt; - /* For loads only, if there is a store with the same location, this field is - TRUE. */ - bool read_write_dep; + + /* Not all stmts in the loop need to be vectorized. e.g, the increment + of the loop induction variable and computation of array indexes. relevant + indicates whether the stmt needs to be vectorized. */ + enum vect_relevant relevant; /* Vectorization costs associated with statement. */ struct @@ -476,11 +488,12 @@ int inside_of_loop; /* Statements generated inside loop. */ } cost; - /* Whether the stmt is SLPed, loop-based vectorized, or both. */ - enum slp_vect_type slp_type; - /* The bb_vec_info with respect to which STMT is vectorized. */ bb_vec_info bb_vinfo; + + /* Is this statement vectorizable or should it be skipped in (partial) + vectorization. */ + bool vectorizable; } *stmt_vec_info; /* Access Functions. */ @@ -492,6 +505,7 @@ #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_VECTORIZABLE(S) (S)->vectorizable #define STMT_VINFO_DATA_REF(S) (S)->data_ref_info #define STMT_VINFO_DR_BASE_ADDRESS(S) (S)->dr_base_address @@ -597,6 +611,9 @@ conversion. */ #define MAX_INTERM_CVT_STEPS 3 +/* The maximum vectorization factor supported by any target (V32QI). */ +#define MAX_VECTORIZATION_FACTOR 32 + /* Avoid GTY(()) on stmt_vec_info. */ typedef void *vec_void_p; DEF_VEC_P (vec_void_p); @@ -756,15 +773,18 @@ /* In tree-vect-stmts.c. */ extern tree get_vectype_for_scalar_type (tree); +extern tree get_same_sized_vectype (tree, tree); extern bool vect_is_simple_use (tree, loop_vec_info, bb_vec_info, gimple *, tree *, enum vect_def_type *); -extern bool supportable_widening_operation (enum tree_code, gimple, tree, +extern bool vect_is_simple_use_1 (tree, loop_vec_info, bb_vec_info, gimple *, + tree *, enum vect_def_type *, tree *); +extern bool supportable_widening_operation (enum tree_code, gimple, tree, tree, tree *, tree *, enum tree_code *, enum tree_code *, int *, VEC (tree, heap) **); -extern bool supportable_narrowing_operation (enum tree_code, const_gimple, - tree, enum tree_code *, int *, - VEC (tree, heap) **); +extern bool supportable_narrowing_operation (enum tree_code, tree, tree, + enum tree_code *, + int *, VEC (tree, heap) **); extern stmt_vec_info new_stmt_vec_info (gimple stmt, loop_vec_info, bb_vec_info); extern void free_stmt_vec_info (gimple stmt); @@ -795,13 +815,14 @@ (struct data_reference *); extern tree vect_get_smallest_scalar_type (gimple, HOST_WIDE_INT *, HOST_WIDE_INT *); -extern bool vect_analyze_data_ref_dependences (loop_vec_info, bb_vec_info); +extern bool vect_analyze_data_ref_dependences (loop_vec_info, bb_vec_info, + int *); extern bool vect_enhance_data_refs_alignment (loop_vec_info); extern bool vect_analyze_data_refs_alignment (loop_vec_info, bb_vec_info); extern bool vect_verify_datarefs_alignment (loop_vec_info, bb_vec_info); extern bool vect_analyze_data_ref_accesses (loop_vec_info, bb_vec_info); extern bool vect_prune_runtime_alias_test_list (loop_vec_info); -extern bool vect_analyze_data_refs (loop_vec_info, bb_vec_info); +extern bool vect_analyze_data_refs (loop_vec_info, bb_vec_info, int *); extern tree vect_create_data_ref_ptr (gimple, struct loop *, tree, tree *, gimple *, bool, bool *); extern tree bump_vector_ptr (tree, gimple, gimple_stmt_iterator *, gimple, tree); @@ -825,7 +846,7 @@ /* In tree-vect-loop.c. */ /* FORNOW: Used in tree-parloops.c. */ extern void destroy_loop_vec_info (loop_vec_info, bool); -extern gimple vect_is_simple_reduction (loop_vec_info, gimple, bool, bool *); +extern gimple vect_force_simple_reduction (loop_vec_info, gimple, bool, bool *); /* Drive for loop analysis stage. */ extern loop_vec_info vect_analyze_loop (struct loop *); /* Drive for loop transformation stage. */ @@ -833,7 +854,8 @@ extern loop_vec_info vect_analyze_loop_form (struct loop *); extern bool vectorizable_live_operation (gimple, gimple_stmt_iterator *, gimple *); -extern bool vectorizable_reduction (gimple, gimple_stmt_iterator *, gimple *); +extern bool vectorizable_reduction (gimple, gimple_stmt_iterator *, gimple *, + slp_tree); extern bool vectorizable_induction (gimple, gimple_stmt_iterator *, gimple *); extern int vect_estimate_min_profitable_iters (loop_vec_info); extern tree get_initial_def_for_reduction (gimple, tree, tree *); @@ -851,7 +873,7 @@ extern void vect_make_slp_decision (loop_vec_info); extern void vect_detect_hybrid_slp (loop_vec_info); extern void vect_get_slp_defs (slp_tree, VEC (tree,heap) **, - VEC (tree,heap) **); + VEC (tree,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);