diff options
author | davidxl <davidxl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-27 16:48:15 +0000 |
---|---|---|
committer | davidxl <davidxl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-27 16:48:15 +0000 |
commit | 1dbf9bd18f3799b4cebcaf5c6b972c68071b35fd (patch) | |
tree | f6309abb88289dcaa19aca96778e0ef0659d91a6 /gcc/opts.c | |
parent | ca2418b82b8cdd1acd55f0fe36d26719b8cfe45d (diff) | |
download | gcc-1dbf9bd18f3799b4cebcaf5c6b972c68071b35fd.tar.gz |
vectorizer cost model enhancement
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202980 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/opts.c')
-rw-r--r-- | gcc/opts.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/opts.c b/gcc/opts.c index 944834c4438..b1fadb16232 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -486,6 +486,7 @@ static const struct default_options default_options_table[] = { OPT_LEVELS_2_PLUS, OPT_falign_labels, NULL, 1 }, { OPT_LEVELS_2_PLUS, OPT_falign_functions, NULL, 1 }, { OPT_LEVELS_2_PLUS, OPT_ftree_tail_merge, NULL, 1 }, + { OPT_LEVELS_2_PLUS, OPT_fvect_cost_model_, NULL, VECT_COST_MODEL_CHEAP }, { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_foptimize_strlen, NULL, 1 }, { OPT_LEVELS_2_PLUS, OPT_fhoist_adjacent_loads, NULL, 1 }, @@ -500,7 +501,7 @@ static const struct default_options default_options_table[] = { OPT_LEVELS_3_PLUS, OPT_fgcse_after_reload, NULL, 1 }, { OPT_LEVELS_3_PLUS, OPT_ftree_loop_vectorize, NULL, 1 }, { OPT_LEVELS_3_PLUS, OPT_ftree_slp_vectorize, NULL, 1 }, - { OPT_LEVELS_3_PLUS, OPT_fvect_cost_model, NULL, 1 }, + { OPT_LEVELS_3_PLUS, OPT_fvect_cost_model_, NULL, VECT_COST_MODEL_DYNAMIC }, { OPT_LEVELS_3_PLUS, OPT_fipa_cp_clone, NULL, 1 }, { OPT_LEVELS_3_PLUS, OPT_ftree_partial_pre, NULL, 1 }, @@ -825,6 +826,17 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, } } + /* Tune vectorization related parametees according to cost model. */ + if (opts->x_flag_vect_cost_model == VECT_COST_MODEL_CHEAP) + { + maybe_set_param_value (PARAM_VECT_MAX_VERSION_FOR_ALIAS_CHECKS, + 6, opts->x_param_values, opts_set->x_param_values); + maybe_set_param_value (PARAM_VECT_MAX_VERSION_FOR_ALIGNMENT_CHECKS, + 0, opts->x_param_values, opts_set->x_param_values); + maybe_set_param_value (PARAM_VECT_MAX_PEELING_FOR_ALIGNMENT, + 0, opts->x_param_values, opts_set->x_param_values); + } + /* Set PARAM_MAX_STORES_TO_SINK to 0 if either vectorization or if-conversion is disabled. */ if ((!opts->x_flag_tree_loop_vectorize && !opts->x_flag_tree_slp_vectorize) @@ -1669,7 +1681,7 @@ common_handle_option (struct gcc_options *opts, && !opts_set->x_flag_tree_vectorize) opts->x_flag_tree_slp_vectorize = value; if (!opts_set->x_flag_vect_cost_model) - opts->x_flag_vect_cost_model = value; + opts->x_flag_vect_cost_model = VECT_COST_MODEL_DYNAMIC; if (!opts_set->x_flag_tree_loop_distribute_patterns) opts->x_flag_tree_loop_distribute_patterns = value; /* Indirect call profiling should do all useful transformations |