]> git.ipfire.org Git - thirdparty/gcc.git/commit
Support constants and externals in BB reduction vectorization
authorRichard Biener <rguenther@suse.de>
Tue, 15 Aug 2023 11:05:32 +0000 (13:05 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 15 Aug 2023 12:08:35 +0000 (14:08 +0200)
commitf049868d8db773da4be61d82025e97453d6e9f2b
tree184b74d4a8b187ad4211abcda12b63cdeb0bfbde
parent8a6097c7425c4b6294e11dea062df7a883343f47
Support constants and externals in BB reduction vectorization

The following supports vectorizing BB reductions involving a
constant or an invariant.

* tree-vectorizer.h (_slp_instance::remain_stmts): Change
to ...
(_slp_instance::remain_defs): ... this.
(SLP_INSTANCE_REMAIN_STMTS): Rename to ...
(SLP_INSTANCE_REMAIN_DEFS): ... this.
(slp_root::remain): New.
(slp_root::slp_root): Adjust.
* tree-vect-slp.cc (vect_free_slp_instance): Adjust.
(vect_build_slp_instance): Get extra remain parameter,
adjust former handling of a cut off stmt.
(vect_analyze_slp_instance): Adjust.
(vect_analyze_slp): Likewise.
(_bb_vec_info::~_bb_vec_info): Likewise.
(vectorizable_bb_reduc_epilogue): Dump something if we fail.
(vect_slp_check_for_constructors): Handle non-internal
defs as remain defs of a reduction.
(vectorize_slp_instance_root_stmt): Adjust.

* gcc.dg/vect/bb-slp-75.c: New testcase.
gcc/testsuite/gcc.dg/vect/bb-slp-75.c [new file with mode: 0644]
gcc/tree-vect-slp.cc
gcc/tree-vectorizer.h