diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2023-10-17 23:46:33 +0100 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2023-10-17 23:46:33 +0100 |
commit | 575858508090b18dcbc176db285c9f55227ca4c0 (patch) | |
tree | f5162312a5b40698fd12f4b19cb9a52f1d47f0e3 /gcc/tree-vectorizer.h | |
parent | aeb3f0436f8ae84e593eda9641fe4e6fdf0afb3e (diff) | |
download | gcc-575858508090b18dcbc176db285c9f55227ca4c0.zip gcc-575858508090b18dcbc176db285c9f55227ca4c0.tar.gz gcc-575858508090b18dcbc176db285c9f55227ca4c0.tar.bz2 |
aarch64: Use vecs to store register save order
aarch64_save/restore_callee_saves looped over registers in register
number order. This in turn meant that we could only use LDP and STP
for registers that were consecutive both number-wise and
offset-wise (after unsaved registers are excluded).
This patch instead builds lists of the registers that we've decided to
save, in offset order. We can then form LDP/STP pairs regardless of
register number order, which in turn means that we can put the LR save
slot first without losing LDP/STP opportunities.
gcc/
* config/aarch64/aarch64.h (aarch64_frame): Add vectors that
store the list saved GPRs, FPRs and predicate registers.
* config/aarch64/aarch64.cc (aarch64_layout_frame): Initialize
the lists of saved registers. Use them to choose push candidates.
Invalidate pop candidates if we're not going to do a pop.
(aarch64_next_callee_save): Delete.
(aarch64_save_callee_saves): Take a list of registers,
rather than a range. Make !skip_wb select only write-back
candidates.
(aarch64_expand_prologue): Update calls accordingly.
(aarch64_restore_callee_saves): Take a list of registers,
rather than a range. Always skip pop candidates. Also skip
LR if shadow call stacks are enabled.
(aarch64_expand_epilogue): Update calls accordingly.
gcc/testsuite/
* gcc.target/aarch64/sve/pcs/stack_clash_2.c: Expect restores
to happen in offset order.
* gcc.target/aarch64/sve/pcs/stack_clash_2_128.c: Likewise.
* gcc.target/aarch64/sve/pcs/stack_clash_2_256.c: Likewise.
* gcc.target/aarch64/sve/pcs/stack_clash_2_512.c: Likewise.
* gcc.target/aarch64/sve/pcs/stack_clash_2_1024.c: Likewise.
* gcc.target/aarch64/sve/pcs/stack_clash_2_2048.c: Likewise.
Diffstat (limited to 'gcc/tree-vectorizer.h')
0 files changed, 0 insertions, 0 deletions