Make more use of df_read_modify_subreg_p
authorRichard Sandiford <richard.sandiford@linaro.org>
Thu, 26 Oct 2017 16:12:09 +0000 (16:12 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Thu, 26 Oct 2017 16:12:09 +0000 (16:12 +0000)
commit9eaf97d6d7f1511638fb9209b7acf30e8f26a060
tree16674acba1f8fe4ba22347b1846ccdecf4c4d541
parent7984457f8295811880c37e7861aa7c0454ce9845
Make more use of df_read_modify_subreg_p

This patch uses df_read_modify_subreg_p to check whether writing
to a subreg would preserve some of the existing contents.

This has the effect of putting more emphasis on the
REGMODE_NATURAL_SIZE-based definition of whether something can be
partially modified, instead of using UNITS_PER_WORD unconditionally.
This becomes important for SVE, where UNITS_PER_WORD has no
significance for subregs of multi-register LD2/ST2, LD3/ST3 and
LD4/ST4 tuples.

2017-10-26  Richard Sandiford  <richard.sandiford@linaro.org>
    Alan Hayward  <alan.hayward@arm.com>
    David Sherwood  <david.sherwood@arm.com>

gcc/
* caller-save.c (mark_referenced_regs):  Use read_modify_subreg_p.
* combine.c (find_single_use_1): Likewise.
(expand_field_assignment): Likewise.
(move_deaths): Likewise.
* lra-constraints.c (simplify_operand_subreg): Likewise.
(curr_insn_transform): Likewise.
* lra.c (collect_non_operand_hard_regs): Likewise.
(add_regs_to_insn_regno_info): Likewise.
* rtlanal.c (reg_referenced_p): Likewise.
(covers_regno_no_parallel_p): Likewise.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r254110
gcc/ChangeLog
gcc/caller-save.c
gcc/combine.c
gcc/lra-constraints.c
gcc/lra.c
gcc/rtlanal.c