Go to file
Andrew Stubbs 49cb093be7 vect: Add target hook to prefer gather/scatter instructions
For AMD GCN, the instructions available for loading/storing vectors are
always scatter/gather operations (i.e. there are separate addresses for
each vector lane), so the current heuristic to avoid gather/scatter
operations with too many elements in get_group_load_store_type is
counterproductive. Avoiding such operations in that function can
subsequently lead to a missed vectorization opportunity whereby later
analyses in the vectorizer try to use a very wide array type which is
not available on this target, and thus it bails out.

This patch adds a target hook to override the "single_element_p"
heuristic in the function as a target hook, and activates it for GCN. This
allows much better code to be generated for affected loops.

Co-authored-by:  Julian Brown  <julian@codesourcery.com>

gcc/
	* doc/tm.texi.in (TARGET_VECTORIZE_PREFER_GATHER_SCATTER): Add
	documentation hook.
	* doc/tm.texi: Regenerate.
	* target.def (prefer_gather_scatter): Add target hook under vectorizer.
	* hooks.cc (hook_bool_mode_int_unsigned_false): New function.
	* hooks.h (hook_bool_mode_int_unsigned_false): New prototype.
	* tree-vect-stmts.cc (vect_use_strided_gather_scatters_p): Add
	parameters group_size and single_element_p, and rework to use
	targetm.vectorize.prefer_gather_scatter.
	(get_group_load_store_type): Move some of the condition into
	vect_use_strided_gather_scatters_p.
	* config/gcn/gcn.cc (gcn_prefer_gather_scatter): New function.
	(TARGET_VECTORIZE_PREFER_GATHER_SCATTER): Define hook.

(cherry picked from commit 36c5a7aa9a)
2025-08-08 14:23:07 +00:00
.forgejo top-level: Add pull request template for Forgejo 2024-10-23 19:45:09 +01:00
.github
INSTALL
c++tools Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
config Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
contrib ChangeLog.omp bump 2025-05-22 17:10:44 +02:00
fixincludes Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
gcc vect: Add target hook to prefer gather/scatter instructions 2025-08-08 14:23:07 +00:00
gnattools Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
gotools Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
include ChangeLog.omp bump 2025-06-10 21:57:52 +02:00
libada Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
libatomic Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
libbacktrace Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
libcc1 Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
libcody Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
libcpp Daily bump. 2025-05-17 00:23:30 +00:00
libdecnumber Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
libffi Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
libgcc Merge branch 'releases/gcc-15' into devel/omp/gcc-15 2025-06-02 08:11:59 +02:00
libgcobol Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
libgfortran Daily bump. 2025-06-03 00:24:38 +00:00
libgm2 Daily bump. 2025-05-14 00:25:57 +00:00
libgo libgo: bump libgo version for GCC 15 release 2025-03-04 11:43:22 -08:00
libgomp ChangeLog.omp bump 2025-07-22 11:09:27 +02:00
libgrust Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
libiberty Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
libitm Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
libobjc Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
libphobos Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
libquadmath Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
libsanitizer Daily bump. 2025-05-03 00:24:24 +00:00
libssp Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
libstdc++-v3 Daily bump. 2025-06-13 00:24:13 +00:00
libvtv Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
lto-plugin Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
maintainer-scripts Daily bump. 2025-04-26 00:25:10 +00:00
zlib Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
.b4-config
.dir-locals.el dir-locals: apply our C settings in C++ also 2024-07-31 20:38:27 +02:00
.gitattributes
.gitignore gccrs: git: Ignore libgrust build folders 2025-03-17 16:35:21 +01:00
ABOUT-NLS
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
ChangeLog Update ChangeLog and version files for release 2025-04-25 08:21:07 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
MAINTAINERS MAINTAINERS: Add myself to Write After Approval 2025-04-16 07:26:50 -06:00
Makefile.def toplevel, libcobol: Add dependency on libquadmath build [PR119244]. 2025-03-25 19:31:10 +00:00
Makefile.in toplevel, libcobol: Add dependency on libquadmath build [PR119244]. 2025-03-25 19:31:10 +00:00
Makefile.tpl toplevel, Makefile: Add missing CXX_FOR_TARGET export [PR88319]. 2025-03-23 20:44:33 +00:00
README
SECURITY.txt Remove Debian from SECURITY.txt 2024-11-19 12:27:33 +01:00
ar-lib
compile
config-ml.in Remove extra argument from subst macro 2025-03-13 07:26:04 +01:00
config.guess
config.rpath
config.sub
configure cobol: Restrict COBOL to supported Linux arches [PR119217] 2025-04-22 13:49:03 +02:00
configure.ac cobol: Restrict COBOL to supported Linux arches [PR119217] 2025-04-22 13:49:03 +02:00
depcomp
install-sh
libtool-ldflags
libtool.m4
ltgcc.m4
ltmain.sh ltmain.sh: allow more flags at link-time 2024-09-25 19:05:24 +01:00
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
symlink-tree
test-driver
ylwrap

README

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.