Go to file
Matthew Malcomson c272bbda1a [Patch] [arm] Fix 88714, Arm LDRD/STRD peepholes.
These peepholes match a pair of SImode loads or stores that can be
implemented with a single LDRD or STRD instruction.
When compiling for TARGET_ARM, these peepholes originally created a set
pattern in DI mode to be caught by movdi patterns.

This approach failed to take into account the possibility that the two
matched insns operated on memory with different aliasing information.
The peepholes lost the aliasing information on one of the insns, which
could then cause the scheduler to make an invalid transformation.

This patch changes the peepholes so they generate a PARALLEL expression
of the two relevant loads or stores, which means the aliasing
information of both is kept.  Such a PARALLEL pattern is what the
peepholes currently produce for TARGET_THUMB2.

In order to match these new insn patterns, we add two new define_insn's.  These
define_insn's use the same checks as the peepholes to find valid insns.

Note that the patterns now created by the peepholes for LDRD and STRD
are very similar to those created by the peepholes for LDM and STM.
Many patterns could be matched by the LDM and STM define_insns, which
means we rely on the order the define_insn patterns are defined in the
machine description, with those for LDRD/STRD defined before those for
LDM/STM.

The difference between the peepholes for LDRD/STRD and those for LDM/STM
are mainly that those for LDRD/STRD have some logic to ensure that the
two registers are consecutive and the first one is even.

Bootstrapped and regtested on arm-none-linux-gnu.
Demonstrated fix of bug 88714 by bootstrapping on armv7l.


gcc/ChangeLog:

2019-02-07  Matthew Malcomson  <matthew.malcomson@arm.com>
	    Jakub Jelinek  <jakub@redhat.com>

	PR bootstrap/88714
	* config/arm/arm-protos.h (valid_operands_ldrd_strd,
	arm_count_ldrdstrd_insns): New declarations.
	* config/arm/arm.c (mem_ok_for_ldrd_strd): Remove broken handling of
	MINUS.
	(valid_operands_ldrd_strd): New function.
	(arm_count_ldrdstrd_insns): New function.
	* config/arm/ldrdstrd.md: Change peepholes to generate PARALLEL SImode
	sets instead of single DImode set and define new insns to match this.

gcc/testsuite/ChangeLog:

2019-02-07  Matthew Malcomson  <matthew.malcomson@arm.com>
	    Jakub Jelinek  <jakub@redhat.com>

	PR bootstrap/88714
	* gcc.c-torture/execute/pr88714.c: New test.
	* gcc.dg/rtl/arm/ldrd-peepholes.c: New test.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r268644
2019-02-07 14:54:15 +00:00
config
contrib contrib/dg-extract-results: Handle timeout warnings 2019-02-04 09:55:00 +01:00
fixincludes
gcc [Patch] [arm] Fix 88714, Arm LDRD/STRD peepholes. 2019-02-07 14:54:15 +00:00
gnattools
gotools Makefile.in: Really regenerate. 2019-01-28 23:14:19 +01:00
include
INSTALL
intl
libada
libatomic
libbacktrace [libbacktrace] Fix .gnu_debugaltlink build-id check 2019-01-31 12:17:32 +00:00
libcc1
libcpp * eo.po: Update. 2019-02-06 21:02:28 +00:00
libdecnumber
libffi
libgcc t-linux: Add -mfp-rounding-mode=d to HOST_LIBGCC2_CFLAGS. 2019-01-31 21:49:02 +01:00
libgfortran * libgfortran/ChangeLog: Better commit message for my last commit. 2019-01-31 23:59:36 +01:00
libgo os, syscall: Hurd fixes for a couple of tests 2019-02-07 05:02:26 +00:00
libgomp re PR c++/88988 (ICE: Segmentation fault (in lookup_name_real_1)) 2019-01-31 00:28:53 +01:00
libhsail-rt
libiberty
libitm
libobjc
liboffloadmic
libphobos libphobos: Merge phobos and druntime with upstream. 2019-01-26 13:41:26 +00:00
libquadmath
libsanitizer
libssp
libstdc++-v3 PR libstdc++/89102 fix common_type<> and common_type<T> specializations 2019-02-06 17:25:26 +00:00
libvtv
lto-plugin
maintainer-scripts
zlib
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ar-lib
ChangeLog Add myself to MAINTAINERS 2019-01-26 20:12:45 +00:00
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 Add myself to MAINTAINERS 2019-01-26 20:12:45 +00: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.