From: Jan Hubicka Date: Sun, 4 Nov 2012 15:51:18 +0000 (+0100) Subject: invoke.texi (profile-use): update documentation. X-Git-Tag: releases/gcc-4.8.0~2297 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f56f2d332c6f78342a8f52ab426c38806d772017;p=thirdparty%2Fgcc.git invoke.texi (profile-use): update documentation. * invoke.texi (profile-use): update documentation. * opts.c (common_handle_option): Enable tree-vectorize and tree-loop-distribute-patterns. * tree-loop-distribution.c (tree_loop_distribution): Skip loops optimized for size. * config/i386/i386.c (ix86_option_override_internal): Enabe prefetch_lop_arrays for profile-use. From-SVN: r193135 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b2b4394f20bd..6367ac578de0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2012-11-03 Jan Hubicka + + * invoke.texi (profile-use): update documentation. + * opts.c (common_handle_option): Enable tree-vectorize + and tree-loop-distribute-patterns. + * tree-loop-distribution.c (tree_loop_distribution): Skip loops + optimized for size. + * config/i386/i386.c (ix86_option_override_internal): Enabe + prefetch_lop_arrays for profile-use. + 2012-11-03 Robert Mason * gcov-io.c (gcov_open): Add file mode to open call (need for VxWorks) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index fae300e4ce18..833ef5ca57da 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3950,7 +3950,7 @@ ix86_option_override_internal (bool main_args_p) /* Enable sw prefetching at -O3 for CPUS that prefetching is helpful. */ if (flag_prefetch_loop_arrays < 0 && HAVE_prefetch - && optimize >= 3 + && (optimize >= 3 || flag_profile_use) && TARGET_SOFTWARE_PREFETCHING_BENEFICIAL) flag_prefetch_loop_arrays = 1; diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index ff0c87dc6c4f..1338e6e461cf 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -8409,7 +8409,8 @@ Enable profile feedback directed optimizations, and optimizations generally profitable only with profile feedback available. The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt}, -@code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer} +@code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}, @code{-ftree-vectorize}, +@code{ftree-loop-distribute-patterns} By default, GCC emits an error message if the feedback profiles do not match the source code. This error can be turned into a warning by using diff --git a/gcc/opts.c b/gcc/opts.c index a1cf2d5bae60..3160b8cc521e 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -1587,6 +1587,12 @@ common_handle_option (struct gcc_options *opts, opts->x_flag_unswitch_loops = value; if (!opts_set->x_flag_gcse_after_reload) opts->x_flag_gcse_after_reload = value; + if (!opts_set->x_flag_tree_vectorize) + opts->x_flag_tree_vectorize = value; + if (!opts_set->x_flag_vect_cost_model) + opts->x_flag_vect_cost_model = value; + if (!opts_set->x_flag_tree_loop_distribute_patterns) + opts->x_flag_tree_loop_distribute_patterns = value; break; case OPT_fprofile_generate_: diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c index 10bd29e3d5f7..0ade107bd594 100644 --- a/gcc/tree-loop-distribution.c +++ b/gcc/tree-loop-distribution.c @@ -1511,6 +1511,10 @@ tree_loop_distribution (void) if (!single_exit (loop)) continue; + /* Only optimize hot loops. */ + if (!optimize_loop_for_speed_p (loop)) + continue; + /* Only distribute loops with a header and latch for now. */ if (loop->num_nodes > 2) continue;