Go to file
Richard Sandiford 6e23549157 vect: Fix load costs for SLP permutes
For the following test case (compiled with load/store lanes
disabled locally):

  void
  f (uint32_t *restrict x, uint8_t *restrict y, int n)
  {
    for (int i = 0; i < n; ++i)
      {
	x[i * 2] = x[i * 2] + y[i * 2];
	x[i * 2 + 1] = x[i * 2 + 1] + y[i * 2];
      }
  }

we have a redundant no-op permute on the x[] load node:

   node 0x4472350 (max_nunits=8, refcnt=2)
          stmt 0 _5 = *_4;
          stmt 1 _13 = *_12;
          load permutation { 0 1 }

Then, when costing it, we pick a cost of 1, even though we need 4 copies
of the x[] load to match a single y[] load:

   ==> examining statement: _5 = *_4;
   Vectorizing an unaligned access.
   vect_model_load_cost: unaligned supported by hardware.
   vect_model_load_cost: inside_cost = 1, prologue_cost = 0 .

The problem is that the code only considers the permutation for
the first scalar iteration, rather than for all VF iterations.

This patch tries to fix that by making vect_transform_slp_perm_load
calculate the value instead.

gcc/
	* tree-vectorizer.h (vect_transform_slp_perm_load): Take an
	optional extra parameter.
	* tree-vect-slp.c (vect_transform_slp_perm_load): Calculate
	the number of loads as well as the number of permutes, taking
	the counting loop from...
	* tree-vect-stmts.c (vect_model_load_cost): ...here.  Use the
	value computed by vect_transform_slp_perm_load for ncopies.
2020-10-29 13:38:01 +00:00
config
contrib
fixincludes
gcc vect: Fix load costs for SLP permutes 2020-10-29 13:38:01 +00:00
gnattools
gotools libgo: handle linking to NetBSD's versioned symbols 2020-10-28 18:20:50 -07:00
include
INSTALL
intl
libada
libatomic
libbacktrace Daily bump. 2020-10-21 00:16:36 +00:00
libcc1
libcpp Daily bump. 2020-10-21 00:16:36 +00:00
libdecnumber
libffi
libgcc Fix the logic conditioning VX_ENTER/LEAVE_TLS_DTOR 2020-10-29 10:59:11 +00:00
libgfortran Daily bump. 2020-10-19 00:16:22 +00:00
libgo libgo: handle linking to NetBSD's versioned symbols 2020-10-28 18:20:50 -07:00
libgomp Daily bump. 2020-10-29 00:16:50 +00:00
libhsail-rt
libiberty
libitm
libobjc
liboffloadmic
libphobos Daily bump. 2020-10-28 00:16:38 +00:00
libquadmath
libsanitizer ASAN: Support detect_invalid_pointer_pairs=1 with detect_stack_use_after_return=1 2020-10-21 09:27:08 +02:00
libssp
libstdc++-v3 libstdc++: Correct PR number in ChangeLog entry 2020-10-29 09:28:43 -04:00
libvtv
lto-plugin
maintainer-scripts
zlib
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ar-lib
ChangeLog
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure
configure.ac
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
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.