lra-spills.c
26.5 KB
-
Improve spilling for variable-width slots · 799d6b90
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 standard 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. Similarly, spills to variable-sized slots can 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. 2018-01-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. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r256208
Richard Sandiford committed