diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-10-26 16:53:43 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-10-26 16:53:43 +0000 |
commit | bd5a2c67cfd636b6c78f213c8ee6dac62323eff9 (patch) | |
tree | 793d74fec25534f3062be8641413cfa6430d1cf0 /gcc/lra.c | |
parent | 204d2c03acff4bf3b73cb5d2c9578b50c2aac703 (diff) |
Add wider_subreg_mode helper functions
This patch adds helper functions that say which of the two modes
involved in a subreg is the larger, preferring the outer mode in
the event of a tie. It also converts IRA and reload to track modes
instead of byte sizes, since this is slightly more convenient when
variable-sized modes are added later.
2017-10-26 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
gcc/
* rtl.h (wider_subreg_mode): New function.
* ira.h (ira_sort_regnos_for_alter_reg): Take a machine_mode *
rather than an unsigned int *.
* ira-color.c (regno_max_ref_width): Replace with...
(regno_max_ref_mode): ...this new variable.
(coalesced_pseudo_reg_slot_compare): Update accordingly.
Use wider_subreg_mode.
(ira_sort_regnos_for_alter_reg): Likewise. Take a machine_mode *
rather than an unsigned int *.
* lra-constraints.c (uses_hard_regs_p): Use wider_subreg_mode.
(process_alt_operands): Likewise.
(invariant_p): Likewise.
* lra-spills.c (assign_mem_slot): Likewise.
(add_pseudo_to_slot): Likewise.
* lra.c (collect_non_operand_hard_regs): Likewise.
(add_regs_to_insn_regno_info): Likewise.
* reload1.c (regno_max_ref_width): Replace with...
(regno_max_ref_mode): ...this new variable.
(reload): Update accordingly. Update call to
ira_sort_regnos_for_alter_reg.
(alter_reg): Update to use regno_max_ref_mode. Call wider_subreg_mode.
(init_eliminable_invariants): Update to use regno_max_ref_mode.
(scan_paradoxical_subregs): Likewise.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r254115
Diffstat (limited to 'gcc/lra.c')
-rw-r--r-- | gcc/lra.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/lra.c b/gcc/lra.c index 04acf884f1c..66fbfd5477b 100644 --- a/gcc/lra.c +++ b/gcc/lra.c @@ -832,12 +832,11 @@ collect_non_operand_hard_regs (rtx *x, lra_insn_recog_data_t data, subreg_p = false; if (code == SUBREG) { + mode = wider_subreg_mode (op); 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 (REG_P (op)) { @@ -1425,12 +1424,11 @@ add_regs_to_insn_regno_info (lra_insn_recog_data_t data, rtx x, int uid, subreg_p = false; if (GET_CODE (x) == SUBREG) { + mode = wider_subreg_mode (x); 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 (REG_P (x)) { |