Re: [patch] split FRAME variables back into pieces

2012-09-22 Thread Eric Botcazou
> Well, the current code assumes that the replacements are gimple > register types and, perhaps more importantly, it assumes there are no > to-be-replaced pieces within to-be-replaced pieces. If we were to put > a structure outside of a frame structure and scalarize some field > within it at the s

Re: [patch] split FRAME variables back into pieces

2012-09-21 Thread Martin Jambor
On Fri, Sep 21, 2012 at 01:32:25PM +0200, Richard Guenther wrote: ... > Yes, most of the SRA heuristic games make it complicated and ugly, > especially as it is isn't clearly separate analysis / decision / transform > phases. TLC welcome ;) > While I agree that the heuristics of SRA is surpris

Re: [patch] split FRAME variables back into pieces

2012-09-21 Thread Martin Jambor
Hi, On Fri, Sep 21, 2012 at 12:48:16PM +0200, Eric Botcazou wrote: > ... > > As of doing it in SRA what I'd do there is special-case FRAME for both > > candidate consideration (so you get around the addressable issue) > > and replacement generation. > > OK, but you need to be able to split the

Re: [patch] split FRAME variables back into pieces

2012-09-21 Thread Richard Guenther
On Fri, Sep 21, 2012 at 12:48 PM, Eric Botcazou wrote: >> You rely on being able to see all FRAME accesses as component refs, >> thus nothing transforms them into just MEM[&FRAME, offset]. That's of >> course something that can be easily "broken" by means of doing >> some pointer arithmetic like

Re: [patch] split FRAME variables back into pieces

2012-09-21 Thread Eric Botcazou
> You rely on being able to see all FRAME accesses as component refs, > thus nothing transforms them into just MEM[&FRAME, offset]. That's of > course something that can be easily "broken" by means of doing > some pointer arithmetic like (untested, but you get the idea) > > foo() > { > int c[32

Re: [patch] split FRAME variables back into pieces

2012-09-20 Thread Richard Guenther
On Thu, Sep 20, 2012 at 12:56 PM, Eric Botcazou wrote: >> I really don't like this to be done outside of SRA (and it is written in a >> non-MEM_REF way). > > Could you elaborate on the latter point? If it can be improved, even in its > current form... You rely on being able to see all FRAME acce

Re: [patch] split FRAME variables back into pieces

2012-09-20 Thread Eric Botcazou
> I really don't like this to be done outside of SRA (and it is written in a > non-MEM_REF way). Could you elaborate on the latter point? If it can be improved, even in its current form... > For the testcase in question we scalarize back > 'i' in SRA (other scalars are optimized away already, b

Re: [patch] split FRAME variables back into pieces

2012-09-19 Thread Jakub Jelinek
On Wed, Sep 19, 2012 at 01:36:50PM +0200, Richard Guenther wrote: > On Wed, Sep 19, 2012 at 12:58 PM, Eric Botcazou wrote: > I really don't like this to be done outside of SRA (and it is written in a > non-MEM_REF way). For the testcase in question we scalarize back > 'i' in SRA (other scalars ar

Re: [patch] split FRAME variables back into pieces

2012-09-19 Thread Richard Guenther
On Wed, Sep 19, 2012 at 12:58 PM, Eric Botcazou wrote: > Hi, > > this transformation has been in our tree for a couple of years and was > originally developed for SPARKSkein (http://www.skein-hash.info/node/48), > which is the implementation in SPARK (subset of Ada) of the Skein algorithm. > > Whe

[patch] split FRAME variables back into pieces

2012-09-19 Thread Eric Botcazou
Hi, this transformation has been in our tree for a couple of years and was originally developed for SPARKSkein (http://www.skein-hash.info/node/48), which is the implementation in SPARK (subset of Ada) of the Skein algorithm. When nested functions access local variables of their parent, the com