diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2019-09-10 18:56:37 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2019-09-10 18:56:37 +0000 |
commit | a5647ae846f6765f12a359acba6a71fc12254fa8 (patch) | |
tree | 3ca1e4fc718b6a7523af1797005c2a814c34f8d5 /gcc/ira-conflicts.c | |
parent | 026116ce2a4dedad81518b0ca89dd8243b545778 (diff) |
Replace call_used_reg_set with call_used_or_fixed_regs
CALL_USED_REGISTERS and call_used_regs infamously contain all fixed
registers (hence the need for CALL_REALLY_USED_REGISTERS etc.).
We try to recover from this to some extent with:
/* Contains 1 for registers that are set or clobbered by calls. */
/* ??? Ideally, this would be just call_used_regs plus global_regs, but
for someone's bright idea to have call_used_regs strictly include
fixed_regs. Which leaves us guessing as to the set of fixed_regs
that are actually preserved. We know for sure that those associated
with the local stack frame are safe, but scant others. */
HARD_REG_SET x_regs_invalidated_by_call;
Since global registers are added to fixed_reg_set and call_used_reg_set
too, it's always the case that:
call_used_reg_set == regs_invalidated_by_call | fixed_reg_set
This patch replaces all uses of call_used_reg_set with a new macro
call_used_or_fixed_regs to make this clearer.
This is part of a series that allows call_used_regs to be what is
now call_really_used_regs. It's a purely mechanical replacement;
later patches clean up obvious oddities like
"call_used_or_fixed_regs & ~fixed_regs".
2019-09-10 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* hard-reg-set.h (target_hard_regs::x_call_used_reg_set): Delete.
(call_used_reg_set): Delete.
(call_used_or_fixed_regs): New macro.
* reginfo.c (init_reg_sets_1, globalize_reg): Remove initialization
of call_used_reg_set.
* caller-save.c (setup_save_areas): Use call_used_or_fixed_regs
instead of call_used_regs.
(save_call_clobbered_regs): Likewise.
* cfgcleanup.c (old_insns_match_p): Likewise.
* config/c6x/c6x.c (c6x_call_saved_register_used): Likewise.
* config/epiphany/epiphany.c (epiphany_conditional_register_usage):
Likewise.
* config/frv/frv.c (frv_ifcvt_modify_tests): Likewise.
* config/sh/sh.c (output_stack_adjust): Likewise.
* final.c (collect_fn_hard_reg_usage): Likewise.
* ira-build.c (ira_build): Likewise.
* ira-color.c (calculate_saved_nregs): Likewise.
(allocno_reload_assign, calculate_spill_cost): Likewise.
* ira-conflicts.c (ira_build_conflicts): Likewise.
* ira-costs.c (ira_tune_allocno_costs): Likewise.
* ira-lives.c (process_bb_node_lives): Likewise.
* ira.c (setup_reg_renumber): Likewise.
* lra-assigns.c (find_hard_regno_for_1, lra_assign): Likewise.
* lra-constraints.c (need_for_call_save_p): Likewise.
(need_for_split_p, inherit_in_ebb): Likewise.
* lra-lives.c (process_bb_lives): Likewise.
* lra-remat.c (call_used_input_regno_present_p): Likewise.
* postreload.c (reload_combine): Likewise.
* regrename.c (find_rename_reg): Likewise.
* reload1.c (reload_as_needed): Likewise.
* rtlanal.c (find_all_hard_reg_sets): Likewise.
* sel-sched.c (mark_unavailable_hard_regs): Likewise.
* shrink-wrap.c (requires_stack_frame_p): Likewise.
From-SVN: r275600
Diffstat (limited to 'gcc/ira-conflicts.c')
-rw-r--r-- | gcc/ira-conflicts.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/ira-conflicts.c b/gcc/ira-conflicts.c index 430c6a6f079..afbc2ec0d52 100644 --- a/gcc/ira-conflicts.c +++ b/gcc/ira-conflicts.c @@ -740,7 +740,7 @@ ira_build_conflicts (void) else temp_hard_reg_set = (reg_class_contents[base] & ~ira_no_alloc_regs - & call_used_reg_set); + & call_used_or_fixed_regs); FOR_EACH_ALLOCNO (a, ai) { int i, n = ALLOCNO_NUM_OBJECTS (a); @@ -760,13 +760,13 @@ ira_build_conflicts (void) && REG_USERVAR_P (allocno_reg) && ! reg_is_parm_p (allocno_reg))) { - OBJECT_TOTAL_CONFLICT_HARD_REGS (obj) |= call_used_reg_set; - OBJECT_CONFLICT_HARD_REGS (obj) |= call_used_reg_set; + OBJECT_TOTAL_CONFLICT_HARD_REGS (obj) |= call_used_or_fixed_regs; + OBJECT_CONFLICT_HARD_REGS (obj) |= call_used_or_fixed_regs; } else if (ALLOCNO_CALLS_CROSSED_NUM (a) != 0) { HARD_REG_SET no_caller_save_reg_set - = (call_used_reg_set & ~savable_regs); + = (call_used_or_fixed_regs & ~savable_regs); OBJECT_TOTAL_CONFLICT_HARD_REGS (obj) |= no_caller_save_reg_set; OBJECT_TOTAL_CONFLICT_HARD_REGS (obj) |= temp_hard_reg_set; OBJECT_CONFLICT_HARD_REGS (obj) |= no_caller_save_reg_set; @@ -805,7 +805,7 @@ ira_build_conflicts (void) /* Allocnos bigger than the saved part of call saved regs must conflict with them. */ for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) - if (!TEST_HARD_REG_BIT (call_used_reg_set, regno) + if (!TEST_HARD_REG_BIT (call_used_or_fixed_regs, regno) && targetm.hard_regno_call_part_clobbered (NULL, regno, obj_mode)) { |