Commit 0795f659 by Vlad Lazar Committed by Vlad Lazar

[AArch64] Add support for TARGET_COMPUTE_FRAME_LAYOUT

The patch adds support for the TARGET_COMPUTE_FRAME_LAYOUT hook on AArch64
and removes unneeded frame layout recalculation.

2018-09-13  Vlad Lazar  <vlad.lazar@arm.com>

	* config/aarch64/aarch64.h (TARGET_COMPUTE_FRAME_LAYOUT): Define.
	* config/aarch64/aarch64.c (aarch64_expand_prologue): Remove
	aarch64_layout_frame call.
	(aarch64_expand_epilogue): Likewise.
	(aarch64_initial_elimination_offset): Likewise.
	(aarch64_get_separate_components): Likewise.
	(aarch64_use_return_insn_p): Likewise.
	(aarch64_layout_frame): Remove unneeded check.

From-SVN: r264263
parent 54de7d7d
2018-09-13 Vlad Lazar <vlad.lazar@arm.com>
* config/aarch64/aarch64.h (TARGET_COMPUTE_FRAME_LAYOUT): Define.
* config/aarch64/aarch64.c (aarch64_expand_prologue): Remove
aarch64_layout_frame call.
(aarch64_expand_epilogue): Likewise.
(aarch64_initial_elimination_offset): Likewise.
(aarch64_get_separate_components): Likewise.
(aarch64_use_return_insn_p): Likewise.
(aarch64_layout_frame): Remove unneeded check.
2018-09-13 Jakub Jelinek <jakub@redhat.com> 2018-09-13 Jakub Jelinek <jakub@redhat.com>
* configure.ac: Only append * configure.ac: Only append
......
...@@ -3938,9 +3938,6 @@ aarch64_layout_frame (void) ...@@ -3938,9 +3938,6 @@ aarch64_layout_frame (void)
HOST_WIDE_INT offset = 0; HOST_WIDE_INT offset = 0;
int regno, last_fp_reg = INVALID_REGNUM; int regno, last_fp_reg = INVALID_REGNUM;
if (reload_completed && cfun->machine->frame.laid_out)
return;
cfun->machine->frame.emit_frame_chain = aarch64_needs_frame_chain (); cfun->machine->frame.emit_frame_chain = aarch64_needs_frame_chain ();
#define SLOT_NOT_REQUIRED (-2) #define SLOT_NOT_REQUIRED (-2)
...@@ -4484,8 +4481,6 @@ offset_12bit_unsigned_scaled_p (machine_mode mode, poly_int64 offset) ...@@ -4484,8 +4481,6 @@ offset_12bit_unsigned_scaled_p (machine_mode mode, poly_int64 offset)
static sbitmap static sbitmap
aarch64_get_separate_components (void) aarch64_get_separate_components (void)
{ {
aarch64_layout_frame ();
sbitmap components = sbitmap_alloc (LAST_SAVED_REGNUM + 1); sbitmap components = sbitmap_alloc (LAST_SAVED_REGNUM + 1);
bitmap_clear (components); bitmap_clear (components);
...@@ -4509,7 +4504,7 @@ aarch64_get_separate_components (void) ...@@ -4509,7 +4504,7 @@ aarch64_get_separate_components (void)
unsigned reg1 = cfun->machine->frame.wb_candidate1; unsigned reg1 = cfun->machine->frame.wb_candidate1;
unsigned reg2 = cfun->machine->frame.wb_candidate2; unsigned reg2 = cfun->machine->frame.wb_candidate2;
/* If aarch64_layout_frame has chosen registers to store/restore with /* If registers have been chosen to be stored/restored with
writeback don't interfere with them to avoid having to output explicit writeback don't interfere with them to avoid having to output explicit
stack adjustment instructions. */ stack adjustment instructions. */
if (reg2 != INVALID_REGNUM) if (reg2 != INVALID_REGNUM)
...@@ -4767,8 +4762,6 @@ aarch64_add_cfa_expression (rtx_insn *insn, unsigned int reg, ...@@ -4767,8 +4762,6 @@ aarch64_add_cfa_expression (rtx_insn *insn, unsigned int reg,
void void
aarch64_expand_prologue (void) aarch64_expand_prologue (void)
{ {
aarch64_layout_frame ();
poly_int64 frame_size = cfun->machine->frame.frame_size; poly_int64 frame_size = cfun->machine->frame.frame_size;
poly_int64 initial_adjust = cfun->machine->frame.initial_adjust; poly_int64 initial_adjust = cfun->machine->frame.initial_adjust;
HOST_WIDE_INT callee_adjust = cfun->machine->frame.callee_adjust; HOST_WIDE_INT callee_adjust = cfun->machine->frame.callee_adjust;
...@@ -4881,8 +4874,6 @@ aarch64_use_return_insn_p (void) ...@@ -4881,8 +4874,6 @@ aarch64_use_return_insn_p (void)
if (crtl->profile) if (crtl->profile)
return false; return false;
aarch64_layout_frame ();
return known_eq (cfun->machine->frame.frame_size, 0); return known_eq (cfun->machine->frame.frame_size, 0);
} }
...@@ -4894,8 +4885,6 @@ aarch64_use_return_insn_p (void) ...@@ -4894,8 +4885,6 @@ aarch64_use_return_insn_p (void)
void void
aarch64_expand_epilogue (bool for_sibcall) aarch64_expand_epilogue (bool for_sibcall)
{ {
aarch64_layout_frame ();
poly_int64 initial_adjust = cfun->machine->frame.initial_adjust; poly_int64 initial_adjust = cfun->machine->frame.initial_adjust;
HOST_WIDE_INT callee_adjust = cfun->machine->frame.callee_adjust; HOST_WIDE_INT callee_adjust = cfun->machine->frame.callee_adjust;
poly_int64 final_adjust = cfun->machine->frame.final_adjust; poly_int64 final_adjust = cfun->machine->frame.final_adjust;
...@@ -7414,8 +7403,6 @@ aarch64_can_eliminate (const int from ATTRIBUTE_UNUSED, const int to) ...@@ -7414,8 +7403,6 @@ aarch64_can_eliminate (const int from ATTRIBUTE_UNUSED, const int to)
poly_int64 poly_int64
aarch64_initial_elimination_offset (unsigned from, unsigned to) aarch64_initial_elimination_offset (unsigned from, unsigned to)
{ {
aarch64_layout_frame ();
if (to == HARD_FRAME_POINTER_REGNUM) if (to == HARD_FRAME_POINTER_REGNUM)
{ {
if (from == ARG_POINTER_REGNUM) if (from == ARG_POINTER_REGNUM)
......
...@@ -480,6 +480,9 @@ extern unsigned aarch64_architecture_version; ...@@ -480,6 +480,9 @@ extern unsigned aarch64_architecture_version;
#undef DONT_USE_BUILTIN_SETJMP #undef DONT_USE_BUILTIN_SETJMP
#define DONT_USE_BUILTIN_SETJMP 1 #define DONT_USE_BUILTIN_SETJMP 1
#undef TARGET_COMPUTE_FRAME_LAYOUT
#define TARGET_COMPUTE_FRAME_LAYOUT aarch64_layout_frame
/* Register in which the structure value is to be returned. */ /* Register in which the structure value is to be returned. */
#define AARCH64_STRUCT_VALUE_REGNUM R8_REGNUM #define AARCH64_STRUCT_VALUE_REGNUM R8_REGNUM
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment