diff options
author | Vladimir Makarov <vmakarov@redhat.com> | 2014-11-09 16:45:15 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@gcc.gnu.org> | 2014-11-09 16:45:15 +0000 |
commit | 8160cd3ee4a5840db17416092f2d808187b7e872 (patch) | |
tree | 1cde2f4fc77823a9e058d48a80d31252d0b0cc29 /gcc/lra-constraints.c | |
parent | 205e92689198d4718a07adfb0077821cfa93e761 (diff) | |
download | gcc-8160cd3ee4a5840db17416092f2d808187b7e872.zip gcc-8160cd3ee4a5840db17416092f2d808187b7e872.tar.gz gcc-8160cd3ee4a5840db17416092f2d808187b7e872.tar.bz2 |
re PR rtl-optimization/63620 (RELOAD lost SET_GOT dependency on Darwin)
2014-11-09 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/63620
* lra-constraints.c (substitute_pseudo): Add prefix lra_ to the
name. Move to lra.c. Make it external.
(substitute_pseudo_within_insn): Ditto.
(inherit_reload_reg, split_reg, remove_inheritance_pseudos): Use
the new names.
(undo_optional_reloads): Ditto.
* lra-int.h (lra_dump_bitmap_with_title, lra_substitute_pseudo):
New prototypes.
(lra_substitute_pseudo_within_insn): Ditto.
* lra-lives.c (bb_killed_pseudos, bb_gen_pseudos): New.
(mark_regno_live): Add parameter. Update bb_gen_pseudos.
(mark_regno_dead): Add parameter. Update bb_gen_pseudos and
bb_killed_pseudos.
(struct bb_data, bb_data_t, bb_data): New.
(get_bb_data, get_bb_data_by_index): Ditto.
(all_hard_regs_bitmap): New.
(live_trans_fun, live_con_fun_0, live_con_fun_n, all_blocks): New.
(initiate_live_solver, finish_live_solver): New.
(process_bb_lives): Change return type. Add code updating local
live data and removing dead insns. Pass new argument to
mark_regno_live and mark_regno_dead. Check changing bb pseudo
life info. Return the result.
(lra_create_live_ranges): Add code to do global pseudo live
analysis.
(lra_live_ranges_init): Call initiate_live_solver.
(lra_live_ranges_finish): Call finish_live_solver.
* lra.c (lra_dump_bitmap_with_title): New.
(lra_substitute_pseudo, lra_substitute_pseudo_within_insn): Move
from lra-constraints.c.
From-SVN: r217265
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r-- | gcc/lra-constraints.c | 71 |
1 files changed, 5 insertions, 66 deletions
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 36405d2..7353354 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -4366,67 +4366,6 @@ add_next_usage_insn (int regno, rtx insn, int reloads_num) usage_insns[regno].check = 0; } -/* Replace all references to register OLD_REGNO in *LOC with pseudo - register NEW_REG. Return true if any change was made. */ -static bool -substitute_pseudo (rtx *loc, int old_regno, rtx new_reg) -{ - rtx x = *loc; - bool result = false; - enum rtx_code code; - const char *fmt; - int i, j; - - if (x == NULL_RTX) - return false; - - code = GET_CODE (x); - if (code == REG && (int) REGNO (x) == old_regno) - { - machine_mode mode = GET_MODE (*loc); - machine_mode inner_mode = GET_MODE (new_reg); - - if (mode != inner_mode) - { - if (GET_MODE_SIZE (mode) >= GET_MODE_SIZE (inner_mode) - || ! SCALAR_INT_MODE_P (inner_mode)) - new_reg = gen_rtx_SUBREG (mode, new_reg, 0); - else - new_reg = gen_lowpart_SUBREG (mode, new_reg); - } - *loc = new_reg; - return true; - } - - /* Scan all the operand sub-expressions. */ - fmt = GET_RTX_FORMAT (code); - for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) - { - if (fmt[i] == 'e') - { - if (substitute_pseudo (&XEXP (x, i), old_regno, new_reg)) - result = true; - } - else if (fmt[i] == 'E') - { - for (j = XVECLEN (x, i) - 1; j >= 0; j--) - if (substitute_pseudo (&XVECEXP (x, i, j), old_regno, new_reg)) - result = true; - } - } - return result; -} - -/* Call substitute_pseudo within an insn. This won't update the insn ptr, - just the contents of the insn. */ - -static bool -substitute_pseudo_within_insn (rtx_insn *insn, int old_regno, rtx new_reg) -{ - rtx loc = insn; - return substitute_pseudo (&loc, old_regno, new_reg); -} - /* Return first non-debug insn in list USAGE_INSNS. */ static rtx_insn * skip_usage_debug_insns (rtx usage_insns) @@ -4588,7 +4527,7 @@ inherit_reload_reg (bool def_p, int original_regno, } return false; } - substitute_pseudo_within_insn (insn, original_regno, new_reg); + lra_substitute_pseudo_within_insn (insn, original_regno, new_reg); lra_update_insn_regno_info (insn); if (! def_p) /* We now have a new usage insn for original regno. */ @@ -4620,7 +4559,7 @@ inherit_reload_reg (bool def_p, int original_regno, lra_assert (DEBUG_INSN_P (usage_insn)); next_usage_insns = XEXP (next_usage_insns, 1); } - substitute_pseudo (&usage_insn, original_regno, new_reg); + lra_substitute_pseudo (&usage_insn, original_regno, new_reg); lra_update_insn_regno_info (as_a <rtx_insn *> (usage_insn)); if (lra_dump_file != NULL) { @@ -4884,7 +4823,7 @@ split_reg (bool before_p, int original_regno, rtx_insn *insn, usage_insn = XEXP (next_usage_insns, 0); lra_assert (DEBUG_INSN_P (usage_insn)); next_usage_insns = XEXP (next_usage_insns, 1); - substitute_pseudo (&usage_insn, original_regno, new_reg); + lra_substitute_pseudo (&usage_insn, original_regno, new_reg); lra_update_insn_regno_info (as_a <rtx_insn *> (usage_insn)); if (lra_dump_file != NULL) { @@ -5803,7 +5742,7 @@ remove_inheritance_pseudos (bitmap remove_pseudos) { if (change_p && bitmap_bit_p (remove_pseudos, regno)) { - substitute_pseudo_within_insn ( + lra_substitute_pseudo_within_insn ( curr_insn, regno, regno_reg_rtx[restore_regno]); restored_regs_p = true; } @@ -5927,7 +5866,7 @@ undo_optional_reloads (void) we remove the inheritance pseudo and the optional reload. */ } - substitute_pseudo_within_insn ( + lra_substitute_pseudo_within_insn ( insn, regno, regno_reg_rtx[lra_reg_info[regno].restore_regno]); lra_update_insn_regno_info (insn); |