[AArch64] Enable shrink wrapping.

From-SVN: r215508
This commit is contained in:
Renlin Li 2014-09-23 12:38:37 +00:00 committed by Marcus Shawcroft
parent de72c50f4c
commit 4f9427792e
8 changed files with 50 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2014-09-23 Renlin Li <renlin.li@arm.com>
* config/aarch64/aarch64.md (return): New.
(simple_return): Likewise.
* config/aarch64/aarch64.c (aarch64_use_return_insn_p): New.
* config/aarch64/aarch64-protos.h (aarch64_use_return_insn_p): New.
2014-09-23 Wilco Dijkstra <wdijkstr@arm.com>
* common/config/aarch64/aarch64-common.c:

View File

@ -213,6 +213,7 @@ bool aarch64_simd_valid_immediate (rtx, enum machine_mode, bool,
struct simd_immediate_info *);
bool aarch64_symbolic_address_p (rtx);
bool aarch64_uimm12_shift (HOST_WIDE_INT);
bool aarch64_use_return_insn_p (void);
const char *aarch64_output_casesi (rtx *);
const char *aarch64_rewrite_selected_cpu (const char *name);

View File

@ -2340,6 +2340,26 @@ aarch64_expand_prologue (void)
}
}
/* Return TRUE if we can use a simple_return insn.
This function checks whether the callee saved stack is empty, which
means no restore actions are need. The pro_and_epilogue will use
this to check whether shrink-wrapping opt is feasible. */
bool
aarch64_use_return_insn_p (void)
{
if (!reload_completed)
return false;
if (crtl->profile)
return false;
aarch64_layout_frame ();
return cfun->machine->frame.frame_size == 0;
}
/* Generate the epilogue instructions for returning from a function. */
void
aarch64_expand_epilogue (bool for_sibcall)

View File

@ -360,6 +360,19 @@
[(set_attr "type" "branch")]
)
(define_expand "return"
[(simple_return)]
"aarch64_use_return_insn_p ()"
""
)
(define_insn "simple_return"
[(simple_return)]
""
"ret"
[(set_attr "type" "branch")]
)
(define_insn "eh_return"
[(unspec_volatile [(match_operand:DI 0 "register_operand" "r")]
UNSPECV_EH_RETURN)]

View File

@ -1,3 +1,9 @@
2014-09-24 Renlin Li <renlin.li@arm.com>
* gcc.dg/ira-shrinkwrap-prep-1.c: Enable aarch64.
* gcc.dg/ira-shrinkwrap-prep-2.c: Likewise.
* gcc.dg/pr10474.c: Likewise.
2014-09-20 Mark Wielaard <mjw@redhat.com>
* gcc.dg/guality/const-volatile.c (i): Mark as used.

View File

@ -1,4 +1,4 @@
/* { dg-do compile { target { { x86_64-*-* && lp64 } || { { powerpc*-*-* && lp64 } || arm_nothumb } } } } */
/* { dg-do compile { target { { x86_64-*-* && lp64 } || { { powerpc*-*-* && lp64 } || { arm_nothumb || { aarch64*-*-* && lp64 } } } } } } */
/* { dg-options "-O3 -fdump-rtl-ira -fdump-rtl-pro_and_epilogue -fno-use-caller-save" } */
long __attribute__((noinline, noclone))

View File

@ -1,4 +1,4 @@
/* { dg-do compile { target { { x86_64-*-* && lp64 } || { { powerpc*-*-* && lp64 } || arm_nothumb } } } } */
/* { dg-do compile { target { { x86_64-*-* && lp64 } || { { powerpc*-*-* && lp64 } || { arm_nothumb || { aarch64*-*-* && lp64 } } } } } } */
/* { dg-options "-O3 -fdump-rtl-ira -fdump-rtl-pro_and_epilogue -fno-use-caller-save" } */
long __attribute__((noinline, noclone))

View File

@ -1,4 +1,4 @@
/* { dg-do compile { target { { x86_64-*-* && lp64 } || { { powerpc*-*-* && lp64 } || arm_nothumb } } } } */
/* { dg-do compile { target { { x86_64-*-* && lp64 } || { { powerpc*-*-* && lp64 } || { arm_nothumb || { aarch64*-*-* && lp64 } } } } } } */
/* { dg-options "-O3 -fdump-rtl-pro_and_epilogue" } */
void f(int *i)