Patchwork Enable array prefetching also with -fprofile-use

login
register
mail settings
Submitter Jan Hubicka
Date July 2, 2010, 1 p.m.
Message ID <20100702130012.GD6378@kam.mff.cuni.cz>
Download mbox | patch
Permalink /patch/57659/
State New
Headers show

Comments

Jan Hubicka - July 2, 2010, 1 p.m.
Hi,
with -fprofile-use the prefetching should not be risky since we have idea about
what loops are hot and what are their average number of iterations.  So I think
we ought to enable the pass as we do with -O3.

If there will not be complains, I will commit the following tonight.
bootstrapped/regtested x86_64-linux
Honza
	* config/i386/i386.c (override_options): Enable prefetching also with
	-fprofile-use.
Richard Guenther - July 2, 2010, 1:03 p.m.
On Fri, 2 Jul 2010, Jan Hubicka wrote:

> Hi,
> with -fprofile-use the prefetching should not be risky since we have idea about
> what loops are hot and what are their average number of iterations.  So I think
> we ought to enable the pass as we do with -O3.
> 
> If there will not be complains, I will commit the following tonight.
> bootstrapped/regtested x86_64-linux

Well.  We know that prefetching causes a lot of compile-time and
code-size issues which are not really acceptable with -O1 or -O2
(nor -Os - with -Os you even get funny diagnostics).

So, please restrict this to !optimize_size at least and make sure
that we do not suffer from code-size or compile-time explosion
(for example by checking 465.tonto).

Richard.

> Honza
> 	* config/i386/i386.c (override_options): Enable prefetching also with
> 	-fprofile-use.
> Index: config/i386/i386.c
> ===================================================================
> --- config/i386/i386.c	(revision 161690)
> +++ config/i386/i386.c	(working copy)
> @@ -3558,7 +3558,7 @@ override_options (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)
>        && software_prefetching_beneficial_p ())
>      flag_prefetch_loop_arrays = 1;

Patch

Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c	(revision 161690)
+++ config/i386/i386.c	(working copy)
@@ -3558,7 +3558,7 @@  override_options (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)
       && software_prefetching_beneficial_p ())
     flag_prefetch_loop_arrays = 1;