diff options
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r-- | gcc/tree-vectorizer.h | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 6e20652..2529994 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -1,5 +1,5 @@ /* Loop Vectorization - Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Dorit Naishlos <dorit@il.ibm.com> This file is part of GCC. @@ -268,6 +268,13 @@ typedef struct _stmt_vec_info { /* For loads only, if there is a store with the same location, this field is TRUE. */ bool read_write_dep; + + /* Vectorization costs associated with statement. */ + struct + { + int outside_of_loop; /* Statements generated outside loop. */ + int inside_of_loop; /* Statements generated inside loop. */ + } cost; } *stmt_vec_info; /* Access Functions. */ @@ -300,6 +307,42 @@ typedef struct _stmt_vec_info { #define DR_GROUP_READ_WRITE_DEPENDENCE(S) (S)->read_write_dep #define STMT_VINFO_RELEVANT_P(S) ((S)->relevant != vect_unused_in_loop) +#define STMT_VINFO_OUTSIDE_OF_LOOP_COST(S) (S)->cost.outside_of_loop +#define STMT_VINFO_INSIDE_OF_LOOP_COST(S) (S)->cost.inside_of_loop + +/* These are some defines for the initial implementation of the vectorizer's + cost model. These will later be target specific hooks. */ + +/* Cost of conditional branch. */ +#ifndef TARG_COND_BRANCH_COST +#define TARG_COND_BRANCH_COST 3 +#endif + +/* Cost of any vector operation, excluding load, store or vector to scalar + operation. */ +#ifndef TARG_VEC_STMT_COST +#define TARG_VEC_STMT_COST 1 +#endif + +/* Cost of vector to scalar operation. */ +#ifndef TARG_VEC_TO_SCALAR_COST +#define TARG_VEC_TO_SCALAR_COST 1 +#endif + +/* Cost of aligned vector load. */ +#ifndef TARG_VEC_LOAD_COST +#define TARG_VEC_LOAD_COST 1 +#endif + +/* Cost of misaligned vector load. */ +#ifndef TARG_VEC_UNALIGNED_LOAD_COST +#define TARG_VEC_UNALIGNED_LOAD_COST 2 +#endif + +/* Cost of vector store. */ +#ifndef TARG_VEC_STORE_COST +#define TARG_VEC_STORE_COST 1 +#endif static inline void set_stmt_info (stmt_ann_t ann, stmt_vec_info stmt_info); static inline stmt_vec_info vinfo_for_stmt (tree stmt); @@ -437,6 +480,7 @@ extern bool vectorizable_condition (tree, block_stmt_iterator *, tree *); extern bool vectorizable_live_operation (tree, block_stmt_iterator *, tree *); extern bool vectorizable_reduction (tree, block_stmt_iterator *, tree *); extern bool vectorizable_induction (tree, block_stmt_iterator *, tree *); +extern int vect_estimate_min_profitable_iters (loop_vec_info); /* Driver for transformation stage. */ extern void vect_transform_loop (loop_vec_info); |