Re: [PATCH][IRA,LRA] Fix PR87466, all pseudos live across setjmp are spilled

2018-10-04 Thread Peter Bergner
On 10/3/18 10:08 PM, Jeff Law wrote: > Given the desire for reload to die and the difficulties testing this > change on a reload target, I don't think mirroring this optimization in > reload is necessary. Right, it's good to have incentives to move away from reload to LRA. Maybe we could add a

Re: [PATCH][IRA,LRA] Fix PR87466, all pseudos live across setjmp are spilled

2018-10-03 Thread Vladimir Makarov
On 10/02/2018 02:51 PM, Peter Bergner wrote: On 10/2/18 1:21 PM, Segher Boessenkool wrote: On Tue, Oct 02, 2018 at 11:42:19AM -0500, Peter Bergner wrote: +/* The default implementation of TARGET_SETJMP_PRESERVES_NONVOLATILE_REGS_P. */ + +bool +default_setjmp_preserves_nonvolatile_regs_p

Re: [PATCH][IRA,LRA] Fix PR87466, all pseudos live across setjmp are spilled

2018-10-03 Thread Jeff Law
On 10/2/18 12:51 PM, Peter Bergner wrote: > On 10/2/18 1:21 PM, Segher Boessenkool wrote: >> On Tue, Oct 02, 2018 at 11:42:19AM -0500, Peter Bergner wrote: >>> +/* The default implementation of >>> TARGET_SETJMP_PRESERVES_NONVOLATILE_REGS_P. */ >>> + >>> +bool >>>

Re: [PATCH][IRA,LRA] Fix PR87466, all pseudos live across setjmp are spilled

2018-10-02 Thread Peter Bergner
On 10/2/18 1:21 PM, Segher Boessenkool wrote: > On Tue, Oct 02, 2018 at 11:42:19AM -0500, Peter Bergner wrote: >> +/* The default implementation of >> TARGET_SETJMP_PRESERVES_NONVOLATILE_REGS_P. */ >> + >> +bool >> +default_setjmp_preserves_nonvolatile_regs_p (void) >> +{ >> + return false; >>

Re: [PATCH][IRA,LRA] Fix PR87466, all pseudos live across setjmp are spilled

2018-10-02 Thread Peter Bergner
On 10/2/18 1:21 PM, Segher Boessenkool wrote: > Hi Peter, > > On Tue, Oct 02, 2018 at 11:42:19AM -0500, Peter Bergner wrote: >> +/* The default implementation of >> TARGET_SETJMP_PRESERVES_NONVOLATILE_REGS_P. */ >> + >> +bool >> +default_setjmp_preserves_nonvolatile_regs_p (void) >> +{ >> +

Re: [PATCH][IRA,LRA] Fix PR87466, all pseudos live across setjmp are spilled

2018-10-02 Thread Segher Boessenkool
Hi Peter, On Tue, Oct 02, 2018 at 11:42:19AM -0500, Peter Bergner wrote: > +/* The default implementation of TARGET_SETJMP_PRESERVES_NONVOLATILE_REGS_P. > */ > + > +bool > +default_setjmp_preserves_nonvolatile_regs_p (void) > +{ > + return false; > +} You can just use hook_bool_void_false for

Re: [PATCH][IRA,LRA] Fix PR87466, all pseudos live across setjmp are spilled

2018-10-02 Thread Peter Bergner
On 10/2/18 11:42 AM, Peter Bergner wrote: > On 10/1/18 4:25 AM, Eric Botcazou wrote: > This is currently bootstrapping right now, but ok for trunk assuming no > regressions? > > gcc/ > PR rtl-optimization/87466 > * target.def (setjmp_preserves_nonvolatile_regs_p): New target hook. >

Re: [PATCH][IRA,LRA] Fix PR87466, all pseudos live across setjmp are spilled

2018-10-02 Thread Peter Bergner
On 10/1/18 4:25 AM, Eric Botcazou wrote: >> Since all implementations of this hook will have to do the same, I think >> it is better if you leave this test at the (only two) callers. The hook >> doesn't need an argument then, and maybe is better named something like >> setjmp_is_normal_call?

Re: [PATCH][IRA,LRA] Fix PR87466, all pseudos live across setjmp are spilled

2018-10-01 Thread Segher Boessenkool
On Mon, Oct 01, 2018 at 11:25:21AM +0200, Eric Botcazou wrote: > > Since all implementations of this hook will have to do the same, I think > > it is better if you leave this test at the (only two) callers. The hook > > doesn't need an argument then, and maybe is better named something like > >

Re: [PATCH][IRA,LRA] Fix PR87466, all pseudos live across setjmp are spilled

2018-10-01 Thread Eric Botcazou
> Since all implementations of this hook will have to do the same, I think > it is better if you leave this test at the (only two) callers. The hook > doesn't need an argument then, and maybe is better named something like > setjmp_is_normal_call? (The original code did not test CALL_P btw).

Re: [PATCH][IRA,LRA] Fix PR87466, all pseudos live across setjmp are spilled

2018-10-01 Thread Segher Boessenkool
Hi Peter, On Fri, Sep 28, 2018 at 10:12:02PM -0500, Peter Bergner wrote: > Currently, both IRA and LRA spill all pseudo regs that are live across a > setjmp call. If the target has a sane setjmp, then the compiler should not > have to treat the setjmp call any differently than is does any other

Re: [PATCH][IRA,LRA] Fix PR87466, all pseudos live across setjmp are spilled

2018-10-01 Thread Richard Biener
On Sat, Sep 29, 2018 at 5:12 AM Peter Bergner wrote: > > Currently, both IRA and LRA spill all pseudo regs that are live across a > setjmp call. If the target has a sane setjmp, then the compiler should not > have to treat the setjmp call any differently than is does any other normal > function

[PATCH][IRA,LRA] Fix PR87466, all pseudos live across setjmp are spilled

2018-09-28 Thread Peter Bergner
Currently, both IRA and LRA spill all pseudo regs that are live across a setjmp call. If the target has a sane setjmp, then the compiler should not have to treat the setjmp call any differently than is does any other normal function call. Namely, just mark all pseudos that are live across the