aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/aarch64
diff options
context:
space:
mode:
authorJiong Wang <jiong.wang@arm.com>2014-07-24 14:32:54 +0000
committerMarcus Shawcroft <mshawcroft@gcc.gnu.org>2014-07-24 14:32:54 +0000
commit363ffa50f1394a6eaaa137f7c5e63084b9fd4226 (patch)
tree782410cc95e4e2adb2f82a4eb489ea33471016d9 /gcc/config/aarch64
parent51705ec128f47bf0bc7615aa5b72445c45fd1657 (diff)
downloadgcc-363ffa50f1394a6eaaa137f7c5e63084b9fd4226.zip
gcc-363ffa50f1394a6eaaa137f7c5e63084b9fd4226.tar.gz
gcc-363ffa50f1394a6eaaa137f7c5e63084b9fd4226.tar.bz2
[AArch64] Extend frame state to track WB candidates.
From-SVN: r212996
Diffstat (limited to 'gcc/config/aarch64')
-rw-r--r--gcc/config/aarch64/aarch64.c14
-rw-r--r--gcc/config/aarch64/aarch64.h3
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 3457051..37fae93 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -1818,6 +1818,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;
@@ -1846,7 +1849,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;
}
@@ -1856,6 +1861,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;
}
@@ -1863,6 +1872,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 080b23f..db950da 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;