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 4/4] Allow loop prefetch code to speculatively prefetch non constant steps


Hi,

> This patch changes the prefetch code to accept non-constant step sizes
> for memory references in loops. If the step size is a constant integer
> the patch should not change the current behaviour. 
> 
> This patch uses a heuristic to speculatively activate prefetching for
> non-constant steps by prefetching "ahead" iterations in advance.
> 
> This patch improves some testcases where the old prefetch code did not
> improve the performance (e.g. mcf).

OK, modulo coding style fixes:

>         * tree-ssa-loop-prefetch.c (dump_mem_ref): Adopt debug code to 
>         handle a tree as step. this also checks for a constant int vs.
>         non-constant but loop-invariant steps.

capital T in "this".

> !   if (cst_and_fits_in_hwi(ref->group->step))
> !     fprintf (file, HOST_WIDE_INT_PRINT_DEC, int_cst_value(ref->group->step));

Missing space before (.  Repeats many times throughout the patch.

> !   else
> !     fprintf (file, "is non-constant but loop-invariant");

It might be useful to dump the step in this case, anyway.

>     if (!analyze_ref (loop, &ref, &base, &step, &delta, stmt))
>       return false;
> +   /* if analyze_ref fails the default is a NULL_TREE. we can stop here */

Capital letters at the starts of sentences.  Dot at the end.

> !   /* if the step size is non constant, we cannot calculate prefetch_mod */

Ditto.

> !           /* the step size is non-constant but loop-invariant. We use the
> !              heuristic to simply prefetch ahead iterations ahead. */

Ditto.

Zdenek


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