diff options
author | dorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-07-05 13:15:20 +0000 |
---|---|---|
committer | dorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-07-05 13:15:20 +0000 |
commit | 62612fe9fdb9fa147cfb3979d5ff088d04cc4010 (patch) | |
tree | ee93a0ac09d7ead4c5c794ce3dc4ce957c9b9d27 /gcc/tree-vectorizer.h | |
parent | 0d122985b494170b545ef1f31981e7ad3fabe392 (diff) | |
download | gcc-62612fe9fdb9fa147cfb3979d5ff088d04cc4010.tar.gz |
* tree-vectorizer.c (new_loop_vec_info): Initialize
LOOP_VINFO_COST_MODEL_MIN_ITERS.
* tree-vectorizer.h (_loop_vec_info): Added new filed
min_profitable_iters.
(LOOP_VINFO_COST_MODEL_MIN_ITERS): New access macro to above new field.
(TARG_SCALAR_TO_VEC_COST): Define cost of scalar to vector operation.
* tree-vect-analyze.c (vect_analyze_operations): Set
LOOP_VINFO_COST_MODEL_MIN_ITERS.
* tree-vect-transform.c (vect_estimate_min_profitable_iters): Use
VEC_length to determine if there are any LOOP_VINFO_MAY_MISALIGN_STMTS.
Fix calculation of peel_iters_prologue. Move consideration of epilogue
and prologue cost to after they are computed.
(vect_model_induction_cost): Use TARG_SCALAR_TO_VEC_COST instead of
TARG_VEC_STMT_COST.
(vect_model_simple_cost): Takes additional argument dt. Consider cost
of creating vectors from scalars according to dt.
(vect_model_store_cost): Likewise.
(vectorizable_call): Use dt array instead of scalar dt. Call
vect_model_simple_cost with additional argument dt.
(vectorizable_assignment): Likewise.
(vectorizable_operation): Likewise.
(vectorizable_type_demotion): Likewise.
(vectorizable_type_promotion): Likewise.
(vectorizable_store): Use dt array instead of scalar dt. Call
vect_model_store_cost with additional argument dt.
(vect_do_peeling_for_loop_bound): Don't call
vect_estimate_min_profitable_iters. Instead, lookup
LOOP_VINFO_COST_MODEL_MIN_ITERS. Don't always print
"may not be profitable".
* gcc.dg/vect/costmodel/ppc: New directory.
* gcc.dg/vect/costmodel/ppc/ppc-costmodel-vect.exp: New.
* gcc.dg/vect/costmodel/ppc/costmodel-fast-math-vect-pr29925.c: New test.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-31a.c: New test.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-31b.c: New test.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-31c.c: New test.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-31d.c: New test.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-33.c: New test.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-76a.c: New test.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c: New test.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-76c.c: New test.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-68a.c: New test.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-68b.c: New test.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-68c.c: New test.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-68d.c: New test.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-reduc-1char.c: New test.
* gcc.dg/vect/costmodel/i386/costmodel-vect-68.c: Now vectorized.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126368 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r-- | gcc/tree-vectorizer.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 25299944e4f..e5957ca4a3d 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -99,6 +99,13 @@ typedef struct _loop_vec_info { /* Number of iterations. */ tree num_iters; + /* Minimum number of iterations below which vectorization is expected to + not be profitable (as estimated by the cost model). + -1 indicates that vectorization will not be profitable. + FORNOW: This field is an int. Will be a tree in the future, to represent + values unknown at compile time. */ + int min_profitable_iters; + /* Is the loop vectorizable? */ bool vectorizable; @@ -140,6 +147,7 @@ typedef struct _loop_vec_info { #define LOOP_VINFO_BBS(L) (L)->bbs #define LOOP_VINFO_EXIT_COND(L) (L)->exit_cond #define LOOP_VINFO_NITERS(L) (L)->num_iters +#define LOOP_VINFO_COST_MODEL_MIN_ITERS(L) (L)->min_profitable_iters #define LOOP_VINFO_VECTORIZABLE_P(L) (L)->vectorizable #define LOOP_VINFO_VECT_FACTOR(L) (L)->vectorization_factor #define LOOP_VINFO_PTR_MASK(L) (L)->ptr_mask @@ -329,6 +337,11 @@ typedef struct _stmt_vec_info { #define TARG_VEC_TO_SCALAR_COST 1 #endif +/* Cost of scalar to vector operation. */ +#ifndef TARG_SCALAR_TO_VEC_COST +#define TARG_SCALAR_TO_VEC_COST 1 +#endif + /* Cost of aligned vector load. */ #ifndef TARG_VEC_LOAD_COST #define TARG_VEC_LOAD_COST 1 |