This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to Avoid Bad Prefetching
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- Cc: "Shobaki, Ghassan" <Ghassan dot Shobaki at amd dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 3 Jun 2009 16:19:39 +0200
- Subject: Re: Patch to Avoid Bad Prefetching
- References: <D60441ACF713E84E9952ADA42F2E08B716728E@ssvlexmb2.amd.com> <D60441ACF713E84E9952ADA42F2E08B70149981A@ssvlexmb2.amd.com> <20090416010249.GB21250@kam.mff.cuni.cz> <D60441ACF713E84E9952ADA42F2E08B70149988B@ssvlexmb2.amd.com> <20090416052522.GB3021@kam.mff.cuni.cz> <D60441ACF713E84E9952ADA42F2E08B701499986@ssvlexmb2.amd.com> <20090416172534.GB19702@kam.mff.cuni.cz> <84fc9c000904240451g28482e85mcd202d894f29b3f@mail.gmail.com> <912DA18E911D8B418824641EF1541F3C417E84@ssvlexmb2.amd.com> <20090603125414.GA16367@kam.mff.cuni.cz>
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.