Improve stack adjustment by reusing a temporary move immediate from the epilog
commit0ee6ade734ee4a44361601d27dd2779c8154de3c
authorwilco <wilco@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 Oct 2016 17:15:22 +0000 (21 17:15 +0000)
committerwilco <wilco@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 Oct 2016 17:15:22 +0000 (21 17:15 +0000)
treeae80522de55744d04de1bfd5cf8142651fe0dc77
parent78e6fb7aba6b670c7160616e46f188a93e67e2d9
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241420 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/aarch64/aarch64.c
gcc/testsuite/ChangeLog