diff options
author | Wilco Dijkstra <wdijkstr@arm.com> | 2017-11-08 15:36:34 +0000 |
---|---|---|
committer | Wilco Dijkstra <wilco@gcc.gnu.org> | 2017-11-08 15:36:34 +0000 |
commit | 6216fd904f46a11fa243195ee303560dc802958e (patch) | |
tree | 5042e527d2dd7e17df0bf83129d5005d43d2cc8b | |
parent | 7040939b9e2cbd084e6dbe015ee6cd2761aacf46 (diff) | |
download | gcc-6216fd904f46a11fa243195ee303560dc802958e.zip gcc-6216fd904f46a11fa243195ee303560dc802958e.tar.gz gcc-6216fd904f46a11fa243195ee303560dc802958e.tar.bz2 |
[AArch64] Simplify aarch64_can_eliminate
Simplify aarch64_can_eliminate - if we need a frame pointer, we must
eliminate to HARD_FRAME_POINTER_REGNUM. Rather than hardcoding all
combinations from the ELIMINABLE_REGS list, just do the correct check.
gcc/
* config/aarch64/aarch64.c (aarch64_can_eliminate): Simplify logic.
From-SVN: r254534
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 22 |
2 files changed, 9 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d39de6b..e546a12 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2017-11-08 Wilco Dijkstra <wdijkstr@arm.com> + * config/aarch64/aarch64.c (aarch64_can_eliminate): Simplify logic. + +2017-11-08 Wilco Dijkstra <wdijkstr@arm.com> + * config/aarch64/aarch64.c (aarch64_frame_pointer_required) Remove. (aarch64_layout_frame): Initialise emit_frame_chain. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index f58f192..0c67e2b 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -5913,26 +5913,14 @@ aarch64_secondary_reload (bool in_p ATTRIBUTE_UNUSED, rtx x, } static bool -aarch64_can_eliminate (const int from, const int to) +aarch64_can_eliminate (const int from ATTRIBUTE_UNUSED, const int to) { - /* If we need a frame pointer, we must eliminate FRAME_POINTER_REGNUM into - HARD_FRAME_POINTER_REGNUM and not into STACK_POINTER_REGNUM. */ + gcc_assert (from == ARG_POINTER_REGNUM || from == FRAME_POINTER_REGNUM); + /* If we need a frame pointer, ARG_POINTER_REGNUM and FRAME_POINTER_REGNUM + can only eliminate to HARD_FRAME_POINTER_REGNUM. */ if (frame_pointer_needed) - { - if (from == ARG_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM) - return true; - if (from == ARG_POINTER_REGNUM && to == STACK_POINTER_REGNUM) - return false; - if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM - && !cfun->calls_alloca) - return true; - if (from == FRAME_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM) - return true; - - return false; - } - + return to == HARD_FRAME_POINTER_REGNUM; return true; } |