Improve stack adjustment by reusing a temporary move immediate from the epilog...
Improve stack adjustment by reusing a temporary move immediate from the epilog
if the register is still valid in the epilog. This generates smaller code for
leaf functions with a stack size of more then 4KB.
gcc/
* config/aarch64/aarch64.c (aarch64_add_constant_internal):
Add extra argument to allow emitting the move immediate.
Use add/sub with positive immediate.
(aarch64_add_constant): Add inline function.
(aarch64_add_sp): Likewise.
(aarch64_sub_sp): Likewise.
(aarch64_expand_prologue): Call aarch64_sub_sp.
(aarch64_expand_epilogue): Call aarch64_add_sp.
Decide when to leave out move.
(aarch64_output_mi_thunk): Call aarch64_add_constant.
testsuite/
* gcc.target/aarch64/test_frame_17.c: New test.
From-SVN: r241420