Commit 80ce7eb4 by Richard Sandiford Committed by Richard Sandiford

poly_int: reload<->ira interface

This patch uses poly_int64 for:

- ira_reuse_stack_slot
- ira_mark_new_stack_slot
- ira_spilled_reg_stack_slot::width

all of which are part of the IRA/reload interface.

2017-12-21  Richard Sandiford  <richard.sandiford@linaro.org>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

gcc/
	* ira-int.h (ira_spilled_reg_stack_slot::width): Change from
	an unsigned int to a poly_uint64.
	* ira.h (ira_reuse_stack_slot, ira_mark_new_stack_slot): Take the
	sizes as poly_uint64s rather than unsigned ints.
	* ira-color.c (ira_reuse_stack_slot, ira_mark_new_stack_slot):
	Likewise.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>

From-SVN: r255924
parent 31ae0e43
...@@ -2,6 +2,17 @@ ...@@ -2,6 +2,17 @@
Alan Hayward <alan.hayward@arm.com> Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com> David Sherwood <david.sherwood@arm.com>
* ira-int.h (ira_spilled_reg_stack_slot::width): Change from
an unsigned int to a poly_uint64.
* ira.h (ira_reuse_stack_slot, ira_mark_new_stack_slot): Take the
sizes as poly_uint64s rather than unsigned ints.
* ira-color.c (ira_reuse_stack_slot, ira_mark_new_stack_slot):
Likewise.
2017-12-21 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
* lra-constraints.c (emit_inc): Change inc_amount from an int * lra-constraints.c (emit_inc): Change inc_amount from an int
to a poly_int64. to a poly_int64.
...@@ -4494,8 +4494,8 @@ ira_reassign_pseudos (int *spilled_pseudo_regs, int num, ...@@ -4494,8 +4494,8 @@ ira_reassign_pseudos (int *spilled_pseudo_regs, int num,
TOTAL_SIZE. In the case of failure to find a slot which can be TOTAL_SIZE. In the case of failure to find a slot which can be
used for REGNO, the function returns NULL. */ used for REGNO, the function returns NULL. */
rtx rtx
ira_reuse_stack_slot (int regno, unsigned int inherent_size, ira_reuse_stack_slot (int regno, poly_uint64 inherent_size,
unsigned int total_size) poly_uint64 total_size)
{ {
unsigned int i; unsigned int i;
int slot_num, best_slot_num; int slot_num, best_slot_num;
...@@ -4508,8 +4508,8 @@ ira_reuse_stack_slot (int regno, unsigned int inherent_size, ...@@ -4508,8 +4508,8 @@ ira_reuse_stack_slot (int regno, unsigned int inherent_size,
ira_assert (! ira_use_lra_p); ira_assert (! ira_use_lra_p);
ira_assert (inherent_size == PSEUDO_REGNO_BYTES (regno) ira_assert (known_eq (inherent_size, PSEUDO_REGNO_BYTES (regno))
&& inherent_size <= total_size && known_le (inherent_size, total_size)
&& ALLOCNO_HARD_REGNO (allocno) < 0); && ALLOCNO_HARD_REGNO (allocno) < 0);
if (! flag_ira_share_spill_slots) if (! flag_ira_share_spill_slots)
return NULL_RTX; return NULL_RTX;
...@@ -4532,8 +4532,8 @@ ira_reuse_stack_slot (int regno, unsigned int inherent_size, ...@@ -4532,8 +4532,8 @@ ira_reuse_stack_slot (int regno, unsigned int inherent_size,
slot = &ira_spilled_reg_stack_slots[slot_num]; slot = &ira_spilled_reg_stack_slots[slot_num];
if (slot->mem == NULL_RTX) if (slot->mem == NULL_RTX)
continue; continue;
if (slot->width < total_size if (maybe_lt (slot->width, total_size)
|| GET_MODE_SIZE (GET_MODE (slot->mem)) < inherent_size) || maybe_lt (GET_MODE_SIZE (GET_MODE (slot->mem)), inherent_size))
continue; continue;
EXECUTE_IF_SET_IN_BITMAP (&slot->spilled_regs, EXECUTE_IF_SET_IN_BITMAP (&slot->spilled_regs,
...@@ -4585,7 +4585,7 @@ ira_reuse_stack_slot (int regno, unsigned int inherent_size, ...@@ -4585,7 +4585,7 @@ ira_reuse_stack_slot (int regno, unsigned int inherent_size,
} }
if (x != NULL_RTX) if (x != NULL_RTX)
{ {
ira_assert (slot->width >= total_size); ira_assert (known_ge (slot->width, total_size));
#ifdef ENABLE_IRA_CHECKING #ifdef ENABLE_IRA_CHECKING
EXECUTE_IF_SET_IN_BITMAP (&slot->spilled_regs, EXECUTE_IF_SET_IN_BITMAP (&slot->spilled_regs,
FIRST_PSEUDO_REGISTER, i, bi) FIRST_PSEUDO_REGISTER, i, bi)
...@@ -4614,7 +4614,7 @@ ira_reuse_stack_slot (int regno, unsigned int inherent_size, ...@@ -4614,7 +4614,7 @@ ira_reuse_stack_slot (int regno, unsigned int inherent_size,
TOTAL_SIZE was allocated for REGNO. We store this info for TOTAL_SIZE was allocated for REGNO. We store this info for
subsequent ira_reuse_stack_slot calls. */ subsequent ira_reuse_stack_slot calls. */
void void
ira_mark_new_stack_slot (rtx x, int regno, unsigned int total_size) ira_mark_new_stack_slot (rtx x, int regno, poly_uint64 total_size)
{ {
struct ira_spilled_reg_stack_slot *slot; struct ira_spilled_reg_stack_slot *slot;
int slot_num; int slot_num;
...@@ -4622,7 +4622,7 @@ ira_mark_new_stack_slot (rtx x, int regno, unsigned int total_size) ...@@ -4622,7 +4622,7 @@ ira_mark_new_stack_slot (rtx x, int regno, unsigned int total_size)
ira_assert (! ira_use_lra_p); ira_assert (! ira_use_lra_p);
ira_assert (PSEUDO_REGNO_BYTES (regno) <= total_size); ira_assert (known_le (PSEUDO_REGNO_BYTES (regno), total_size));
allocno = ira_regno_allocno_map[regno]; allocno = ira_regno_allocno_map[regno];
slot_num = -ALLOCNO_HARD_REGNO (allocno) - 2; slot_num = -ALLOCNO_HARD_REGNO (allocno) - 2;
if (slot_num == -1) if (slot_num == -1)
......
...@@ -604,7 +604,7 @@ struct ira_spilled_reg_stack_slot ...@@ -604,7 +604,7 @@ struct ira_spilled_reg_stack_slot
/* RTL representation of the stack slot. */ /* RTL representation of the stack slot. */
rtx mem; rtx mem;
/* Size of the stack slot. */ /* Size of the stack slot. */
unsigned int width; poly_uint64_pod width;
}; };
/* The number of elements in the following array. */ /* The number of elements in the following array. */
......
...@@ -200,8 +200,8 @@ extern void ira_mark_allocation_change (int); ...@@ -200,8 +200,8 @@ extern void ira_mark_allocation_change (int);
extern void ira_mark_memory_move_deletion (int, int); extern void ira_mark_memory_move_deletion (int, int);
extern bool ira_reassign_pseudos (int *, int, HARD_REG_SET, HARD_REG_SET *, extern bool ira_reassign_pseudos (int *, int, HARD_REG_SET, HARD_REG_SET *,
HARD_REG_SET *, bitmap); HARD_REG_SET *, bitmap);
extern rtx ira_reuse_stack_slot (int, unsigned int, unsigned int); extern rtx ira_reuse_stack_slot (int, poly_uint64, poly_uint64);
extern void ira_mark_new_stack_slot (rtx, int, unsigned int); extern void ira_mark_new_stack_slot (rtx, int, poly_uint64);
extern bool ira_better_spill_reload_regno_p (int *, int *, rtx, rtx, rtx_insn *); extern bool ira_better_spill_reload_regno_p (int *, int *, rtx, rtx, rtx_insn *);
extern bool ira_bad_reload_regno (int, rtx, rtx); extern bool ira_bad_reload_regno (int, rtx, rtx);
......
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