This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [Patch] OPT: Update heuristics for loop-invariant for address arithmetic.
- From: Ajit Kumar Agarwal <ajit dot kumar dot agarwal at xilinx dot com>
- To: Richard Sandiford <rdsandiford at googlemail dot com>
- Cc: "vmakarov at redhat dot com" <vmakarov at redhat dot com>, GCC Patches <gcc-patches 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: Fri, 24 Apr 2015 08:38:02 +0000
- Subject: RE: [Patch] OPT: Update heuristics for loop-invariant for address arithmetic.
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; gcc.gnu.org; dkim=none (message not signed) header.d=none;
- References: <d3236939cb3e4429881fed98dbc192fe at BN1AFFO11FD054 dot protection dot gbl> <87zj5yu0e4 dot fsf at googlemail dot com>
-----Original Message-----
From: Richard Sandiford [mailto:rdsandiford@googlemail.com]
Sent: Friday, April 24, 2015 12:40 AM
To: Ajit Kumar Agarwal
Cc: vmakarov@redhat.com; GCC Patches; Vinod Kathail; Shail Aditya Gupta; Vidhumouli Hunsigida; Nagaraju Mekala
Subject: Re: [Patch] OPT: Update heuristics for loop-invariant for address arithmetic.
Very delayed answer, sorry...
Ajit Kumar Agarwal <ajit.kumar.agarwal@xilinx.com> writes:
> Hello All:
>
> The changes are made in the patch to update the heuristics for loop
> invariant for address arithemetic at RTL Level. The heuristics are
> updated with the consideration of single def and use for register
> pressure calculation instead Of ignoring it and also to update the
> estimated register pressure cost along with the check of actual uses
> with Address uses.
>
> With the above change, gains are seen in the Geomean for Mibench/EEMBC
> benchmarks for microblaze target. No Regression is seen in deja GNU
> regressions tests for microblaze.
>>Since thispatch is basically removing code, were you able to analyse why that code was having a detrimental effect? I assume it benefited some target ??>>originally.
This patch modified the estimated register pressure cost for non ira based register pressure(flag_ira_loop_pressure is not set).
Following changes were made in the estimated register pressure cost.
size_cost = (estimate_reg_pressure_cost (new_regs[0] + regs_needed[0],
regs_used, speed, call_p)
- estimate_reg_pressure_cost (new_regs[0],
regs_used, speed, call_p));
is changed to
size_cost = estimate_reg_pressure_cost (regs_needed[0],
regs_used, speed, call_p);
This looks reasonable change for the estimated_reg_pressure_cost calculation. The other changes I have made, For the single use for the given
Def the current code does not include such invariants in the register pressure calculation which I have enabled including the single use for the
Given def for the register pressure calculation. Though the comment in the code says that there won't be a new register for single use after moving,
But moving such invariants outside the loop will affect the register pressures as the spans of the live range after moving out of loops differs from
The original loop. Since the Live range spans varies such cases should surely affect the registers pressure.
The above explanation looks reasonable and the code that does not include such invariants into register pressure is removed in the patch.
I don't any see background or the patches in the past that explicit made the above check as part of any performance improvement or bug fix.
Thanks & Regards
Ajit
Thanks,
Richard