* [PATCH][AAarch64] Add support for TARGET_COMPUTE_FRAME_LAYOUT
@ 2018-07-09 11:58 Vlad Lazar
2018-07-20 9:32 ` [PATCH][AAarch64][v2] " Vlad Lazar
0 siblings, 1 reply; 2+ messages in thread
From: Vlad Lazar @ 2018-07-09 11:58 UTC (permalink / raw)
To: gcc-patches; +Cc: Richard Earnshaw, James Greenhalgh, Marcus Shawcroft, nd
[-- Attachment #1: Type: text/plain, Size: 516 bytes --]
Hi all,
The patch adds support for the TARGET_COMPUTE_FRAME_LAYOUT hook on AArch64
and removes unneeded frame layout recalculation.
Bootstrapped and regtested on aarch64-none-linux-gnu and there are no regressions.
Thanks,
Vlad
gcc/
2018-07-02 Vlad Lazar <vlad.lazar@arm.com>
* config/aarch64/aarch64.h (TARGET_COMPUTE_FRAME_LAYOUT): Define.
* config/aarch64/aarch64.c (aarch64_expand_prologue, aarch64_expand_epilogue,
aarch64_initial_elimination_offset): Remove aarch64_layout_frame calls.
[-- Attachment #2: diff --]
[-- Type: application/octet-stream, Size: 1802 bytes --]
diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
index 976f9afae54c1c98c22a4d5002d8d94e33b3190a..02aaa333fb57eff918049681173403f004a8a8e3 100644
--- a/gcc/config/aarch64/aarch64.h
+++ b/gcc/config/aarch64/aarch64.h
@@ -478,6 +478,9 @@ extern unsigned aarch64_architecture_version;
#undef DONT_USE_BUILTIN_SETJMP
#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. */
#define AARCH64_STRUCT_VALUE_REGNUM R8_REGNUM
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index b88e7cac27ab76e01b9769563ec9077d2a81bd7b..94e4802076cf69d1605f81cc62968f6cfe210d2f 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -4850,8 +4850,6 @@ aarch64_add_cfa_expression (rtx_insn *insn, unsigned int reg,
void
aarch64_expand_prologue (void)
{
- aarch64_layout_frame ();
-
poly_int64 frame_size = cfun->machine->frame.frame_size;
poly_int64 initial_adjust = cfun->machine->frame.initial_adjust;
HOST_WIDE_INT callee_adjust = cfun->machine->frame.callee_adjust;
@@ -4977,8 +4975,6 @@ aarch64_use_return_insn_p (void)
void
aarch64_expand_epilogue (bool for_sibcall)
{
- aarch64_layout_frame ();
-
poly_int64 initial_adjust = cfun->machine->frame.initial_adjust;
HOST_WIDE_INT callee_adjust = cfun->machine->frame.callee_adjust;
poly_int64 final_adjust = cfun->machine->frame.final_adjust;
@@ -7525,8 +7521,6 @@ aarch64_can_eliminate (const int from ATTRIBUTE_UNUSED, const int to)
poly_int64
aarch64_initial_elimination_offset (unsigned from, unsigned to)
{
- aarch64_layout_frame ();
-
if (to == HARD_FRAME_POINTER_REGNUM)
{
if (from == ARG_POINTER_REGNUM)
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH][AAarch64][v2] Add support for TARGET_COMPUTE_FRAME_LAYOUT
2018-07-09 11:58 [PATCH][AAarch64] Add support for TARGET_COMPUTE_FRAME_LAYOUT Vlad Lazar
@ 2018-07-20 9:32 ` Vlad Lazar
0 siblings, 0 replies; 2+ messages in thread
From: Vlad Lazar @ 2018-07-20 9:32 UTC (permalink / raw)
To: gcc-patches; +Cc: nd, James Greenhalgh
On 09/07/18 12:58, Vlad Lazar wrote:
> Hi all,
>
> The patch adds support for the TARGET_COMPUTE_FRAME_LAYOUT hook on AArch64
> and removes unneeded frame layout recalculation.
>
> Bootstrapped and regtested on aarch64-none-linux-gnu and there are no regressions.
>
> Thanks,
> Vlad
>
> gcc/
> 2018-07-02 Vlad Lazar <vlad.lazar@arm.com>
>
> * config/aarch64/aarch64.h (TARGET_COMPUTE_FRAME_LAYOUT): Define.
> * config/aarch64/aarch64.c (aarch64_expand_prologue, aarch64_expand_epilogue,
> aarch64_initial_elimination_offset): Remove aarch64_layout_frame calls.
>
Hi,
This is an updated version of the patch which removes some extra layout recalculation.
Please disregard the first version.
The patch adds support for the TARGET_COMPUTE_FRAME_LAYOUT hook on AArch64
and removes unneeded frame layout recalculation.
Bootstrapped and regtested on aarch64-none-linux-gnu and there are no regressions.
Thanks,
Vlad
gcc/
2018-07-20 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.
---
diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
index
976f9afae54c1c98c22a4d5002d8d94e33b3190a..02aaa333fb57eff918049681173403f004a8a8e3
100644
--- a/gcc/config/aarch64/aarch64.h
+++ b/gcc/config/aarch64/aarch64.h
@@ -478,6 +478,9 @@ extern unsigned aarch64_architecture_version;
#undef DONT_USE_BUILTIN_SETJMP
#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. */
#define AARCH64_STRUCT_VALUE_REGNUM R8_REGNUM
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index
b88e7cac27ab76e01b9769563ec9077d2a81bd7b..6a52eecf94011f5a7ee787c1295ca24732af2ff4
100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -4021,9 +4021,6 @@ aarch64_layout_frame (void)
HOST_WIDE_INT offset = 0;
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 ();
#define SLOT_NOT_REQUIRED (-2)
@@ -4567,8 +4564,6 @@ offset_12bit_unsigned_scaled_p (machine_mode mode,
poly_int64 offset)
static sbitmap
aarch64_get_separate_components (void)
{
- aarch64_layout_frame ();
-
sbitmap components = sbitmap_alloc (LAST_SAVED_REGNUM + 1);
bitmap_clear (components);
@@ -4592,7 +4587,7 @@ aarch64_get_separate_components (void)
unsigned reg1 = cfun->machine->frame.wb_candidate1;
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
stack adjustment instructions. */
if (reg2 != INVALID_REGNUM)
@@ -4850,8 +4845,6 @@ aarch64_add_cfa_expression (rtx_insn *insn,
unsigned int reg,
void
aarch64_expand_prologue (void)
{
- aarch64_layout_frame ();
-
poly_int64 frame_size = cfun->machine->frame.frame_size;
poly_int64 initial_adjust = cfun->machine->frame.initial_adjust;
HOST_WIDE_INT callee_adjust = cfun->machine->frame.callee_adjust;
@@ -4964,8 +4957,6 @@ aarch64_use_return_insn_p (void)
if (crtl->profile)
return false;
- aarch64_layout_frame ();
-
return known_eq (cfun->machine->frame.frame_size, 0);
}
@@ -4977,8 +4968,6 @@ aarch64_use_return_insn_p (void)
void
aarch64_expand_epilogue (bool for_sibcall)
{
- aarch64_layout_frame ();
-
poly_int64 initial_adjust = cfun->machine->frame.initial_adjust;
HOST_WIDE_INT callee_adjust = cfun->machine->frame.callee_adjust;
poly_int64 final_adjust = cfun->machine->frame.final_adjust;
@@ -7525,8 +7514,6 @@ aarch64_can_eliminate (const int from
ATTRIBUTE_UNUSED, const int to)
poly_int64
aarch64_initial_elimination_offset (unsigned from, unsigned to)
{
- aarch64_layout_frame ();
-
if (to == HARD_FRAME_POINTER_REGNUM)
{
if (from == ARG_POINTER_REGNUM)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-07-20 9:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-09 11:58 [PATCH][AAarch64] Add support for TARGET_COMPUTE_FRAME_LAYOUT Vlad Lazar
2018-07-20 9:32 ` [PATCH][AAarch64][v2] " Vlad Lazar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).