diff mbox

[ARM] emit LDRD epilogue instead of a single LDM return

Message ID 000401ce3b6d$313d2d50$93b787f0$@yorsh@arm.com
State New
Headers show

Commit Message

Greta Yorsh April 17, 2013, 1:12 p.m. UTC
Currently, epilogue is not generated in RTL for function that can return
using a single instruction. This patch enables RTL epilogue for such
functions on targets that can benefit from using a sequence of LDRD
instructions in epilogue instead of a single LDM instruction.

No regression on qemu arm-none-eabi with cortex-a15.

Ok for trunk?

Thanks,
Greta

gcc/

2012-10-19  Greta Yorsh  <Greta.Yorsh at arm.com>

        * config/arm/arm.c (use_return_insn): Return 0 for targets that
        can benefit from using a sequence of LDRD instructions in epilogue
        instead of a single LDM instruction.

Comments

Richard Earnshaw April 17, 2013, 3:02 p.m. UTC | #1
On 17/04/13 14:12, Greta Yorsh wrote:
> Currently, epilogue is not generated in RTL for function that can return
> using a single instruction. This patch enables RTL epilogue for such
> functions on targets that can benefit from using a sequence of LDRD
> instructions in epilogue instead of a single LDM instruction.
>
> No regression on qemu arm-none-eabi with cortex-a15.
>
> Ok for trunk?
>
> Thanks,
> Greta
>
> gcc/
>
> 2012-10-19  Greta Yorsh  <Greta.Yorsh at arm.com>
>
>          * config/arm/arm.c (use_return_insn): Return 0 for targets that
>          can benefit from using a sequence of LDRD instructions in epilogue
>          instead of a single LDM instruction.
>

OK.

R.
diff mbox

Patch

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 866385c..bca92af 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -2296,6 +2296,10 @@  use_return_insn (int iscond, rtx sibling)
   if (IS_INTERRUPT (func_type) && (frame_pointer_needed || TARGET_THUMB))
     return 0;
 
+  if (TARGET_LDRD && current_tune->prefer_ldrd_strd
+      && !optimize_function_for_size_p (cfun))
+    return 0;
+
   offsets = arm_get_frame_offsets ();
   stack_adjust = offsets->outgoing_args - offsets->saved_regs;