This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Improve spilling for variable-size slots


On 11/03/2017 10:35 AM, Richard Sandiford wrote:
> Once SVE is enabled, a general AArch64 spill slot offset will be
> 
>   A + B * VL
> 
> where A is a constant and B is a multiple of the SVE vector length.
> The offsets in SVE load and store instructions are a multiple of VL
> (and so can encode some values of B), while offsets for base AArch64
> load and store instructions aren't (and encode some values of A).
> 
> We therefore get better spill code if variable-sized slots are grouped
> together separately from constant-sized slots, and if variable-sized
> slots are not reused for constant-sized data.  Then, spills to the
> constant-sized slots can add B * VL to the offset first, creating a
> common anchor point for spills with the same B component but different
> A components.  Spills to variable-sized slots can likewise add A to
> the offset first, creating a common anchor point for spills with the
> same A component but different B components.
> 
> This patch implements the sorting and grouping side of the optimisation.
> A later patch creates the anchor points.
> 
> The patch is a no-op on other targets.
> 
> Tested on aarch64-linux-gnu, x86_64-linux-gnu and powerpc64-linux-gnu.
> OK to install?
> 
> Richard
> 
> 
> 2017-11-03  Richard Sandiford  <richard.sandiford@linaro.org>
> 	    Alan Hayward  <alan.hayward@arm.com>
> 	    David Sherwood  <david.sherwood@arm.com>
> 
> gcc/
> 	* lra-spills.c (pseudo_reg_slot_compare): Sort slots by whether
> 	they are variable or constant sized.
> 	(assign_stack_slot_num_and_sort_pseudos): Don't reuse variable-sized
> 	slots for constant-sized data.
OK.
jeff
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]