Hi!

On Thu, Jul 23, 2020 at 01:42:59PM -0600, Jeff Law wrote:
> On Thu, 2020-07-23 at 14:25 -0500, Pat Haugen via Gcc-patches wrote:
> > Disable -fcaller-saves by default.
> > 
> > This patch turns off -fcaller-saves by default so that IRA doesn't try
> > to use volatile regs for pseudos that are live across a call, which
> > would then require LRA to save/restore the reg around the call.

> > 2020-07-23  Pat Haugen  <pthau...@linux.ibm.com>
> > 
> > gcc/
> >     * common/config/rs6000/rs6000-common.c
> >     (rs6000_option_optimization_table): Turn off -fcaller-saves.
> > 
> > gcc/testsuite/
> >     * gcc.target/powerpc/caller-saves.c: New.

> What's driving this change?

Peter noticed IRA allocates stuff to volatile registers while it is life
through a call, and then LRA has to correct that, not optimal.

> IRA will do a cost/benefit analysis to see using call clobbered registers like
> this is profitable or not.  You're just turning the whole thing off.

'-fcaller-saves'
     Enable allocation of values to registers that are clobbered by
     function calls, by emitting extra instructions to save and restore
     the registers around such calls.  Such allocation is done only when
     it seems to result in better code.

     This option is always enabled by default on certain machines,
     usually those which have no call-preserved registers to use
     instead.

So, given what Peter saw, the analysis when to do or not do this isn't
as good as could be hoped for.

> This can be particularly bad for performance if you have classes with no call
> saved registers.

Do we though?  Well, "d" for vectors, but there shouldn't be insns that
require that?


Segher

Reply via email to