summaryrefslogtreecommitdiff
path: root/gcc/function-abi.cc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-09-30 16:19:59 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-09-30 16:19:59 +0000
commit6ee2cc70024253d2670a4a317158b2a65251a1d1 (patch)
tree7ceef0efbbe69d1fadfdd5ab9b202832d6239868 /gcc/function-abi.cc
parent2a2e3a0dfcbe0861915f421d11b828f0c35023f0 (diff)
Pass an ABI identifier to hard_regno_call_part_clobbered
This patch replaces the rtx_insn argument to targetm.hard_regno_call_part_clobbered with an ABI identifier, since call insns are now just one possible way of getting an ABI handle. This in turn allows predefined_function_abi::initialize to do the right thing for non-default ABIs. The horrible ?: in need_for_call_save_p goes away in a later patch, with the series as a whole removing most direct calls to the hook in favour of function_abi operations. 2019-09-30 Richard Sandiford <richard.sandiford@arm.com> gcc/ * target.def (hard_regno_call_part_clobbered): Take an ABI identifier instead of an rtx_insn. * doc/tm.texi: Regenerate. * hooks.h (hook_bool_insn_uint_mode_false): Delete. (hook_bool_uint_uint_mode_false): New function. * hooks.c (hook_bool_insn_uint_mode_false): Delete. (hook_bool_uint_uint_mode_false): New function. * config/aarch64/aarch64.c (aarch64_hard_regno_call_part_clobbered): Take an ABI identifier instead of an rtx_insn. * config/avr/avr.c (avr_hard_regno_call_part_clobbered): Likewise. * config/i386/i386.c (ix86_hard_regno_call_part_clobbered): Likewise. * config/mips/mips.c (mips_hard_regno_call_part_clobbered): Likewise. * config/pru/pru.c (pru_hard_regno_call_part_clobbered): Likewise. * config/rs6000/rs6000.c (rs6000_hard_regno_call_part_clobbered): Likewise. * config/s390/s390.c (s390_hard_regno_call_part_clobbered): Likewise. * cselib.c: Include function-abi.h. (cselib_process_insn): Update call to targetm.hard_regno_call_part_clobbered, using insn_callee_abi to get the appropriate ABI identifier. * function-abi.cc (predefined_function_abi::initialize): Update call to targetm.hard_regno_call_part_clobbered. * ira-conflicts.c (ira_build_conflicts): Likewise. * ira-costs.c (ira_tune_allocno_costs): Likewise. * lra-constraints.c: Include function-abi.h. (need_for_call_save_p): Update call to targetm.hard_regno_call_part_clobbered, using insn_callee_abi to get the appropriate ABI identifier. * lra-lives.c (check_pseudos_live_through_calls): Likewise. * regcprop.c (copyprop_hardreg_forward_1): Update call to targetm.hard_regno_call_part_clobbered. * reginfo.c (choose_hard_reg_mode): Likewise. * regrename.c (check_new_reg_p): Likewise. * reload.c (find_equiv_reg): Likewise. * reload1.c (emit_reload_insns): Likewise. * sched-deps.c: Include function-abi.h. (deps_analyze_insn): Update call to targetm.hard_regno_call_part_clobbered, using insn_callee_abi to get the appropriate ABI identifier. * sel-sched.c (init_regs_for_mode, mark_unavailable_hard_regs): Update call to targetm.hard_regno_call_part_clobbered. * targhooks.c (default_dwarf_frame_reg_mode): Likewise. From-SVN: r276311
Diffstat (limited to 'gcc/function-abi.cc')
-rw-r--r--gcc/function-abi.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/function-abi.cc b/gcc/function-abi.cc
index e2c35b6a274..1d1ac9a2589 100644
--- a/gcc/function-abi.cc
+++ b/gcc/function-abi.cc
@@ -50,7 +50,7 @@ predefined_function_abi::initialize (unsigned int id,
If the ABI specifies that part of a hard register R is call-clobbered,
we should be able to find a single-register mode M for which
- targetm.hard_regno_call_part_clobbered (NULL, R, M) is true.
+ targetm.hard_regno_call_part_clobbered (m_id, R, M) is true.
In other words, it shouldn't be the case that R can hold all
single-register modes across a call, but can't hold part of
a multi-register mode.
@@ -66,7 +66,7 @@ predefined_function_abi::initialize (unsigned int id,
for (unsigned int regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno)
if (targetm.hard_regno_mode_ok (regno, mode)
&& hard_regno_nregs (regno, mode) == 1
- && targetm.hard_regno_call_part_clobbered (NULL, regno, mode))
+ && targetm.hard_regno_call_part_clobbered (m_id, regno, mode))
SET_HARD_REG_BIT (m_full_and_partial_reg_clobbers, regno);
}
@@ -89,7 +89,7 @@ predefined_function_abi::initialize (unsigned int id,
for (unsigned int regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno)
if (targetm.hard_regno_mode_ok (regno, mode)
&& !overlaps_hard_reg_set_p (m_full_reg_clobbers, mode, regno)
- && !targetm.hard_regno_call_part_clobbered (NULL, regno, mode))
+ && !targetm.hard_regno_call_part_clobbered (m_id, regno, mode))
remove_from_hard_reg_set (&m_mode_clobbers[i], mode, regno);
}
@@ -104,7 +104,7 @@ predefined_function_abi::initialize (unsigned int id,
for (unsigned int regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno)
if (targetm.hard_regno_mode_ok (regno, mode)
&& !overlaps_hard_reg_set_p (m_full_reg_clobbers, mode, regno)
- && targetm.hard_regno_call_part_clobbered (NULL, regno, mode))
+ && targetm.hard_regno_call_part_clobbered (m_id, regno, mode))
gcc_assert (overlaps_hard_reg_set_p (all_clobbers, mode, regno)
&& overlaps_hard_reg_set_p (m_mode_clobbers[i],
mode, regno));