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]

[RFC, Patch]: Optimized changes in the register used inside loop for LICM and IVOPTS.


Following Proposed:

Changes are done in the Loop Invariant(LICM) at RTL level and also the Induction variable optimization based on SSA representation. 
The current logic used in LICM for register used inside the loops is changed. The Live Out of the loop latch node and the Live in of the 
destination of the exit nodes is used to set the Loops Liveness at the exit of the Loop. The register used is the number of live variables 
at the exit of the Loop calculated above.

For Induction variable optimization on tree SSA representation, the register used logic is based on the number of phi nodes at the loop 
header to represent the liveness at the loop. Current Logic used only the number of phi nodes at the loop header. I have made changes
 to represent the phi operands also live at the loop. Thus number of phi operands also gets incremented in the number of registers used.

Performance runs:

Bootstrapping with i386 goes through fine. The spec cpu 2000 benchmarks is run and following performance runs and the code size for
 i386 target seen.

Ratio with the above optimization changes vs ratio without above optimizations for INT benchmarks (3785.261 vs 3783.064).
Ratio with the above optimization changes vs ratio without above optimization for FP benchmarks ( 4676.763189 vs 4676.072428 ).

Code size reduction for INT benchmarks : 2324 instructions.
Code size reduction for FP benchmarks : 1283 instructions.

For Microblaze target the Mibench and EEMBC benchmarks is run and the following improvements is seen.

(qos_lite(5.3%), consumer_jpeg_c(1.34%), security_rijndael_d(1.8%), security_rijndael_e(1.4%))

Code Size reduction for Mibench  = 16164 instructions.
Code Size reduction for EEMBC = 98 instructions.

Patch ChangeLog:

PATCH] [RFC, Patch]: Optimized changes in the register used inside  loop for LICM and IVOPTS.

Changes are done in the Loop Invariant(LICM) at RTL level and also the Induction variable optimization 
based on SSA representation. The current logic used in LICM for register used inside the loops is changed. 
The Live Out of the loop latch node and the Live in of the destination of the exit nodes is used to set the
 Loops Liveness at the exit of the Loop. The register used is the number of live variables at the exit of the
 Loop calculated above.

For Induction variable optimization on tree SSA representation, the register used logic is based on the
 number of phi nodes at the loop header to represent the liveness at the loop.  Current Logic used only
 the number of phi nodes at the loop header.  Changes are made to represent the phi operands also live
 at the loop. Thus number of phi operands also gets incremented in the number of registers used.

ChangeLog:
2015-10-09  Ajit Agarwal  <ajitkum@xilinx.com>

        * loop-invariant.c (compute_loop_liveness): New.
        (determine_regs_used): New.
        (find_invariants_to_move): Use of determine_regs_used.
        * tree-ssa-loop-ivopts.c (determine_set_costs): Consider the phi
        arguments for register used.

Signed-off-by:Ajit Agarwal ajitkum@xilinx.com

Thanks & Regards
Ajit

Attachment: 0001-RFC-Patch-Optimized-changes-in-the-register-used-ins.patch
Description: 0001-RFC-Patch-Optimized-changes-in-the-register-used-ins.patch


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