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, PR tree-optimization/68327] Compute vectype for live phi nodes when copmputing VF


On Wed, Nov 18, 2015 at 12:34 PM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
> Hi,
>
> When we compute vectypes we skip non-relevant phi nodes.  But we process non-relevant alive statements and thus may need vectype of non-relevant live phi node to compute mask vectype.  This patch enables vectype computation for live phi nodes.  Botostrapped and regtested on x86_64-unknown-linux-gnu.  OK for trunk?

Hmm.  What breaks if you instead skip all !relevant stmts and not
compute vectype for life but not relevant ones?  We won't ever
"vectorize" !relevant ones, that is, we don't need their vector type.

Richard.

> Thanks,
> Ilya
> --
> gcc/
>
> 2015-11-18  Ilya Enkovich  <enkovich.gnu@gmail.com>
>
>         PR tree-optimization/68327
>         * tree-vect-loop.c (vect_determine_vectorization_factor): Don't
>         skip non-relevant live phi nodes.
>
> gcc/testsuite/
>
> 2015-11-18  Ilya Enkovich  <enkovich.gnu@gmail.com>
>
>         PR tree-optimization/68327
>         * gcc.dg/pr68327.c: New test.
>
>
> diff --git a/gcc/testsuite/gcc.dg/pr68327.c b/gcc/testsuite/gcc.dg/pr68327.c
> new file mode 100644
> index 0000000..c3e6a94
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/pr68327.c
> @@ -0,0 +1,15 @@
> +/* { dg-do compile } */
> +/* { dg-options "-O3" } */
> +
> +int a, d;
> +char b, c;
> +
> +void
> +fn1 ()
> +{
> +  int i = 0;
> +  for (; i < 1; i++)
> +    d = 1;
> +  for (; b; b++)
> +    a = 1 && (d & b);
> +}
> diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
> index 80937ec..7dba027 100644
> --- a/gcc/tree-vect-loop.c
> +++ b/gcc/tree-vect-loop.c
> @@ -216,7 +216,8 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
>
>           gcc_assert (stmt_info);
>
> -         if (STMT_VINFO_RELEVANT_P (stmt_info))
> +         if (STMT_VINFO_RELEVANT_P (stmt_info)
> +             || STMT_VINFO_LIVE_P (stmt_info))
>              {
>               gcc_assert (!STMT_VINFO_VECTYPE (stmt_info));
>                scalar_type = TREE_TYPE (PHI_RESULT (phi));


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