diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-10-26 16:12:09 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-10-26 16:12:09 +0000 |
commit | 9eaf97d6d7f1511638fb9209b7acf30e8f26a060 (patch) | |
tree | 16674acba1f8fe4ba22347b1846ccdecf4c4d541 /gcc/lra.c | |
parent | 7984457f8295811880c37e7861aa7c0454ce9845 (diff) | |
download | gcc-9eaf97d6d7f1511638fb9209b7acf30e8f26a060.zip gcc-9eaf97d6d7f1511638fb9209b7acf30e8f26a060.tar.gz gcc-9eaf97d6d7f1511638fb9209b7acf30e8f26a060.tar.bz2 |
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
Diffstat (limited to 'gcc/lra.c')
-rw-r--r-- | gcc/lra.c | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -832,14 +832,12 @@ collect_non_operand_hard_regs (rtx *x, lra_insn_recog_data_t data, subreg_p = false; if (code == SUBREG) { + if (read_modify_subreg_p (op)) + subreg_p = true; op = SUBREG_REG (op); code = GET_CODE (op); if (GET_MODE_SIZE (mode) < GET_MODE_SIZE (GET_MODE (op))) - { - mode = GET_MODE (op); - if (GET_MODE_SIZE (mode) > REGMODE_NATURAL_SIZE (mode)) - subreg_p = true; - } + mode = GET_MODE (op); } if (REG_P (op)) { @@ -1427,14 +1425,12 @@ add_regs_to_insn_regno_info (lra_insn_recog_data_t data, rtx x, int uid, subreg_p = false; if (GET_CODE (x) == SUBREG) { + if (read_modify_subreg_p (x)) + subreg_p = true; x = SUBREG_REG (x); code = GET_CODE (x); if (GET_MODE_SIZE (mode) < GET_MODE_SIZE (GET_MODE (x))) - { - mode = GET_MODE (x); - if (GET_MODE_SIZE (mode) > REGMODE_NATURAL_SIZE (mode)) - subreg_p = true; - } + mode = GET_MODE (x); } if (REG_P (x)) { |