The auto-vectorizer is overly aggressive when not constrained by the vectorizer cost model. Although the cost model is by no means perfect, it does a reasonable job of avoiding many poor vectorization decisions. Since the auto-vectorizer is enabled by default at -O3 and above, we should also enable the vectorizer cost model by default at -O3 and above.
Bootstrapped and tested on powerpc64-unknown-linux-gnu with no new regressions. Ok for trunk? Thanks, Bill 2012-07-15 Bill Schmidt <wschm...@linux.ibm.com> * opts.c (default_option): Add -fvect-cost-model to default options at -O3 and above. Index: gcc/opts.c =================================================================== --- gcc/opts.c (revision 189481) +++ gcc/opts.c (working copy) @@ -501,6 +501,7 @@ static const struct default_options default_option { OPT_LEVELS_3_PLUS, OPT_funswitch_loops, NULL, 1 }, { OPT_LEVELS_3_PLUS, OPT_fgcse_after_reload, NULL, 1 }, { OPT_LEVELS_3_PLUS, OPT_ftree_vectorize, NULL, 1 }, + { OPT_LEVELS_3_PLUS, OPT_fvect_cost_model, NULL, 1 }, { OPT_LEVELS_3_PLUS, OPT_fipa_cp_clone, NULL, 1 }, { OPT_LEVELS_3_PLUS, OPT_ftree_partial_pre, NULL, 1 },