[patch] Make prefetching parameters controlable with --param

Roger Sayle roger@eyesopen.com
Fri Nov 10 03:13:00 GMT 2006


Hi Zdenek,

On Thu, 9 Nov 2006, Zdenek Dvorak wrote:
>
> 	* params.c (set_param_value): Initialize the "set" field.
> 	* params.h (struct param_info): Add "set" field.
> 	(PARAM_SET_P): New macro.
> 	(PREFETCH_LATENCY, SIMULTANEOUS_PREFETCHES, L1_CACHE_SIZE,
> 	L1_CACHE_LINE_SIZE): New macros.
> 	* toplev.c (DEFPARAM): Initialize the "set" field.
> 	* tree-ssa-loop-prefetch.c (PREFETCH_LATENCY,
> 	SIMULTANEOUS_PREFETCHES): Removed.
> 	(PREFETCH_BLOCK): Use L1_CACHE_LINE_SIZE.
> 	(tree_ssa_prefetch_arrays): Dump the values of the parameters.
> 	* config/sparc/sparc.c: Include params.h.
> 	(sparc_override_options): Set SIMULTANEOUS_PREFETCHES and
> 	L1_CACHE_LINE_SIZE parameters.
> 	* config/sparc/sparc.h (PREFETCH_BLOCK, SIMULTANEOUS_PREFETCHES):
> 	Removed.
> 	* config/i386/i386.h (PREFETCH_BLOCK, SIMULTANEOUS_PREFETCHES):
> 	Removed.
> 	* config/i386/i386.c: Include params.h.
> 	(k8_cost): Change default value for SIMULTANEOUS_PREFETCHES.
> 	(override_options): Set SIMULTANEOUS_PREFETCHES and
> 	L1_CACHE_LINE_SIZE parameters.
> 	* config/sh/sh.h (SIMULTANEOUS_PREFETCHES): Removed.
> 	(OPTIMIZATION_OPTIONS): Set SIMULTANEOUS_PREFETCHES and
> 	L1_CACHE_LINE_SIZE parameters.
> 	* config/ia64/ia64.c (ia64_optimization_options): Set
> 	SIMULTANEOUS_PREFETCHES and L1_CACHE_LINE_SIZE parameters.
> 	* config/ia64/ia64.h (SIMULTANEOUS_PREFETCHES, PREFETCH_BLOCK):
> 	Removed.
> 	* params.def (PARAM_PREFETCH_LATENCY, PARAM_SIMULTANEOUS_PREFETCHES,
> 	PARAM_L1_CACHE_SIZE, PARAM_L1_CACHE_LINE_SIZE): New params.


This is OK for mainline, but you'll need to update the documentation
(certainly to describe the new param command line options, but probably
also to undocument the previous target macros).


!   /* New AMD processors newer drop prefetches; if they cannot be performed
s/newer/never/

!      immediatelly, they are queued.  We set number of simultaneous prefetches
s/immediatelly/immediately/


Ok with those changes.


Presumably the new k8 value of 100 simultaneous prefetches (a significant
increase from the previous value of 6) has demonstrable advantages for
some benchmark?  You should try and split patches into the reorganization
bits and separate functionality/parameter changes, if possible.  This'll
simplify your life if someone encounters a performance problem and
requests that the problematic patch be reverted.

Roger
--



More information about the Gcc-patches mailing list