Re: [RFC] Move ehcleanup pass to before early SRA

2014-01-16 Thread Richard Biener
On Wed, Jan 15, 2014 at 6:37 PM, Eric Botcazou wrote: >> I know, I'm saying it may be possible to implement an equivalent >> optimization without SSA form. > > Sure, but what would be the point of this duplication exactly? To avoid ... >> I'm saying even ESRA should be able to scalarize it just

Re: [RFC] Move ehcleanup pass to before early SRA

2014-01-15 Thread Martin Jambor
Hi, On Wed, Jan 15, 2014 at 06:37:30PM +0100, Eric Botcazou wrote: > > I know, I'm saying it may be possible to implement an equivalent > > optimization without SSA form. > > Sure, but what would be the point of this duplication exactly? > > > I'm saying even ESRA should be able to scalarize it

Re: [RFC] Move ehcleanup pass to before early SRA

2014-01-15 Thread Eric Botcazou
> I know, I'm saying it may be possible to implement an equivalent > optimization without SSA form. Sure, but what would be the point of this duplication exactly? > I'm saying even ESRA should be able to scalarize it just fine. It just > needs to be careful where to insert the loads from the agg

Re: [RFC] Move ehcleanup pass to before early SRA

2014-01-15 Thread Martin Jambor
Hi, On Wed, Jan 15, 2014 at 03:39:09PM +0100, Richard Biener wrote: > On Wed, Jan 15, 2014 at 1:06 PM, Eric Botcazou wrote: > > Yes, it's scalarized during SRA but not ESRA because there is an ehcleanup > > pass in-between. It used to be scalarized during ESRA up to 4.6.x. > > I'm saying even E

Re: [RFC] Move ehcleanup pass to before early SRA

2014-01-15 Thread Richard Biener
On Wed, Jan 15, 2014 at 1:06 PM, Eric Botcazou wrote: >> What you want is tree-eh.c:optimize_clobbers, right? Can't we >> do this optimization during EH refactoring / lowering as well? > > We need the SSA form for sink_clobbers. I know, I'm saying it may be possible to implement an equivalent op

Re: [RFC] Move ehcleanup pass to before early SRA

2014-01-15 Thread Eric Botcazou
> What you want is tree-eh.c:optimize_clobbers, right? Can't we > do this optimization during EH refactoring / lowering as well? We need the SSA form for sink_clobbers. > Also why does SRA refuse to scalarize here? Because of the EH handler and the following predicate: /* Disqualify LHS and RH

Re: [RFC] Move ehcleanup pass to before early SRA

2014-01-15 Thread Richard Biener
On Wed, Jan 15, 2014 at 10:24 AM, Eric Botcazou wrote: > Hi, > > we have run into optimization regressions in Ada caused by the interaction > between the GIMPLE clobbers and SRA: on the one hand GIMPLE clobbers create > artificial EH handlers for aggregate variables, on the other hand SRA refuses

[RFC] Move ehcleanup pass to before early SRA

2014-01-15 Thread Eric Botcazou
Hi, we have run into optimization regressions in Ada caused by the interaction between the GIMPLE clobbers and SRA: on the one hand GIMPLE clobbers create artificial EH handlers for aggregate variables, on the other hand SRA refuses to scalarize objects that appear in a statement that can throw

Re: [RFC] Move ehcleanup pass to before early SRA

2012-09-24 Thread Richard Guenther
On Sun, Sep 23, 2012 at 10:46 AM, Eric Botcazou wrote: > Hi, > > we have run into optimization regressions in Ada caused by the interaction > between the new GIMPLE clobbers and SRA: on the one hand GIMPLE clobbers > create artificial EH handlers for aggregate variables, on the other hand SRA > re

[RFC] Move ehcleanup pass to before early SRA

2012-09-23 Thread Eric Botcazou
Hi, we have run into optimization regressions in Ada caused by the interaction between the new GIMPLE clobbers and SRA: on the one hand GIMPLE clobbers create artificial EH handlers for aggregate variables, on the other hand SRA refuses to scalarize objects that appear in a statement that can t