Patch to Avoid Bad Prefetching
Richard Guenther
richard.guenther@gmail.com
Wed Jun 3 14:27:00 GMT 2009
On Wed, Jun 3, 2009 at 2:54 PM, Zdenek Dvorak <rakdver@kam.mff.cuni.cz> wrote:
> Hi,
>
> could you please test the patch on the stream benchmark? It exhibits
> several opportunities for prefetching/movnt instructions that we would
> not like to miss, and I somewhat suspect that the first heuristic could
> cause us to. The patch is OK assuming the results are fine. It would
> be nice to improve the heuristics later, especially the first one looks
> a bit too imprecise to me.
>
>> + if(insn_to_prefetch_ratio < MIN_INSN_TO_PREFETCH_RATIO)
>> + return false;
>> + return true;
>
> space after if; or better, return insn_to_prefetch_ratio >= MIN_INSN_TO_PREFETCH_RATIO;
>
>> Index: params.def
>> ===================================================================
>> --- params.def (revision 145634)
>> +++ params.def (working copy)
>> @@ -761,6 +761,17 @@ DEFPARAM (PARAM_LOOP_INVARIANT_MAX_BBS_I
>> "max basic blocks number in loop for loop invariant motion",
>> 10000, 0, 0)
>>
>> +DEFPARAM (PARAM_MIN_INSN_TO_PREFETCH_RATIO,
>> + "min-insn-to-prefetch-ratio",
>> + "min. ratio of insns to prefetches to enable prefetching for "
>> + "a loop with an unknown trip count",
>> + 10, 0, 0)
>> +
>> +DEFPARAM (PARAM_PREFETCH_MIN_INSN_TO_MEM_RATIO,
>> + "prefetch-min-insn-to-mem-ratio",
>> + "min. ratio of insns to mem ops to enable prefetching in a loop",
>> + 4, 0, 0)
>> +
>
> You also need to document the params in doc/invoke.texi.
Indeed. The patch also needs to pass bootstrap & regtest on the
current trunk.
Thanks,
Richard.
More information about the Gcc-patches
mailing list