diff options
author | irar <irar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-07 09:12:32 +0000 |
---|---|---|
committer | irar <irar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-07 09:12:32 +0000 |
commit | 559093aa044bc634faa14f8895ca037e8dde2715 (patch) | |
tree | 8795ce881dcce2d97198c58aa7cb9c8a103a4f24 /gcc/target.h | |
parent | 7c64ac08b6dfa096a1b1198a17ff3c60d9e7f5f2 (diff) | |
download | gcc-559093aa044bc634faa14f8895ca037e8dde2715.tar.gz |
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Update
documentation.
* targhooks.c (default_builtin_vectorization_cost): New function.
* targhooks.h (default_builtin_vectorization_cost): Declare.
* target.h (enum vect_cost_for_stmt): Define.
(builtin_vectorization_cost): Change argument and comment.
* tree-vectorizer.h: Remove cost model macros.
* tree-vect-loop.c: Include target.h.
(vect_get_cost): New function.
(vect_estimate_min_profitable_iters): Replace cost model macros with
calls to vect_get_cost.
(vect_model_reduction_cost, vect_model_induction_cost): Likewise.
* target-def.h (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Add
default implementation.
* tree-vect-stmts.c (cost_for_stmt): Replace cost model macros with
calls to target hook builtin_vectorization_cost.
(vect_model_simple_cost, vect_model_store_cost, vect_model_load_cost):
Likewise.
* Makefile.in (tree-vect-loop.o): Add dependency on TARGET_H.
* config/spu/spu.c (spu_builtin_vectorization_cost): Replace with new
implementation to return costs.
* config/i386/i386.c (ix86_builtin_vectorization_cost): Likewise.
* config/spu/spu.h: Remove vectorizer cost model macros.
* config/i386/i386.h: Likewise.
* tree-vect-slp.c (vect_build_slp_tree): Replace cost model macro with
a call to target hook builtin_vectorization_cost.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160360 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/target.h')
-rw-r--r-- | gcc/target.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/gcc/target.h b/gcc/target.h index 4e2bf984cb1..e209cfe7404 100644 --- a/gcc/target.h +++ b/gcc/target.h @@ -110,6 +110,23 @@ struct asm_int_op const char *ti; }; +/* Types of costs for vectorizer cost model. */ +enum vect_cost_for_stmt +{ + scalar_stmt, + scalar_load, + scalar_store, + vector_stmt, + vector_load, + unaligned_load, + vector_store, + vec_to_scalar, + scalar_to_vec, + cond_branch_not_taken, + cond_branch_taken, + vec_perm +}; + /* The target structure. This holds all the backend hooks. */ struct gcc_target @@ -505,9 +522,9 @@ struct gcc_target tree (* builtin_mul_widen_even) (tree); tree (* builtin_mul_widen_odd) (tree); - /* Returns the cost to be added to the overheads involved with - executing the vectorized version of a loop. */ - int (*builtin_vectorization_cost) (bool); + /* Cost of different vector/scalar statements in vectorization cost + model. */ + int (* builtin_vectorization_cost) (enum vect_cost_for_stmt); /* Return true if vector alignment is reachable (by peeling N iterations) for the given type. */ |