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 try and we will see after re-tunning how well it works. > > Diagonal walk > > of multi-dimensional array, i.e. a[b][b][b] will be mis-accounted, too, > > right? > > Other problem I see is how to account this in the inliner. At the moment I > have > > call (a,b,c) > to be cost of the edge and if we inline the cost disappear completely, but > call (a[b],c) > have the address calculation not accounted to the edge (since inlining does > not > eliminate it), just the call itself accounted. With the change we will not > know if the parameters are simple SSA names or something non-trivial.
Well, to precisely handle the cost you'd need to split call cost into call setup cost and call cost. The current code doesn't handle it precise either, it just accounts move cost per argument. But yes, it would bias things quite a bit in some cases. But so would your patch. Richard.