diff mbox

rs6000: Fix shrink-wrap-separate for AIX

Message ID CAGWvnymrHV6hg_nUB7xJLq6JOghb0GU1_f2Xp8rZmUDimrCsMA@mail.gmail.com
State New
Headers show

Commit Message

David Edelsohn Oct. 16, 2016, 12:37 p.m. UTC
On Sat, Oct 15, 2016 at 2:16 PM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> On Sat, Oct 15, 2016 at 07:55:47AM -0400, David Edelsohn wrote:
>> Maybe rs6000 always should prefer inline save-restore when SWS is
>> enabled, except for optimize_size?
>
> Yes, that would be a good optimization probably.
>
> try_shrink_wrapping_separate already does nothing unless you have
> optimize_function_for_speed_p (cfun), so that will do what you want
> already.

Maybe something like the following:

* config/rs6000/rs6000.c (rs6000_savres_strategy) [AIX,ELFv2]: Inline
FPR save and restore if shrink-wrapping and not optimizing for size.


Thanks, David

Comments

Segher Boessenkool Oct. 17, 2016, 12:33 p.m. UTC | #1
On Sun, Oct 16, 2016 at 08:37:30AM -0400, David Edelsohn wrote:
> Maybe something like the following:
> 
> * config/rs6000/rs6000.c (rs6000_savres_strategy) [AIX,ELFv2]: Inline
> FPR save and restore if shrink-wrapping and not optimizing for size.
> 
> Index: rs6000.c
> ===================================================================
> --- rs6000.c    (revision 241210)
> +++ rs6000.c    (working copy)
> @@ -25445,7 +25445,8 @@
>    else
>      {
>        gcc_checking_assert (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2);
> -      if (info->first_fp_reg_save > 61)
> +      if ((!optimize_size && flag_shrink_wrap_separate)
> +         || info->first_fp_reg_save > 61)
>         strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS;
>        strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS;
>        strategy |= SAVE_INLINE_VRS | REST_INLINE_VRS;
> 

With "optimize_function_for_speed_p (cfun)" (like you found out yourself
already), that looks fine to me.

Thanks,


Segher
diff mbox

Patch

Index: rs6000.c
===================================================================
--- rs6000.c    (revision 241210)
+++ rs6000.c    (working copy)
@@ -25445,7 +25445,8 @@ 
   else
     {
       gcc_checking_assert (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2);
-      if (info->first_fp_reg_save > 61)
+      if ((!optimize_size && flag_shrink_wrap_separate)
+         || info->first_fp_reg_save > 61)
        strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS;
       strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS;
       strategy |= SAVE_INLINE_VRS | REST_INLINE_VRS;