aboutsummaryrefslogtreecommitdiff
path: root/gcc/reload.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-09-30 16:21:23 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-09-30 16:21:23 +0000
commit12e20dde63c77eb696118e2624aacf8f11feb1f9 (patch)
treebaf1093742a2c8d72ba9e0becb9df4f9ce65a9bf /gcc/reload.c
parent0ce77f463d1d150e70a91807502d628492ca7ae5 (diff)
downloadgcc-12e20dde63c77eb696118e2624aacf8f11feb1f9.zip
gcc-12e20dde63c77eb696118e2624aacf8f11feb1f9.tar.gz
gcc-12e20dde63c77eb696118e2624aacf8f11feb1f9.tar.bz2
Remove global call sets: reload.c
The inheritance code in find_equiv_reg can use clobbers_reg_p to test whether a call clobbers either of the equivalent registers. reload and find_reg use crtl->abi to test whether a register needs to be saved in the prologue before use. reload_as_needed can use full_and_partial_reg_clobbers and thus avoid needing to keep its own record of which registers are part call-clobbered. 2019-09-30 Richard Sandiford <richard.sandiford@arm.com> gcc/ * reload.c: Include function-abi.h. (find_equiv_reg): Use clobbers_reg_p to test whether either of the equivalent registers is clobbered by a call. * reload1.c: Include function-abi.h. (reg_reloaded_call_part_clobbered): Delete. (reload): Use crtl->abi to test which registers would need saving in the prologue before use. (find_reg): Likewise. (emit_reload_insns): Remove code for reg_reloaded_call_part_clobbered. (reload_as_needed): Likewise. Use full_and_partial_reg_clobbers instead of call_used_or_fixed_regs | reg_reloaded_call_part_clobbered. From-SVN: r276333
Diffstat (limited to 'gcc/reload.c')
-rw-r--r--gcc/reload.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/gcc/reload.c b/gcc/reload.c
index b760130..8582b48 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -106,6 +106,7 @@ a register with any other reload. */
#include "reload.h"
#include "addresses.h"
#include "params.h"
+#include "function-abi.h"
/* True if X is a constant that can be forced into the constant pool.
MODE is the mode of the operand, or VOIDmode if not known. */
@@ -6904,24 +6905,19 @@ find_equiv_reg (rtx goal, rtx_insn *insn, enum reg_class rclass, int other,
if either of the two is in a call-clobbered register, or memory. */
if (CALL_P (p))
{
- int i;
-
if (goal_mem || need_stable_sp)
return 0;
- if (regno >= 0 && regno < FIRST_PSEUDO_REGISTER)
- for (i = 0; i < nregs; ++i)
- if (call_used_or_fixed_reg_p (regno + i)
- || targetm.hard_regno_call_part_clobbered (0, regno + i,
- mode))
- return 0;
+ function_abi callee_abi = insn_callee_abi (p);
+ if (regno >= 0
+ && regno < FIRST_PSEUDO_REGISTER
+ && callee_abi.clobbers_reg_p (mode, regno))
+ return 0;
- if (valueno >= 0 && valueno < FIRST_PSEUDO_REGISTER)
- for (i = 0; i < valuenregs; ++i)
- if (call_used_or_fixed_reg_p (valueno + i)
- || targetm.hard_regno_call_part_clobbered (0, valueno + i,
- mode))
- return 0;
+ if (valueno >= 0
+ && valueno < FIRST_PSEUDO_REGISTER
+ && callee_abi.clobbers_reg_p (mode, valueno))
+ return 0;
}
if (INSN_P (p))