Go to file
Richard Biener 181702ef8a SLP vectorize multiple BBs at once
This work from Martin Liska was motivated by gcc.dg/vect/bb-slp-22.c
which shows how poorly we currently BB vectorize code like

  a0 = in[0] + 23;
  a1 = in[1] + 142;
  a2 = in[2] + 2;
  a3 = in[3] + 31;

  if (x > y)
    {
      b[0] = a0;
      b[1] = a1;
      b[2] = a2;
      b[3] = a3;
    }
  else
    {
      out[0] = a0 * (x + 1);
      out[1] = a1 * (y + 1);
      out[2] = a2 * (x + 1);
      out[3] = a3 * (y + 1);
    }

namely by vectorizing the stores but not the common load (and add)
they are feeded with.

Thus with the following patch we change the BB vectorizer from
operating on a single basic-block at a time to consider somewhat
larger regions (but not the whole function yet because of issues
with vector size iteration).

I took the opportunity to remove the fancy region iterations again
now that we operate on BB granularity and in the end need to visit
PHI nodes as well.

2020-10-08  Martin Liska  <mliska@suse.cz>
	    Richard Biener  <rguenther@suse.de>

	* tree-vectorizer.h (_bb_vec_info::const_iterator): Remove.
	(_bb_vec_info::const_reverse_iterator): Likewise.
	(_bb_vec_info::region_stmts): Likewise.
	(_bb_vec_info::reverse_region_stmts): Likewise.
	(_bb_vec_info::_bb_vec_info): Adjust.
	(_bb_vec_info::bb): Remove.
	(_bb_vec_info::region_begin): Remove.
	(_bb_vec_info::region_end): Remove.
	(_bb_vec_info::bbs): New vector of BBs.
	(vect_slp_function): Declare.
	* tree-vect-patterns.c (vect_determine_precisions): Use
	regular stmt iteration.
	(vect_pattern_recog): Likewise.
	* tree-vect-slp.c: Include cfganal.h, tree-eh.h and tree-cfg.h.
	(vect_build_slp_tree_1): Properly refuse to vectorize
	volatile and throwing stmts.
	(vect_build_slp_tree_2): Pass group-size down to
	get_vectype_for_scalar_type.
	(_bb_vec_info::_bb_vec_info): Use regular stmt iteration,
	adjust for changed region specification.
	(_bb_vec_info::~_bb_vec_info): Likewise.
	(vect_slp_check_for_constructors): Likewise.
	(vect_slp_region): Likewise.
	(vect_slp_bbs): New worker operating on a vector of BBs.
	(vect_slp_bb): Wrap it.
	(vect_slp_function): New function splitting the function
	into multi-BB regions.
	(vect_create_constant_vectors): Handle the case of inserting
	after a throwing def.
	(vect_schedule_slp_instance): Adjust.
	* tree-vectorizer.c (vec_info::remove_stmt): Simplify again.
	(vec_info::insert_seq_on_entry): Adjust.
	(pass_slp_vectorize::execute): Also init PHIs.  Call
	vect_slp_function.

	* gcc.dg/vect/bb-slp-22.c: Adjust.
	* gfortran.dg/pr68627.f: Likewise.
2020-10-08 16:07:15 +02:00
config Fixup config/ChangeLog. 2020-09-10 10:17:51 +02:00
contrib Daily bump. 2020-09-22 00:16:31 +00:00
fixincludes Daily bump. 2020-10-04 00:16:21 +00:00
gcc SLP vectorize multiple BBs at once 2020-10-08 16:07:15 +02:00
gnattools
gotools
include Daily bump. 2020-09-25 00:16:27 +00:00
INSTALL
intl
libada
libatomic Daily bump. 2020-09-28 00:16:21 +00:00
libbacktrace Daily bump. 2020-09-29 00:16:30 +00:00
libcc1 Daily bump. 2020-10-08 00:16:30 +00:00
libcpp Daily bump. 2020-09-27 00:16:24 +00:00
libdecnumber
libffi Daily bump. 2020-09-25 00:16:27 +00:00
libgcc Daily bump. 2020-10-02 00:16:27 +00:00
libgfortran Daily bump. 2020-09-29 00:16:30 +00:00
libgo libgo/configure: remove -fno-section-anchors for AIX 2020-10-07 14:08:52 -07:00
libgomp [libgomp, nvptx] Report launch dimensions in GOMP_OFFLOAD_run 2020-10-08 11:03:29 +02:00
libhsail-rt
libiberty Daily bump. 2020-10-07 00:16:35 +00:00
libitm Daily bump. 2020-10-02 00:16:27 +00:00
libobjc
liboffloadmic
libphobos Daily bump. 2020-09-11 00:16:28 +00:00
libquadmath
libsanitizer Daily bump. 2020-09-22 00:16:31 +00:00
libssp
libstdc++-v3 libstdc++: Add C++11 member functions for ios::failure in old ABI 2020-10-08 14:45:37 +01:00
libvtv
lto-plugin Daily bump. 2020-09-11 00:16:28 +00:00
maintainer-scripts
zlib
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2020-10-07 00:16:35 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure configure: Fix in-tree building of GMP on BSD [PR97302] 2020-10-06 11:49:34 +02:00
configure.ac configure: Fix in-tree building of GMP on BSD [PR97302] 2020-10-06 11:49:34 +02:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS MAINTAINERS: Add myself for write after approval. 2020-09-18 15:31:46 +01:00
Makefile.def
Makefile.in
Makefile.tpl
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
symlink-tree
test-driver
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.