Commit 212b7076 by Richard Sandiford Committed by Richard Sandiford

Remove global call sets: combine.c

There shouldn't be many cases in which a useful hard register is
live across a call before RA, so we might as well keep things simple
and invalidate partially-clobbered registers here, in case the values
they hold leak into the call-clobbered part.  In principle this is
a bug fix for TARGET_HARD_REGNO_CALL_PART_CLOBBERED targets,
but in practice it probably doesn't make a difference.

2019-09-30  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* combine.c: Include function-abi.h.
	(record_dead_and_set_regs): Use insn_callee_abi to get the ABI
	of the target of call insns.  Invalidate partially-clobbered
	registers as well as fully-clobbered ones.

From-SVN: r276316
parent 43b484fb
2019-09-30 Richard Sandiford <richard.sandiford@arm.com>
* combine.c: Include function-abi.h.
(record_dead_and_set_regs): Use insn_callee_abi to get the ABI
of the target of call insns. Invalidate partially-clobbered
registers as well as fully-clobbered ones.
2019-09-30 Richard Sandiford <richard.sandiford@arm.com>
* cfgloopanal.c: Include regs.h and function-abi.h.
(init_set_costs): Use default_function_abi to test whether
a general register is call-clobbered.
......
......@@ -105,6 +105,7 @@ along with GCC; see the file COPYING3. If not see
#include "valtrack.h"
#include "rtl-iter.h"
#include "print-rtl.h"
#include "function-abi.h"
/* Number of attempts to combine instructions in this function. */
......@@ -13464,11 +13465,21 @@ record_dead_and_set_regs (rtx_insn *insn)
if (CALL_P (insn))
{
HARD_REG_SET callee_clobbers
= insn_callee_abi (insn).full_and_partial_reg_clobbers ();
hard_reg_set_iterator hrsi;
EXECUTE_IF_SET_IN_HARD_REG_SET (regs_invalidated_by_call, 0, i, hrsi)
EXECUTE_IF_SET_IN_HARD_REG_SET (callee_clobbers, 0, i, hrsi)
{
reg_stat_type *rsp;
/* ??? We could try to preserve some information from the last
set of register I if the call doesn't actually clobber
(reg:last_set_mode I), which might be true for ABIs with
partial clobbers. However, it would be difficult to
update last_set_nonzero_bits and last_sign_bit_copies
to account for the part of I that actually was clobbered.
It wouldn't help much anyway, since we rarely see this
situation before RA. */
rsp = &reg_stat[i];
rsp->last_set_invalid = 1;
rsp->last_set = insn;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment