diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2018-01-13 18:00:59 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-01-13 18:00:59 +0000 |
commit | 9005477f2552a411974c12299f627f80473e17d9 (patch) | |
tree | 923ea4cad9f4eac45c16ec2f88e594968f305011 /gcc/doc | |
parent | 5cce817119cd31d18fbfc1c8245519d86b5e9480 (diff) | |
download | gcc-9005477f2552a411974c12299f627f80473e17d9.zip gcc-9005477f2552a411974c12299f627f80473e17d9.tar.gz gcc-9005477f2552a411974c12299f627f80473e17d9.tar.bz2 |
Rework the legitimize_address_displacement hook
This patch:
- tweaks the handling of legitimize_address_displacement
so that it gets called before rather than after the address has
been expanded. This means that we're no longer at the mercy
of LRA being able to interpret the expanded instructions.
- passes the original offset to legitimize_address_displacement.
- adds SVE support to the AArch64 implementation of
legitimize_address_displacement.
2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
gcc/
* target.def (legitimize_address_displacement): Take the original
offset as a poly_int.
* targhooks.h (default_legitimize_address_displacement): Update
accordingly.
* targhooks.c (default_legitimize_address_displacement): Likewise.
* doc/tm.texi: Regenerate.
* lra-constraints.c (base_plus_disp_to_reg): Take the displacement
as an argument, moving assert of ad->disp == ad->disp_term to...
(process_address_1): ...here. Update calls to base_plus_disp_to_reg.
Try calling targetm.legitimize_address_displacement before expanding
the address rather than afterwards, and adjust for the new interface.
* config/aarch64/aarch64.c (aarch64_legitimize_address_displacement):
Match the new hook interface. Handle SVE addresses.
* config/sh/sh.c (sh_legitimize_address_displacement): Make the
new hook interface.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r256637
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/tm.texi | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 491f9c4..7f02b0d 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -2894,13 +2894,16 @@ machines with non orthogonal register usage for addressing, such as SH, this hook can be used to avoid excessive spilling. @end deftypefn -@deftypefn {Target Hook} bool TARGET_LEGITIMIZE_ADDRESS_DISPLACEMENT (rtx *@var{disp}, rtx *@var{offset}, machine_mode @var{mode}) -A target hook which returns @code{true} if *@var{disp} is -legitimezed to valid address displacement with subtracting *@var{offset} -at memory mode @var{mode}. -The default version of this target hook returns @code{false}. -This hook will benefit machines with limited base plus displacement -addressing. +@deftypefn {Target Hook} bool TARGET_LEGITIMIZE_ADDRESS_DISPLACEMENT (rtx *@var{offset1}, rtx *@var{offset2}, poly_int64 @var{orig_offset}, machine_mode @var{mode}) +This hook tries to split address offset @var{orig_offset} into +two parts: one that should be added to the base address to create +a local anchor point, and an additional offset that can be applied +to the anchor to address a value of mode @var{mode}. The idea is that +the local anchor could be shared by other accesses to nearby locations. + +The hook returns true if it succeeds, storing the offset of the +anchor from the base in @var{offset1} and the offset of the final address +from the anchor in @var{offset2}. The default implementation returns false. @end deftypefn @deftypefn {Target Hook} reg_class_t TARGET_SPILL_CLASS (reg_class_t, @var{machine_mode}) |