diff options
author | Vladimir Makarov <vmakarov@redhat.com> | 2009-01-29 14:51:46 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@gcc.gnu.org> | 2009-01-29 14:51:46 +0000 |
commit | 2af2dbdc6816c47aa6bc96976a4416fde370ea55 (patch) | |
tree | 902a133df01742f3e4254602b265d61345318fc0 /gcc/reload1.c | |
parent | 00b251a0371e71bce271656eb7d069851cbd7fcf (diff) | |
download | gcc-2af2dbdc6816c47aa6bc96976a4416fde370ea55.zip gcc-2af2dbdc6816c47aa6bc96976a4416fde370ea55.tar.gz gcc-2af2dbdc6816c47aa6bc96976a4416fde370ea55.tar.bz2 |
tm.texi (TARGET_IRA_COVER_CLASSES): Modify description.
2008-01-29 Vladimir Makarov <vmakarov@redhat.com>
* doc/tm.texi (TARGET_IRA_COVER_CLASSES): Modify description.
* doc/passes.texi: Remove entries about regclass, local-alloc, and
global. Modify entries about regmove and IRA.
* ra-conflict.c: Remove the file.
* reload.c (push_reload, find_dummy_reload): Remove flag_ira.
* tree-pass.h (pass_local_alloc, pass_global_alloc): Remove.
(pass_regclass_init): Rename to pass_reginfo_init.
* cfgloopanal.c (estimate_reg_pressure_cost): Remove flag_ira.
* toplev.h (flag_ira): Remove.
* caller-save.c (setup_save_areas): Remove flag_ira.
* ira-color.c (ira_reuse_stack_slot, ira_mark_new_stack_slot):
Ditto.
* global.c: Remove the file.
* opts.c: (decode_options): Remove flag_ira.
* hard-reg-set.h (losing_caller_save_reg_set): Remove.
* regmove.c: Modify file description.
(find_use_as_address, try_auto_increment): Define them only if
AUTO_INC_DEC is defined.
(replacement_quality, replace_in_call_usage, fixup_match_1,
stable_and_no_regs_but_for_p): Remove.
(reg_set_in_bb): Make it static.
(regmove_optimize): Remove flag_ira and code which worked for
!flag_ira.
* local-alloc.c: Remove the file.
* common.opt (fira): Remove.
* ira.c: Include except.h.
(eliminable_regset): Move from global.c.
(mark_elimination): Ditto. Remove flag_ira.
(reg_renumber, struct equivalence, reg_equiv, equiv_mem,
equiv_mem_modified, validate_equiv_mem_from_store,
validate_equiv_mem, equiv_init_varies_p, equiv_init_movable_p,
contains_replace_regs, memref_referenced_p, memref_used_between_p,
no_equiv, recorded_label_ref): Move from local-alloc.c.
(update_equiv_regs): Ditto. Make it static.
(print_insn_chain, print_insn_chains): Move it from global.c.
pseudo_for_reload_consideration_p): Ditto. Remove flag_ira.
(build_insn_chain): Ditto. Make it static.
(ra_init_live_subregs): Move from ra-conflict.c. Make it static.
Rename to init_live_subregs.
(gate_ira): Remove flag_ira.
* regclass.c: Rename reginfo.c. Change file description.
(FORBIDDEN_INC_DEC_CLASSES): Remove.
(reg_class_superclasses, forbidden_inc_dec_class, in_inc_dec):
Remove.
(init_reg_sets_1): Remove code for evaluation of
reg_class_superclasses and losing_caller_save_reg_set.
(init_regs): Remove init_reg_autoinc.
(struct costs, costs, init_cost, ok_for_index_p_nonstrict,
ok_for_base_p_nonstrict): Remove.
(regclass_init): Rename to reginfo_init. Don't initialize
init_cost.
(pass_regclass_init): Rename to pass_reginfo_init. Modify
corresponding entries.
(dump_regclass, record_operand_costs, scan_one_insn,
init_reg_autoinc, regclass, record_reg_classes, copy_cost,
record_address_regs, auto_inc_dec_reg_p): Remove.
(gt-regclass.h): Rename to gt-reginfo.h.
* rtl.h (dump_global_regs, retry_global_alloc,
build_insn_chain, dump_local_alloc, update_equiv_regs):
Remove.
* Makefile.in (RA_H): Remove.
(OBJS-common): Remove global.o, local-alloc.o, and ra-conflict.o.
Rename regclass.o to reginfo.o.
(regclass.o): Rename to reginfo.o. Rename gt-regclass.h to
gt-reginfo.h.
(global.o, local-alloc.o, ra-conflict.o): Remove entries.
(GTFILES): Rename regclass.c to reginfo.c.
* passes.c (init_optimization_passes): Remove pass_local_alloc and
pass_global_alloc. Rename pass_regclass_init to
pass_reginfo_init.
* reload1.c (compute_use_by_pseudos, reload, count_pseudo,
count_spilled_pseudo, find_reg, alter_reg, delete_output_reload):
Remove flag_ira.
(finish_spills): Ditto. Remove code for !flga_ira.
From-SVN: r143757
Diffstat (limited to 'gcc/reload1.c')
-rw-r--r-- | gcc/reload1.c | 95 |
1 files changed, 35 insertions, 60 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c index bbffad0..e0d0f94 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -557,7 +557,7 @@ compute_use_by_pseudos (HARD_REG_SET *to, regset from) which might still contain registers that have not actually been allocated since they have an equivalence. */ - gcc_assert ((flag_ira && ira_conflicts_p) || reload_completed); + gcc_assert (ira_conflicts_p || reload_completed); } else add_to_hard_reg_set (to, PSEUDO_REGNO_MODE (regno), r); @@ -901,7 +901,7 @@ reload (rtx first, int global) for (n = 0, i = LAST_VIRTUAL_REGISTER + 1; i < max_regno; i++) temp_pseudo_reg_arr[n++] = i; - if (flag_ira && ira_conflicts_p) + if (ira_conflicts_p) /* Ask IRA to order pseudo-registers for better stack slot sharing. */ ira_sort_regnos_for_alter_reg (temp_pseudo_reg_arr, n, reg_max_ref_width); @@ -1055,7 +1055,7 @@ reload (rtx first, int global) calculate_needs_all_insns (global); - if (! flag_ira || ! ira_conflicts_p) + if (! ira_conflicts_p) /* Don't do it for IRA. We need this info because we don't change live_throughout and dead_or_set for chains when IRA is used. */ @@ -1614,7 +1614,7 @@ calculate_needs_all_insns (int global) reg_equiv_memory_loc [REGNO (SET_DEST (set))])))) { - if (flag_ira && ira_conflicts_p) + if (ira_conflicts_p) /* Inform IRA about the insn deletion. */ ira_mark_memory_move_deletion (REGNO (SET_DEST (set)), REGNO (SET_SRC (set))); @@ -1723,7 +1723,7 @@ count_pseudo (int reg) || REGNO_REG_SET_P (&spilled_pseudos, reg) /* Ignore spilled pseudo-registers which can be here only if IRA is used. */ - || (flag_ira && ira_conflicts_p && r < 0)) + || (ira_conflicts_p && r < 0)) return; SET_REGNO_REG_SET (&pseudos_counted, reg); @@ -1804,7 +1804,7 @@ count_spilled_pseudo (int spilled, int spilled_nregs, int reg) /* Ignore spilled pseudo-registers which can be here only if IRA is used. */ - if ((flag_ira && ira_conflicts_p && r < 0) + if ((ira_conflicts_p && r < 0) || REGNO_REG_SET_P (&spilled_pseudos, reg) || spilled + spilled_nregs <= r || r + nregs <= spilled) return; @@ -1876,7 +1876,7 @@ find_reg (struct insn_chain *chain, int order) if (! ok) continue; - if (flag_ira && ira_conflicts_p) + if (ira_conflicts_p) { /* Ask IRA to find a better pseudo-register for spilling. */ @@ -2158,7 +2158,7 @@ alter_reg (int i, int from_reg, bool dont_share_p) unsigned int min_align = reg_max_ref_width[i] * BITS_PER_UNIT; int adjust = 0; - if (flag_ira && ira_conflicts_p) + if (ira_conflicts_p) { /* Mark the spill for IRA. */ SET_REGNO_REG_SET (&spilled_pseudos, i); @@ -2177,8 +2177,7 @@ alter_reg (int i, int from_reg, bool dont_share_p) enough inherent space and enough total space. Otherwise, we allocate a new slot, making sure that it has no less inherent space, and no less total space, then the previous slot. */ - else if (from_reg == -1 - || (!dont_share_p && flag_ira && ira_conflicts_p)) + else if (from_reg == -1 || (!dont_share_p && ira_conflicts_p)) { rtx stack_slot; @@ -2203,7 +2202,7 @@ alter_reg (int i, int from_reg, bool dont_share_p) adjust); } - if (! dont_share_p && flag_ira && ira_conflicts_p) + if (! dont_share_p && ira_conflicts_p) /* Inform IRA about allocation a new stack slot. */ ira_mark_new_stack_slot (stack_slot, i, total_size); } @@ -3905,7 +3904,7 @@ finish_spills (int global) spill_reg_order[i] = -1; EXECUTE_IF_SET_IN_REG_SET (&spilled_pseudos, FIRST_PSEUDO_REGISTER, i, rsi) - if (! flag_ira || ! ira_conflicts_p || reg_renumber[i] >= 0) + if (! ira_conflicts_p || reg_renumber[i] >= 0) { /* Record the current hard register the pseudo is allocated to in pseudo_previous_regs so we avoid reallocating it to the @@ -3915,7 +3914,7 @@ finish_spills (int global) SET_HARD_REG_BIT (pseudo_previous_regs[i], reg_renumber[i]); /* Mark it as no longer having a hard register home. */ reg_renumber[i] = -1; - if (flag_ira && ira_conflicts_p) + if (ira_conflicts_p) /* Inform IRA about the change. */ ira_mark_allocation_change (i); /* We will need to scan everything again. */ @@ -3923,8 +3922,10 @@ finish_spills (int global) } /* Retry global register allocation if possible. */ - if (global) + if (global && ira_conflicts_p) { + unsigned int n; + memset (pseudo_forbidden_regs, 0, max_regno * sizeof (HARD_REG_SET)); /* For every insn that needs reloads, set the registers used as spill regs in pseudo_forbidden_regs for every pseudo live across the @@ -3945,49 +3946,23 @@ finish_spills (int global) } } - if (! flag_ira || ! ira_conflicts_p) - { - /* Retry allocating the spilled pseudos. For each reg, - merge the various reg sets that indicate which hard regs - can't be used, and call retry_global_alloc. We change - spill_pseudos here to only contain pseudos that did not - get a new hard register. */ - for (i = FIRST_PSEUDO_REGISTER; i < (unsigned)max_regno; i++) - if (reg_old_renumber[i] != reg_renumber[i]) - { - HARD_REG_SET forbidden; - - COPY_HARD_REG_SET (forbidden, bad_spill_regs_global); - IOR_HARD_REG_SET (forbidden, pseudo_forbidden_regs[i]); - IOR_HARD_REG_SET (forbidden, pseudo_previous_regs[i]); - retry_global_alloc (i, forbidden); - if (reg_renumber[i] >= 0) - CLEAR_REGNO_REG_SET (&spilled_pseudos, i); - } - } - else - { - /* Retry allocating the pseudos spilled in IRA and the - reload. For each reg, merge the various reg sets that - indicate which hard regs can't be used, and call - ira_reassign_pseudos. */ - unsigned int n; - - for (n = 0, i = FIRST_PSEUDO_REGISTER; i < (unsigned) max_regno; i++) - if (reg_old_renumber[i] != reg_renumber[i]) - { - if (reg_renumber[i] < 0) - temp_pseudo_reg_arr[n++] = i; - else - CLEAR_REGNO_REG_SET (&spilled_pseudos, i); - } - if (ira_reassign_pseudos (temp_pseudo_reg_arr, n, - bad_spill_regs_global, - pseudo_forbidden_regs, pseudo_previous_regs, - &spilled_pseudos)) - something_changed = 1; - - } + /* Retry allocating the pseudos spilled in IRA and the + reload. For each reg, merge the various reg sets that + indicate which hard regs can't be used, and call + ira_reassign_pseudos. */ + for (n = 0, i = FIRST_PSEUDO_REGISTER; i < (unsigned) max_regno; i++) + if (reg_old_renumber[i] != reg_renumber[i]) + { + if (reg_renumber[i] < 0) + temp_pseudo_reg_arr[n++] = i; + else + CLEAR_REGNO_REG_SET (&spilled_pseudos, i); + } + if (ira_reassign_pseudos (temp_pseudo_reg_arr, n, + bad_spill_regs_global, + pseudo_forbidden_regs, pseudo_previous_regs, + &spilled_pseudos)) + something_changed = 1; } /* Fix up the register information in the insn chain. This involves deleting those of the spilled pseudos which did not get @@ -3997,7 +3972,7 @@ finish_spills (int global) HARD_REG_SET used_by_pseudos; HARD_REG_SET used_by_pseudos2; - if (! flag_ira || ! ira_conflicts_p) + if (! ira_conflicts_p) { /* Don't do it for IRA because IRA and the reload still can assign hard registers to the spilled pseudos on next @@ -7000,7 +6975,7 @@ emit_input_reload_insns (struct insn_chain *chain, struct reload *rl, && REG_N_SETS (REGNO (old)) == 1) { reg_renumber[REGNO (old)] = REGNO (reloadreg); - if (flag_ira && ira_conflicts_p) + if (ira_conflicts_p) /* Inform IRA about the change. */ ira_mark_allocation_change (REGNO (old)); alter_reg (REGNO (old), -1, false); @@ -8541,7 +8516,7 @@ delete_output_reload (rtx insn, int j, int last_reload_reg, rtx new_reload_reg) /* For the debugging info, say the pseudo lives in this reload reg. */ reg_renumber[REGNO (reg)] = REGNO (new_reload_reg); - if (flag_ira && ira_conflicts_p) + if (ira_conflicts_p) /* Inform IRA about the change. */ ira_mark_allocation_change (REGNO (reg)); alter_reg (REGNO (reg), -1, false); |