diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2016-11-25 08:23:08 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2016-11-25 08:23:08 +0000 |
commit | 83d0488b79a97fa38a46b00fbce2c72c4af91ed9 (patch) | |
tree | a6a2d07e1d1291391656c78cb3726365e7c7a9a1 /gcc/function.c | |
parent | 664e69688d7681be99aaa900ef193d3196e4b7d1 (diff) | |
download | gcc-83d0488b79a97fa38a46b00fbce2c72c4af91ed9.zip gcc-83d0488b79a97fa38a46b00fbce2c72c4af91ed9.tar.gz gcc-83d0488b79a97fa38a46b00fbce2c72c4af91ed9.tar.bz2 |
Tweak LRA handling of shared spill slots
The previous code processed the users of a stack slot in order of
decreasing size and allocated the slot based on the first user.
This seems a bit dangerous, since the ordering is based on the
mode of the biggest reference while the allocation is based also
on the size of the register itself (which I think could be larger).
That scheme doesn't scale well to polynomial sizes, since there's
no guarantee that the order of the sizes is known at compile time.
This patch instead records an upper bound on the size required
by all users of a slot. It also records the maximum alignment
requirement.
gcc/
2016-11-15 Richard Sandiford <richard.sandiford@arm.com>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
* function.h (spill_slot_alignment): Declare.
* function.c (spill_slot_alignment): New function.
* lra-spills.c (slot): Add align and size fields.
(assign_mem_slot): Use them in the call to assign_stack_local.
(add_pseudo_to_slot): Update the fields.
(assign_stack_slot_num_and_sort_pseudos): Initialise the fields.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r242863
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/function.c b/gcc/function.c index f191b57..c5a538f 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -246,6 +246,14 @@ frame_offset_overflow (HOST_WIDE_INT offset, tree func) return FALSE; } +/* Return the minimum spill slot alignment for a register of mode MODE. */ + +unsigned int +spill_slot_alignment (machine_mode mode ATTRIBUTE_UNUSED) +{ + return STACK_SLOT_ALIGNMENT (NULL_TREE, mode, GET_MODE_ALIGNMENT (mode)); +} + /* Return stack slot alignment in bits for TYPE and MODE. */ static unsigned int |