This is the mail archive of the
mailing list for the GCC project.
Re: regs_used estimation in IVOPTS seriously flawed
- From: David Edelsohn <dje dot gcc at gmail dot com>
- To: Bingfeng Mei <bmei at broadcom dot com>, Aaron Sawdey <acsawdey at linux dot vnet dot ibm dot com>
- Cc: "Bin.Cheng" <amker dot cheng at gmail dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Fri, 20 Jun 2014 10:24:59 -0400
- Subject: Re: regs_used estimation in IVOPTS seriously flawed
- Authentication-results: sourceware.org; auth=none
- References: <B71DF1153024A14EABB94E39368E44A6042CA205 at SJEXCHMB13 dot corp dot ad dot broadcom dot com> <CAHFci29vqVpLZGqqi-PQ+8R0+ity+Qbp7VaO+ksQProj9BqJeA at mail dot gmail dot com> <B71DF1153024A14EABB94E39368E44A6042CAFB4 at SJEXCHMB13 dot corp dot ad dot broadcom dot com>
On Fri, Jun 20, 2014 at 5:01 AM, Bingfeng Mei <email@example.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,
> 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.