This is the mail archive of the
mailing list for the GCC project.
Re: Cost Calculation on Loop Invariant on Arithmetic operations on RTL
- From: Steven Bosscher <stevenb dot gcc at gmail dot com>
- To: Ajit Kumar Agarwal <ajit dot kumar dot agarwal at xilinx dot com>
- Cc: "vmakarov at redhat dot com" <vmakarov at redhat dot com>, Richard Biener <richard dot guenther at gmail dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Vinod Kathail <vinodk at xilinx dot com>, Shail Aditya Gupta <shailadi at xilinx dot com>, Vidhumouli Hunsigida <vidhum at xilinx dot com>, Nagaraju Mekala <nmekala at xilinx dot com>
- Date: Tue, 17 Feb 2015 11:43:49 +0100
- Subject: Re: Cost Calculation on Loop Invariant on Arithmetic operations on RTL
- Authentication-results: sourceware.org; auth=none
- References: <fd930a5bdd8943bc8e4750be871b8389 at BL2FFO11OLC002 dot protection dot gbl>
On Tue, Feb 17, 2015 at 9:45 AM, Ajit Kumar Agarwal wrote:
> Hello All:
> I can see the Loop invariant pass in the GCC on RTL considering the register pressure and the cost manipulation
> With respect to SET destination node in RTL.
> The Loop invariant takes care of only address arithmetic candidates of Loop invariance.
> In the function get_inv_cost, I can see the following check for the updation of comp_cost and the comp_cost
> Gets incremented with respect all the dependence on the def node of the invariant variable.
> If (!inv->cheap_address || inv-def->n_addr_uses < inv->def->n_uses)
> (*comp_cost += inv->cost + inv->eqno
> Is there any specific reasons of addr_uses less than the actual uses check for the address arithmetic candidate
> Of Loop invariant. I think we should be aggressive enough and can do the cost calculation without this check.
> One more point the above cost calculation should not be considering the register pressure_costs.
> Thoughts Please ?
When all is said and done, it's just a matter of what works best for
performance of the produced code. Heuristics and theory are often not
on the same page, even if the heuristics are "rationalized". You
should just try and see what the effects are if you change something.