On Wed, Sep 25, 2019 at 12:06 PM Martin Liška <mli...@suse.cz> wrote:
>
> Hi.
>
> Similarly to SLP pass, we should probably set TODO_update_ssa
> when a SLP BB vectorization happens from the normal vect pass.
>
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>
> Ready to be installed?

Hmm, this was supposed to be handled by

  if (num_vectorized_loops > 0)
    {
      /* If we vectorized any loop only virtual SSA form needs to be updated.
         ???  Also while we try hard to update loop-closed SSA form we fail
         to properly do this in some corner-cases (see PR56286).  */
      rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa_only_virtuals);
      return TODO_cleanup_cfg;
    }

but there isn't an equivalent of num_vectorized_bbs here.  Given the above
effectively short-cuts your patch (all paths only ever set ret =
TODO_cleanup_cfg
right now...) it will work without pessimizing things by running
update-ssa twice.

Can you check whether TODO_update_ssa_only_virtuals is enough as a fix?

Otherwise OK.

Thanks,
Richard.

> Thanks,
> Martin
>
> gcc/ChangeLog:
>
> 2019-09-25  Martin Liska  <mli...@suse.cz>
>
>         PR tree-optimization/91885
>         * tree-vectorizer.c (try_vectorize_loop_1):
>         Add TODO_update_ssa similarly to what slp
>         pass does.
>
> gcc/testsuite/ChangeLog:
>
> 2019-09-25  Martin Liska  <mli...@suse.cz>
>
>         PR tree-optimization/91885
>         * gcc.dg/pr91885.c: New test.
> ---
>  gcc/testsuite/gcc.dg/pr91885.c | 47 ++++++++++++++++++++++++++++++++++
>  gcc/tree-vectorizer.c          |  2 +-
>  2 files changed, 48 insertions(+), 1 deletion(-)
>  create mode 100644 gcc/testsuite/gcc.dg/pr91885.c
>
>

Reply via email to