Improve stack adjustment by reusing a temporary move immediate from the epilog...
authorWilco Dijkstra <wdijkstr@arm.com>
Fri, 21 Oct 2016 17:15:22 +0000 (17:15 +0000)
committerWilco Dijkstra <wilco@gcc.gnu.org>
Fri, 21 Oct 2016 17:15:22 +0000 (17:15 +0000)
commit5be6b295d084ced9540aa738a40cdaac7dd15d4d
treeae80522de55744d04de1bfd5cf8142651fe0dc77
parent4b0685d91591a8493e7fd41f87c8690c675c40d9
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
gcc/ChangeLog
gcc/config/aarch64/aarch64.c
gcc/testsuite/ChangeLog