Go to file
Richard Sandiford 5cce817119 Add an "early rematerialisation" pass
This patch looks for pseudo registers that are live across a call
and for which no call-preserved hard registers exist.  It then
recomputes the pseudos as necessary to ensure that they are no
longer live across a call.  The comment at the head of the file
describes the approach.

A new target hook selects which modes should be treated in this way.
By default none are, in which case the pass is skipped very early.

It might also be worth looking for cases like:

   C1: R1 := f (...)
   ...
   C2: R2 := f (...)
   C3: R1 := C2

and giving the same value number to C1 and C3, effectively treating
it like:

   C1: R1 := f (...)
   ...
   C2: R2 := f (...)
   C3: R1 := f (...)

Another (much more expensive) enhancement would be to apply value
numbering to all pseudo registers (not just rematerialisation
candidates), so that we can handle things like:

  C1: R1 := f (...R2...)
  ...
  C2: R1 := f (...R3...)

where R2 and R3 hold the same value.  But the current pass seems
to catch the vast majority of cases.

2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	* Makefile.in (OBJS): Add early-remat.o.
	* target.def (select_early_remat_modes): New hook.
	* doc/tm.texi.in (TARGET_SELECT_EARLY_REMAT_MODES): New hook.
	* doc/tm.texi: Regenerate.
	* targhooks.h (default_select_early_remat_modes): Declare.
	* targhooks.c (default_select_early_remat_modes): New function.
	* timevar.def (TV_EARLY_REMAT): New timevar.
	* passes.def (pass_early_remat): New pass.
	* tree-pass.h (make_pass_early_remat): Declare.
	* early-remat.c: New file.
	* config/aarch64/aarch64.c (aarch64_select_early_remat_modes): New
	function.
	(TARGET_SELECT_EARLY_REMAT_MODES): Define.

gcc/testsuite/
	* gcc.target/aarch64/sve/spill_1.c: Also test that no predicates
	are spilled.
	* gcc.target/aarch64/sve/spill_2.c: New test.
	* gcc.target/aarch64/sve/spill_3.c: Likewise.
	* gcc.target/aarch64/sve/spill_4.c: Likewise.
	* gcc.target/aarch64/sve/spill_5.c: Likewise.
	* gcc.target/aarch64/sve/spill_6.c: Likewise.
	* gcc.target/aarch64/sve/spill_7.c: Likewise.

From-SVN: r256636
2018-01-13 18:00:51 +00:00
config Plugin support on Windows/MinGW 2017-11-26 13:00:48 +00:00
contrib * update-copyright.py: Skip pdt-5.f03 in gfortran.dg subdir. 2018-01-03 11:00:43 +01:00
fixincludes
gcc Add an "early rematerialisation" pass 2018-01-13 18:00:51 +00:00
gnattools Update copyright years. 2018-01-03 11:03:58 +01:00
gotools libgo: update to Go1.10beta1 2018-01-09 01:23:08 +00:00
include Update copyright years. 2018-01-03 11:03:58 +01:00
INSTALL
intl
libada Update copyright years. 2018-01-03 11:03:58 +01:00
libatomic Update copyright years. 2018-01-03 11:03:58 +01:00
libbacktrace Update copyright years. 2018-01-03 11:03:58 +01:00
libcc1 Update copyright years. 2018-01-03 11:03:58 +01:00
libcpp Update copyright years. 2018-01-03 11:03:58 +01:00
libdecnumber Update copyright years. 2018-01-03 11:03:58 +01:00
libffi
libgcc SVE unwinding 2018-01-13 17:56:52 +00:00
libgfortran PR 78534 Regression on 32-bit targets 2018-01-08 14:12:05 +02:00
libgo re PR go/83794 (misc/cgo/test uses gigabytes of memory) 2018-01-11 19:58:55 +00:00
libgomp Update copyright years. 2018-01-03 11:03:58 +01:00
libhsail-rt Update copyright years. 2018-01-03 11:03:58 +01:00
libiberty re PR lto/81968 (early lto debug objects make Solaris ld SEGV) 2018-01-11 12:12:39 +00:00
libitm Update copyright years. 2018-01-03 11:03:58 +01:00
libmpx Enable building libmpx with Intel CET 2017-11-17 23:41:10 +01:00
libobjc Update copyright years. 2018-01-03 11:03:58 +01:00
liboffloadmic Update copyright years. 2018-01-03 11:03:58 +01:00
libquadmath Update copyright years. 2018-01-03 11:03:58 +01:00
libsanitizer invoke.texi: Document the options. 2017-12-05 10:23:25 +01:00
libssp Update copyright years. 2018-01-03 11:03:58 +01:00
libstdc++-v3 Link with correct values-*.o files on Solaris (PR target/40411) 2018-01-12 09:52:53 +00:00
libvtv Update copyright years. 2018-01-03 11:03:58 +01:00
lto-plugin Update copyright years. 2018-01-03 11:03:58 +01:00
maintainer-scripts
zlib
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ChangeLog Update copyright years. 2018-01-03 11:03:58 +01:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess config.guess: Import latest version. 2018-01-03 15:25:18 +11:00
config.rpath
config.sub config.guess: Import latest version. 2018-01-03 15:25:18 +11:00
configure configure.ac: Remove logic adding gdb to noconfigsdirs for or1k. 2017-12-12 14:23:05 +00:00
configure.ac configure.ac: Remove logic adding gdb to noconfigsdirs for or1k. 2017-12-12 14:23:05 +00: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 Updated email in MAINTAINERS file. 2017-12-12 17:40:24 +00:00
Makefile.def Remove Cilk Plus support. 2017-11-28 11:35:37 +01:00
Makefile.in Remove Cilk Plus support. 2017-11-28 11:35:37 +01:00
Makefile.tpl
missing
mkdep
mkinstalldirs
move-if-change
README
symlink-tree
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.