tree-optimization/106226 - move vectorizer virtual SSA update
authorRichard Biener <rguenther@suse.de>
Fri, 8 Jul 2022 08:41:59 +0000 (10:41 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 8 Jul 2022 11:05:19 +0000 (13:05 +0200)
commitcf3a120084e94614a4917f71940325cd4b537f24
tree469de3ec96aea9727c14a22ec94cb0a295693680
parent95a234f5cbd510e6b8c8e53dd9f1003fddc84c28
tree-optimization/106226 - move vectorizer virtual SSA update

When we knowingly have broken virtual SSA form we need to update
it before we eventually perform slpeel manual updating which will
call delete_update_ssa.  Currently that's done on-demand but
communicating whether it's a known unavoidable case is broken
there.  The following makes that a synchronous operation but
instead of actually performing the update we instead recod the
need, clear the update SSA sub-state and force virtual renaming
at the very end of the vectorization pass.

PR tree-optimization/106226
* tree-vect-loop-manip.cc (vect_do_peeling): Assert that
no SSA update is needed.  Move virtual SSA update ...
* tree-vectorizer.cc (pass_vectorize::execute): ... here,
via forced virtual renaming when TODO_update_ssa_only_virtuals
is queued.
(vect_transform_loops): Return TODO_update_ssa_only_virtuals
when virtual SSA update is required.
(try_vectorize_loop_1): Adjust.
* tree-vect-stmts.cc (vectorizable_simd_clone_call): Allow
virtual renaming if the ABI forces an aggregate return
but the original call did not have a virtual definition.

* gfortran.dg/pr106226.f: New testcase.
gcc/testsuite/gfortran.dg/pr106226.f [new file with mode: 0644]
gcc/tree-vect-loop-manip.cc
gcc/tree-vect-stmts.cc
gcc/tree-vectorizer.cc