This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [Patch] OPT: Update heuristics for loop-invariant for address arithmetic.



-----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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]