summaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.c
diff options
context:
space:
mode:
authorhjagasia <hjagasia@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-08 16:30:49 +0000
committerhjagasia <hjagasia@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-08 16:30:49 +0000
commit867c03eb9cc3badac4834c0e6cab7b849db1f573 (patch)
treeb261d3382cad73cc9bf2627a1ef52c49c881835e /gcc/tree-vectorizer.c
parent2d0ff363215b22ad82b36ffc5bdf65248aa727ae (diff)
downloadgcc-867c03eb9cc3badac4834c0e6cab7b849db1f573.tar.gz
gcc/ChangeLog:
2007-06-08 Harsha Jagasia <harsha.jagasia@amd.com> Tony Linthicum <tony.linthicum@amd.com> * doc/extend.texi: Add fvect-cost-model flag. * common.opt (fvect-cost-model): New flag. * tree-vectorizer.c (new_stmt_vec_info): Initialize inside and outside cost fields in stmt_vec_info struct for STMT. * tree-vectorizer.h (stmt_vec_info): Define inside and outside cost fields in stmt_vec_info struct and access functions for the same. (TARG_COND_BRANCH_COST): Define cost of conditional branch. (TARG_VEC_STMT_COST): Define cost of any vector operation, excluding load, store and vector to scalar operation. (TARG_VEC_TO_SCALAR_COST): Define cost of vector to scalar operation. (TARG_VEC_LOAD_COST): Define cost of aligned vector load. (TARG_VEC_UNALIGNED_LOAD_COST): Define cost of misasligned vector load. (TARG_VEC_STORE_COST): Define cost of vector store. (vect_estimate_min_profitable_iters): Define new function. * tree-vect-analyze.c (vect_analyze_operations): Add a compile-time check to evaluate if loop iterations are less than minimum profitable iterations determined by cost model or minimum vect loop bound defined by user, whichever is more conservative. * tree-vect-transform.c (vect_do_peeling_for_loop_bound): Add a run-time check to evaluate if loop iterations are less than minimum profitable iterations determined by cost model or minimum vect loop bound defined by user, whichever is more conservative. (vect_estimate_min_profitable_iterations): New function to estimate mimimimum iterartions required for vector version of loop to be profitable over scalar version. (vect_model_reduction_cost): New function. (vect_model_induction_cost): New function. (vect_model_simple_cost): New function. (vect_cost_strided_group_size): New function. (vect_model_store_cost): New function. (vect_model_load_cost): New function. (vectorizable_reduction): Call vect_model_reduction_cost during analysis phase. (vectorizable_induction): Call vect_model_induction_cost during analysis phase. (vectorizable_load): Call vect_model_load_cost during analysis phase. (vectorizable_store): Call vect_model_store_cost during analysis phase. (vectorizable_call, vectorizable_assignment, vectorizable_operation, vectorizable_promotion, vectorizable_demotion): Call vect_model_simple_cost during analysis phase. gcc/testsuite/ChangeLog: 2007-06-08 Harsha Jagasia <harsha.jagasia@amd.com> * gcc.dg/vect/costmodel: New directory. * gcc.dg/vect/costmodel/i386: New directory. * gcc.dg/vect/costmodel/i386/i386-costmodel-vect.exp: New testsuite. * gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c: New test. * gcc.dg/vect/costmodel/i386/costmodel-vect-31.c: New test. * gcc.dg/vect/costmodel/i386/costmodel-vect-33.c: New test. * gcc.dg/vect/costmodel/i386/costmodel-vect-68.c: New test. * gcc.dg/vect/costmodel/i386/costmodel-vect-reduc-1char.c: New test. * gcc.dg/vect/costmodel/x86_64: New directory. * gcc.dg/vect/costmodel/x86_64/x86_64-costmodel-vect.exp: New testsuite. * gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c: New test. * gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c: New test. * gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c: New test. * gcc.dg/vect/costmodel/x86_64/costmodel-vect-68.c: New test. * gcc.dg/vect/costmodel/x86_64/costmodel-vect-reduc-1char.c: New test. * gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125575 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vectorizer.c')
-rw-r--r--gcc/tree-vectorizer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index 8dba4d03cf9..baf699d23f0 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -1351,6 +1351,8 @@ new_stmt_vec_info (tree stmt, loop_vec_info loop_vinfo)
else
STMT_VINFO_DEF_TYPE (res) = vect_loop_def;
STMT_VINFO_SAME_ALIGN_REFS (res) = VEC_alloc (dr_p, heap, 5);
+ STMT_VINFO_INSIDE_OF_LOOP_COST (res) = 0;
+ STMT_VINFO_OUTSIDE_OF_LOOP_COST (res) = 0;
DR_GROUP_FIRST_DR (res) = NULL_TREE;
DR_GROUP_NEXT_DR (res) = NULL_TREE;
DR_GROUP_SIZE (res) = 0;