diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2019-09-30 16:21:03 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2019-09-30 16:21:03 +0000 |
commit | 3df28f006a7ceaf958a9ce9d100dd1e266e18f26 (patch) | |
tree | ebe1e2ff7e6b3f96657d2c4f32da863ed2ea8fa9 | |
parent | a1e6ee38e708ef2bdef4dfbb99473344bd56fa2f (diff) | |
download | gcc-3df28f006a7ceaf958a9ce9d100dd1e266e18f26.zip gcc-3df28f006a7ceaf958a9ce9d100dd1e266e18f26.tar.gz gcc-3df28f006a7ceaf958a9ce9d100dd1e266e18f26.tar.bz2 |
Remove global call sets: postreload.c
The "|= fixed_regs" in reload_combine isn't necessary, since the
set is only used to determine which values have changed (rather than,
for example, which registers are available for use).
In reload_cse_move2add we can be accurate about which registers
are still available. BLKmode indicates a continuation of the
previous register, and since clobbers_reg_p handles multi-register
values, it's enough to skip over BLKmode entries and just test the
start register.
2019-09-30 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* postreload.c (reload_combine_recognize_pattern): Use crtl->abi
when deciding whether a register is free for use after RA.
(reload_combine): Remove unnecessary use of fixed_reg_set.
(reload_cse_move2add): Use insn_callee_abi to get the ABI of the
call insn target. Use reg_mode when testing whether a register
is no longer available.
From-SVN: r276328
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/postreload.c | 17 |
2 files changed, 17 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index df3a2f6..208d32f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,14 @@ 2019-09-30 Richard Sandiford <richard.sandiford@arm.com> + * postreload.c (reload_combine_recognize_pattern): Use crtl->abi + when deciding whether a register is free for use after RA. + (reload_combine): Remove unnecessary use of fixed_reg_set. + (reload_cse_move2add): Use insn_callee_abi to get the ABI of the + call insn target. Use reg_mode when testing whether a register + is no longer available. + +2019-09-30 Richard Sandiford <richard.sandiford@arm.com> + * target.def (return_call_with_max_clobbers): Delete. * doc/tm.texi.in (TARGET_RETURN_CALL_WITH_MAX_CLOBBERS): Delete. * doc/tm.texi: Regenerate. diff --git a/gcc/postreload.c b/gcc/postreload.c index 467df7b..e66377e 100644 --- a/gcc/postreload.c +++ b/gcc/postreload.c @@ -1136,7 +1136,8 @@ reload_combine_recognize_pattern (rtx_insn *insn) if (TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS], i) && reg_state[i].use_index == RELOAD_COMBINE_MAX_USES && reg_state[i].store_ruid <= reg_state[regno].use_ruid - && (call_used_or_fixed_reg_p (i) || df_regs_ever_live_p (i)) + && (crtl->abi->clobbers_full_reg_p (i) + || df_regs_ever_live_p (i)) && (!frame_pointer_needed || i != HARD_FRAME_POINTER_REGNUM) && !fixed_regs[i] && !global_regs[i] && hard_regno_nregs (i, GET_MODE (reg)) == 1 @@ -1332,9 +1333,6 @@ reload_combine (void) { rtx link; HARD_REG_SET used_regs = insn_callee_abi (insn).full_reg_clobbers (); - /* ??? This preserves traditional behavior; it might not be - needed. */ - used_regs |= fixed_reg_set; for (r = 0; r < FIRST_PSEUDO_REGISTER; r++) if (TEST_HARD_REG_BIT (used_regs, r)) @@ -2126,12 +2124,13 @@ reload_cse_move2add (rtx_insn *first) unknown values. */ if (CALL_P (insn)) { + function_abi callee_abi = insn_callee_abi (insn); for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; i--) - { - if (call_used_or_fixed_reg_p (i)) - /* Reset the information about this register. */ - reg_mode[i] = VOIDmode; - } + if (reg_mode[i] != VOIDmode + && reg_mode[i] != BLKmode + && callee_abi.clobbers_reg_p (reg_mode[i], i)) + /* Reset the information about this register. */ + reg_mode[i] = VOIDmode; } } return changed; |