[autovect] [patch] Strided same constant store

Dorit Nuzman DORIT@il.ibm.com
Tue Jan 16 09:11:00 GMT 2007


>
> Despite strided stores in the following loop, there is no need in
> permutation of the stored values:
>
> for i
>    a[2i] = 0
>    a[2i+1] = 0
>
> This patch detects such stores (strided stores that store the same
> constant) and avoids unnecessary interleaving.
> It's a first step towards loop-aware interleaving based SLP I am going to
> implement.
>
> Bootstrapped and tested on ppc-linux.
> Committed to autovect branch.
>

Ira, thanks for the patch.

A few comments:

First, there's no documentation in the code at all... do you mind adding a
few words?


> *************** vect_analyze_data_ref_access (struct dat
> *** 1847,1852 ****
> --- 1858,1870 ----
>       return false;
>     }
>         DR_GROUP_SIZE (vinfo_for_stmt (stmt)) = stride;
> +
> +       if (!DR_IS_READ (dr) && rhs_equal)
> +         {
> +     DR_GROUP_NOT_INTERLEAVING (vinfo_for_stmt (stmt)) = true;
> +           if (vect_print_dump_info (REPORT_DR_DETAILS))

Something not quite right with the indentation...


> *************** vectorizable_store (tree stmt, block_stm
> *** 2712,2718 ****
>     if (DR_GROUP_FIRST_DR (stmt_info))
>       {
>         strided_store = true;
> !       if (!vect_strided_store_supported (vectype))
>     return false;
>       }
>
> --- 2712,2720 ----
>     if (DR_GROUP_FIRST_DR (stmt_info))
>       {
>         strided_store = true;
> !       if (DR_GROUP_NOT_INTERLEAVING (
> !                   vinfo_for_stmt (DR_GROUP_FIRST_DR (stmt_info)))
> !           && !vect_strided_store_supported (vectype))
>     return false;
>       }

Seems to me you'd want to fail on unsupported strided store only if
interleaving is actually needed (i.e. !DR_GROUP_NOT_INTERLEAVING) ?

(Also - is it ok by coding conventions to open the parenthesis for the
function argument without any arguments on the same line? shouldn't it go
on the next line along with the arguments?)

dorit


> Ira
>
> ChangeLog entry:
>
>         * tree-vectorizer.c (new_stmt_vec_info): Initialize the new
field.
>         * tree-vectorizer.h (struct _stmt_vec_info): Add new field
>         interleaving_not_needed and macros to access it.
>         * tree-vect-analyze.c (vect_analyze_data_ref_access): Detect
>         interleaved stores with equal constant right hand sides and mark
> that
>         there is no need to do interleaving for them.
>         * tree-vect-transform.c (vectorizable_store): Do not interleave
if
>         there is no need in interleaving.
>
> The patch:
> (See attached file: jan16.txt)[attachment "jan16.txt" deleted by
> Dorit Nuzman/Haifa/IBM]



More information about the Gcc-patches mailing list