On Fri, Jun 20, 2014 at 5:01 AM, Bingfeng Mei <b...@broadcom.com> wrote:
> As a short term solution, I tried some simple non-linear functions as Richard > suggested > to penalize using too many IVs. For example, the following cost in > ivopts_global_cost_for_size fixed my regression and actually improves > performance > slightly over a set of benchmarks we usually use. > > return size * (1 + size * 0.2) > + estimate_reg_pressure_cost (size, data->regs_used, data->speed, > > data->body_includes_call); > > The trouble is choice of this non-linear function could be highly target > dependent > (# of registers?). I don't have setup to prove performance gain for other > targets. > > I also tried counting all SSA names and divide it by a factor. It does seem > to work > so well. > > Long term, if we have infrastructure to analyze maximal live variable in a > loop > at tree-level, that would be great for many loop optimizations. I assume that you are going to parameterize the scaling so that it can be tuned for each target. Maybe Aaron's live range approximation can improve the estimate. - David