This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Improve prefetch heuristics


Hi,

> You are right.  It looks prune_ref_by_self_reuse has already adjusted the prefetch distance
> through prefetch_mod. The reason I observed the short prefetch distance may due to the induction variable
> "ap" in the issue_prefetch_ref logic:
> 
>    for (ap = 0; ap < n_prefetches; ap++)    /* <---------------------------- */
>      {
>        /* Determine the address to prefetch.  */
>        delta = (ahead + ap * ref->prefetch_mod) * ref->group->step;
> 
> When ap equals 0, the prune_self_reuse adjustment is essentially ignored.  Applying the following patch
> can resolve the short prefetch distance problem:
> 
>  -  for (ap = 0; ap < n_prefetches; ap++)
>  + for (ap = 1; ap <= n_prefetches; ap++) 
>    {
>        /* Determine the address to prefetch.  */
>        delta = (ahead + ap * ref->prefetch_mod) * ref->group->step;

I think there is some missunderstanding.  The statement "When ap equals 0, the prune_self_reuse adjustment
is essentially ignored." does not make sense to me.  Also, the change you propose only increases the prefetch
distance by a constant offset.

Zdenek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]