aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-09-30 16:19:49 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-09-30 16:19:49 +0000
commit5a5a3bc5fa14664be26748c11325021b6b6f8e74 (patch)
tree049b62e2f4fbaa496017f9703a2f5375610da646 /gcc/doc
parent002ffd3caa684c3eb30f8f53206439b7aa34b370 (diff)
downloadgcc-5a5a3bc5fa14664be26748c11325021b6b6f8e74.zip
gcc-5a5a3bc5fa14664be26748c11325021b6b6f8e74.tar.gz
gcc-5a5a3bc5fa14664be26748c11325021b6b6f8e74.tar.bz2
Add a function for getting the ABI of a call insn target
This patch replaces get_call_reg_set_usage with insn_callee_abi, which returns the ABI of the target of a call insn. The ABI's full_reg_clobbers corresponds to regs_invalidated_by_call, whereas many callers instead passed call_used_or_fixed_regs, i.e.: (regs_invalidated_by_call | fixed_reg_set) The patch slavishly preserves the "| fixed_reg_set" for these callers; later patches will clean this up. 2019-09-30 Richard Sandiford <richard.sandiford@arm.com> gcc/ * target.def (insn_callee_abi): New hook. (remove_extra_call_preserved_regs): Delete. * doc/tm.texi.in (TARGET_INSN_CALLEE_ABI): New macro. (TARGET_REMOVE_EXTRA_CALL_PRESERVED_REGS): Delete. * doc/tm.texi: Regenerate. * targhooks.h (default_remove_extra_call_preserved_regs): Delete. * targhooks.c (default_remove_extra_call_preserved_regs): Delete. * config/aarch64/aarch64.c (aarch64_simd_call_p): Constify the insn argument. (aarch64_remove_extra_call_preserved_regs): Delete. (aarch64_insn_callee_abi): New function. (TARGET_REMOVE_EXTRA_CALL_PRESERVED_REGS): Delete. (TARGET_INSN_CALLEE_ABI): New macro. * rtl.h (get_call_fndecl): Declare. (cgraph_rtl_info): Fix formatting. Tweak comment for function_used_regs. Remove function_used_regs_valid. * rtlanal.c (get_call_fndecl): Moved from final.c * function-abi.h (insn_callee_abi): Declare. (target_function_abi_info): Mention insn_callee_abi. * function-abi.cc (fndecl_abi): Handle flag_ipa_ra in a similar way to get_call_reg_set_usage did. (insn_callee_abi): New function. * regs.h (get_call_reg_set_usage): Delete. * final.c: Include function-abi.h. (collect_fn_hard_reg_usage): Add fixed and stack registers to function_used_regs before the main loop rather than afterwards. Use insn_callee_abi instead of get_call_reg_set_usage. Exit early if function_used_regs ends up not being useful. (get_call_fndecl): Move to rtlanal.c (get_call_cgraph_rtl_info, get_call_reg_set_usage): Delete. * caller-save.c: Include function-abi.h. (setup_save_areas, save_call_clobbered_regs): Use insn_callee_abi instead of get_call_reg_set_usage. * cfgcleanup.c: Include function-abi.h. (old_insns_match_p): Use insn_callee_abi instead of get_call_reg_set_usage. * cgraph.h (cgraph_node::rtl_info): Take a const_tree instead of a tree. * cgraph.c (cgraph_node::rtl_info): Likewise. Initialize function_used_regs. * df-scan.c: Include function-abi.h. (df_get_call_refs): Use insn_callee_abi instead of get_call_reg_set_usage. * ira-lives.c: Include function-abi.h. (process_bb_node_lives): Use insn_callee_abi instead of get_call_reg_set_usage. * lra-lives.c: Include function-abi.h. (process_bb_lives): Use insn_callee_abi instead of get_call_reg_set_usage. * postreload.c: Include function-abi.h. (reload_combine): Use insn_callee_abi instead of get_call_reg_set_usage. * regcprop.c: Include function-abi.h. (copyprop_hardreg_forward_1): Use insn_callee_abi instead of get_call_reg_set_usage. * resource.c: Include function-abi.h. (mark_set_resources, mark_target_live_regs): Use insn_callee_abi instead of get_call_reg_set_usage. * var-tracking.c: Include function-abi.h. (dataflow_set_clear_at_call): Use insn_callee_abi instead of get_call_reg_set_usage. From-SVN: r276309
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/tm.texi23
-rw-r--r--gcc/doc/tm.texi.in4
2 files changed, 13 insertions, 14 deletions
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 0f79d38..33997a5 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -1905,6 +1905,17 @@ descriptor. Targets only need to define this hook if they support
interoperability between several ABIs in the same translation unit.
@end deftypefn
+@deftypefn {Target Hook} {const predefined_function_abi &} TARGET_INSN_CALLEE_ABI (const rtx_insn *@var{insn})
+This hook returns a description of the ABI used by the target of
+call instruction @var{insn}; see the definition of
+@code{predefined_function_abi} for details of the ABI descriptor.
+Only the global function @code{insn_callee_abi} should call this hook
+directly.
+
+Targets only need to define this hook if they support
+interoperability between several ABIs in the same translation unit.
+@end deftypefn
+
@cindex call-used register
@cindex call-clobbered register
@cindex call-saved register
@@ -1921,18 +1932,6 @@ The default implementation returns false, which is correct
for targets that don't have partly call-clobbered registers.
@end deftypefn
-@deftypefn {Target Hook} void TARGET_REMOVE_EXTRA_CALL_PRESERVED_REGS (rtx_insn *@var{insn}, HARD_REG_SET *@var{used_regs})
-This hook removes registers from the set of call-clobbered registers
- in @var{used_regs} if, contrary to the default rules, something guarantees
- that @samp{insn} preserves those registers. For example, some targets
- support variant ABIs in which functions preserve more registers than
- normal functions would. Removing those extra registers from @var{used_regs}
- can lead to better register allocation.
-
- The default implementation does nothing, which is always safe.
- Defining the hook is purely an optimization.
-@end deftypefn
-
@deftypefn {Target Hook} {rtx_insn *} TARGET_RETURN_CALL_WITH_MAX_CLOBBERS (rtx_insn *@var{call_1}, rtx_insn *@var{call_2})
This hook returns a pointer to the call that partially clobbers the
most registers. If a platform supports multiple ABIs where the registers
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index ed605c0..55fb5d4 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -1711,13 +1711,13 @@ must be defined. Modern ports should define @code{CALL_REALLY_USED_REGISTERS}.
@cindex call-saved register
@hook TARGET_FNTYPE_ABI
+@hook TARGET_INSN_CALLEE_ABI
+
@cindex call-used register
@cindex call-clobbered register
@cindex call-saved register
@hook TARGET_HARD_REGNO_CALL_PART_CLOBBERED
-@hook TARGET_REMOVE_EXTRA_CALL_PRESERVED_REGS
-
@hook TARGET_RETURN_CALL_WITH_MAX_CLOBBERS
@hook TARGET_GET_MULTILIB_ABI_NAME