diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2019-09-30 16:19:59 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2019-09-30 16:19:59 +0000 |
commit | 6ee2cc70024253d2670a4a317158b2a65251a1d1 (patch) | |
tree | 7ceef0efbbe69d1fadfdd5ab9b202832d6239868 /gcc/config | |
parent | 2a2e3a0dfcbe0861915f421d11b828f0c35023f0 (diff) | |
download | gcc-6ee2cc70024253d2670a4a317158b2a65251a1d1.zip gcc-6ee2cc70024253d2670a4a317158b2a65251a1d1.tar.gz gcc-6ee2cc70024253d2670a4a317158b2a65251a1d1.tar.bz2 |
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/config')
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 5 | ||||
-rw-r--r-- | gcc/config/avr/avr.c | 4 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 4 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 4 | ||||
-rw-r--r-- | gcc/config/pru/pru.c | 4 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 4 | ||||
-rw-r--r-- | gcc/config/s390/s390.c | 4 |
7 files changed, 15 insertions, 14 deletions
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 71cdce3..ca4c183 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -1910,12 +1910,13 @@ aarch64_insn_callee_abi (const rtx_insn *insn) clobbers the top 64 bits when restoring the bottom 64 bits. */ static bool -aarch64_hard_regno_call_part_clobbered (rtx_insn *insn, unsigned int regno, +aarch64_hard_regno_call_part_clobbered (unsigned int abi_id, + unsigned int regno, machine_mode mode) { if (FP_REGNUM_P (regno)) { - bool simd_p = insn && CALL_P (insn) && aarch64_simd_call_p (insn); + bool simd_p = (abi_id == ARM_PCS_SIMD); poly_int64 per_register_size = GET_MODE_SIZE (mode); unsigned int nregs = hard_regno_nregs (regno, mode); if (nregs > 1) diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 04fc00f..3ccff8e 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -12164,8 +12164,8 @@ avr_hard_regno_mode_ok (unsigned int regno, machine_mode mode) /* Implement TARGET_HARD_REGNO_CALL_PART_CLOBBERED. */ static bool -avr_hard_regno_call_part_clobbered (rtx_insn *insn ATTRIBUTE_UNUSED, - unsigned regno, machine_mode mode) +avr_hard_regno_call_part_clobbered (unsigned, unsigned regno, + machine_mode mode) { /* FIXME: This hook gets called with MODE:REGNO combinations that don't represent valid hard registers like, e.g. HI:29. Returning TRUE diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index a13aef8..8af4bc5 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -18794,8 +18794,8 @@ ix86_hard_regno_mode_ok (unsigned int regno, machine_mode mode) the low 16 bytes are saved. */ static bool -ix86_hard_regno_call_part_clobbered (rtx_insn *insn ATTRIBUTE_UNUSED, - unsigned int regno, machine_mode mode) +ix86_hard_regno_call_part_clobbered (unsigned int, unsigned int regno, + machine_mode mode) { return SSE_REGNO_P (regno) && GET_MODE_SIZE (mode) > 16; } diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index c682ebd..91dd94b 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -12928,8 +12928,8 @@ mips_hard_regno_scratch_ok (unsigned int regno) registers with MODE > 64 bits are part clobbered too. */ static bool -mips_hard_regno_call_part_clobbered (rtx_insn *insn ATTRIBUTE_UNUSED, - unsigned int regno, machine_mode mode) +mips_hard_regno_call_part_clobbered (unsigned int, unsigned int regno, + machine_mode mode) { if (TARGET_FLOATXX && hard_regno_nregs (regno, mode) == 1 diff --git a/gcc/config/pru/pru.c b/gcc/config/pru/pru.c index 416399e..16d1451 100644 --- a/gcc/config/pru/pru.c +++ b/gcc/config/pru/pru.c @@ -559,8 +559,8 @@ pru_hard_regno_scratch_ok (unsigned int regno) /* Implement TARGET_HARD_REGNO_CALL_PART_CLOBBERED. */ static bool -pru_hard_regno_call_part_clobbered (rtx_insn *insn ATTRIBUTE_UNUSED, - unsigned regno, machine_mode mode) +pru_hard_regno_call_part_clobbered (unsigned, unsigned regno, + machine_mode mode) { HARD_REG_SET caller_saved_set; HARD_REG_SET callee_saved_set; diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index d6e1fea..330e249 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -1946,8 +1946,8 @@ rs6000_modes_tieable_p (machine_mode mode1, machine_mode mode2) /* Implement TARGET_HARD_REGNO_CALL_PART_CLOBBERED. */ static bool -rs6000_hard_regno_call_part_clobbered (rtx_insn *insn ATTRIBUTE_UNUSED, - unsigned int regno, machine_mode mode) +rs6000_hard_regno_call_part_clobbered (unsigned int, unsigned int regno, + machine_mode mode) { if (TARGET_32BIT && TARGET_POWERPC64 diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index cfdfa4e..1764c34 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -10297,8 +10297,8 @@ s390_hard_regno_scratch_ok (unsigned int regno) bytes are saved across calls, however. */ static bool -s390_hard_regno_call_part_clobbered (rtx_insn *insn ATTRIBUTE_UNUSED, - unsigned int regno, machine_mode mode) +s390_hard_regno_call_part_clobbered (unsigned int, unsigned int regno, + machine_mode mode) { if (!TARGET_64BIT && TARGET_ZARCH |