Re: Fix estimation of array accesses

2012-10-30 Thread Richard Biener
On Mon, 29 Oct 2012, Jan Hubicka wrote: > > > ICK ... > > > > > > Why not sth as simple as > > > > > > return num_ssa_operands (stmt, SSA_OP_USE); > > > > > > ? a[1][2] and b[2] really have the same cost, variable length > > > objects have extra SSA operands in ARRAY_REF/COMPONENT_REF for

Re: Fix estimation of array accesses

2012-10-29 Thread Jan Hubicka
> > ICK ... > > > > Why not sth as simple as > > > > return num_ssa_operands (stmt, SSA_OP_USE); > > > > ? a[1][2] and b[2] really have the same cost, variable length > > objects have extra SSA operands in ARRAY_REF/COMPONENT_REF for > > the size. Thus, stmt cost somehow should reflect th

Re: Fix estimation of array accesses

2012-10-29 Thread Jan Hubicka
> ICK ... > > Why not sth as simple as > > return num_ssa_operands (stmt, SSA_OP_USE); > > ? a[1][2] and b[2] really have the same cost, variable length > objects have extra SSA operands in ARRAY_REF/COMPONENT_REF for > the size. Thus, stmt cost somehow should reflect the number > of depe

Re: Fix estimation of array accesses

2012-10-25 Thread Richard Biener
On Thu, 25 Oct 2012, Jan Hubicka wrote: > Hi, > while looking into cunroll issues I noticed that we miss quite lot of > important unrolling > at -O2 for EON because we think it will increase code size. This is because > we do not > account the fact that making array index constant is good thing

Re: Fix estimation of array accesses

2012-10-25 Thread Richard Biener
On Thu, 25 Oct 2012, Jan Hubicka wrote: > > Hmm, also in ASM/call/return? It will definitely make quite a fuzz into > > the cost metric > > by making a=b+c to have cost of 3 instead of 1 as it have now. I am not > > 100% sure if > > a+b should be more expensive than a+1. > > I can give that a

Re: Fix estimation of array accesses

2012-10-25 Thread Richard Biener
On Thu, 25 Oct 2012, Jan Hubicka wrote: > > > +/* For operands of load/stores estimate cost of the address computations > > > + involved. */ > > > + > > > +static int > > > +estimate_operand_cost (tree op) > > > +{ > > > + int cost = 0; > > > + while (handled_component_p (op)) > > > +{ >

Re: Fix estimation of array accesses

2012-10-25 Thread Jan Hubicka
> Hmm, also in ASM/call/return? It will definitely make quite a fuzz into the > cost metric > by making a=b+c to have cost of 3 instead of 1 as it have now. I am not 100% > sure if > a+b should be more expensive than a+1. > I can give that a try and we will see after re-tunning how well it work

Re: Fix estimation of array accesses

2012-10-25 Thread Jan Hubicka
> > +/* For operands of load/stores estimate cost of the address computations > > + involved. */ > > + > > +static int > > +estimate_operand_cost (tree op) > > +{ > > + int cost = 0; > > + while (handled_component_p (op)) > > +{ > > + cost += estimate_ref_cost (op); > > + op = TR

Re: Fix estimation of array accesses

2012-10-25 Thread Richard Biener
On Thu, 25 Oct 2012, Jan Hubicka wrote: > Hi, > while looking into cunroll issues I noticed that we miss quite lot of > important unrolling > at -O2 for EON because we think it will increase code size. This is because > we do not > account the fact that making array index constant is good thing