public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [AArch64/GCC][15/N] Add two new frame fields
@ 2014-07-22 14:52 Jiong Wang
  2014-07-24 14:45 ` Marcus Shawcroft
  0 siblings, 1 reply; 2+ messages in thread
From: Jiong Wang @ 2014-07-22 14:52 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 636 bytes --]

Add two new frame fields:

   * cfun->machine->frame.wb_candidate1
   * cfun->machine->frame.wb_candidate2
    
* wb_candidate1 to record the first reg index which
   could carry write-back.
* wb_candidate2 to record the second reg index which
   could form reg pair with
* wb_candidate1 to carry write-back when doing paired
   load/store.

They are useful in later pro/epi optimization.

*no functional change*

ok to install?

thanks.

gcc/
   * config/aarch64/aarch64.h (frame): New fields "wb_candidate1" and "wb_candidate2".
   * config/aarch64/aarch64.c (aarch64_layout_frame): Calcualte new added fields.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0015-AArch64-GCC-16-20-Add-two-new-frame-fields.patch --]
[-- Type: text/x-patch;  name=0015-AArch64-GCC-16-20-Add-two-new-frame-fields.patch, Size: 3589 bytes --]

From 1272a5bcbb7978452cef1d0da507500c459031c5 Mon Sep 17 00:00:00 2001
From: Jiong Wang <jiong.wang@arm.com>
Date: Tue, 17 Jun 2014 22:21:44 +0100
Subject: [PATCH 15/19] [AArch64/GCC][16/20] Add two new frame fields

Add two new frame fields:

  * cfun->machine->frame.wb_candidate1
  * cfun->machine->frame.wb_candidate2

wb_candidate1 to record the first reg index which could carry write-back.
wb_candidate2 to record the second reg index which could form reg pair with
wb_candidate1 to carry write-back when doing paired load/store.

They are useful in later pro/epi optimization.

*no functional change*

2014-06-16  Jiong Wang <jiong.wang@arm.com>
	    Marcus Shawcroft  <marcus.shawcroft@arm.com>

gcc/
  * config/aarch64/aarch64.h (frame): New fields "wb_candidate1" and
  "wb_candidate2".
  * config/aarch64/aarch64.c (aarch64_layout_frame): Calcualte new added fields.
---
 gcc/config/aarch64/aarch64.c |   14 ++++++++++++++
 gcc/config/aarch64/aarch64.h |    3 +++
 2 files changed, 17 insertions(+)

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 65a84e8..a6b253a 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -1815,6 +1815,9 @@ aarch64_layout_frame (void)
 #define SLOT_NOT_REQUIRED (-2)
 #define SLOT_REQUIRED     (-1)
 
+  cfun->machine->frame.wb_candidate1 = FIRST_PSEUDO_REGISTER;
+  cfun->machine->frame.wb_candidate2 = FIRST_PSEUDO_REGISTER;
+
   /* First mark all the registers that really need to be saved...  */
   for (regno = R0_REGNUM; regno <= R30_REGNUM; regno++)
     cfun->machine->frame.reg_offset[regno] = SLOT_NOT_REQUIRED;
@@ -1843,7 +1846,9 @@ aarch64_layout_frame (void)
     {
       /* FP and LR are placed in the linkage record.  */
       cfun->machine->frame.reg_offset[R29_REGNUM] = 0;
+      cfun->machine->frame.wb_candidate1 = R29_REGNUM;
       cfun->machine->frame.reg_offset[R30_REGNUM] = UNITS_PER_WORD;
+      cfun->machine->frame.wb_candidate2 = R30_REGNUM;
       cfun->machine->frame.hardfp_offset = 2 * UNITS_PER_WORD;
       offset += 2 * UNITS_PER_WORD;
     }
@@ -1853,6 +1858,10 @@ aarch64_layout_frame (void)
     if (cfun->machine->frame.reg_offset[regno] == SLOT_REQUIRED)
       {
 	cfun->machine->frame.reg_offset[regno] = offset;
+	if (cfun->machine->frame.wb_candidate1 == FIRST_PSEUDO_REGISTER)
+	  cfun->machine->frame.wb_candidate1 = regno;
+	else if (cfun->machine->frame.wb_candidate2 == FIRST_PSEUDO_REGISTER)
+	  cfun->machine->frame.wb_candidate2 = regno;
 	offset += UNITS_PER_WORD;
       }
 
@@ -1860,6 +1869,11 @@ aarch64_layout_frame (void)
     if (cfun->machine->frame.reg_offset[regno] == SLOT_REQUIRED)
       {
 	cfun->machine->frame.reg_offset[regno] = offset;
+	if (cfun->machine->frame.wb_candidate1 == FIRST_PSEUDO_REGISTER)
+	  cfun->machine->frame.wb_candidate1 = regno;
+	else if (cfun->machine->frame.wb_candidate2 == FIRST_PSEUDO_REGISTER
+		 && cfun->machine->frame.wb_candidate1 >= V0_REGNUM)
+	  cfun->machine->frame.wb_candidate2 = regno;
 	offset += UNITS_PER_WORD;
       }
 
diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
index b95365a..ee70a18 100644
--- a/gcc/config/aarch64/aarch64.h
+++ b/gcc/config/aarch64/aarch64.h
@@ -542,6 +542,9 @@ struct GTY (()) aarch64_frame
    * frame (incomming SP) to the stack_pointer.  This value is always
    * a multiple of STACK_BOUNDARY.  */
 
+  unsigned wb_candidate1;
+  unsigned wb_candidate2;
+
   HOST_WIDE_INT frame_size;
 
   bool laid_out;
-- 
1.7.9.5



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [AArch64/GCC][15/N] Add two new frame fields
  2014-07-22 14:52 [AArch64/GCC][15/N] Add two new frame fields Jiong Wang
@ 2014-07-24 14:45 ` Marcus Shawcroft
  0 siblings, 0 replies; 2+ messages in thread
From: Marcus Shawcroft @ 2014-07-24 14:45 UTC (permalink / raw)
  To: Jiong Wang; +Cc: gcc-patches

On 22 July 2014 15:52, Jiong Wang <jiong.wang@arm.com> wrote:

> gcc/
>   * config/aarch64/aarch64.h (frame): New fields "wb_candidate1" and
> "wb_candidate2".
>   * config/aarch64/aarch64.c (aarch64_layout_frame): Calcualte new added
> fields.

OK and applied.
/Marcus

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-24 14:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-22 14:52 [AArch64/GCC][15/N] Add two new frame fields Jiong Wang
2014-07-24 14:45 ` Marcus Shawcroft

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).