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]

[Patch,microblaze]: Optimized register reorganization for Microblaze.


The patch contains the changes in the macros fixed_registers and call_used_registers.
Earlier the register r21 is marked as fixed and also marked as 1 for call_used registers.
On top of that r21 is not assigned to any of the temporaries in rtl insns.

This makes the usage of registers r21 in the callee functions not possible and wasting
one registers to allocate in the callee function. The changes makes the register r21 as
allocatable to the callee function and optimized usage of the registers r21 in the callee
function reduces spill and fetch. The reduction in the spill and fetch is due to availability
of register r21 in the callee function. The availability of register r21 is made by
marking the register r21 as not fixed and the call_used registers is marked as 0.
Also r20 is marked as fixed. The changes are done not to mark as fixed thus allowing
the registers to be used reducing the spill and fetch.

Regtested for Microblaze.

Performance runs made on Mibench/EEMBC benchmarks for microblaze. Following benchmarks 
shows the gains

 Benchmarks                     Gains
automotive_qsort1 =    3.96%
automotive_susan_c = 7.68%
consumer_mad =            9.6%
security_rijndael_d =    19.57%
telecom_CRC32 =           7.66%
bitmnp01_lite =              10.61%
a2time01_lite =                6.97%

ChangeLog:
2016-01-12  Ajit Agarwal  <ajitkum@xilinx.com>

	* config/microblaze/microblaze.h
	(FIXED_REGISTERS): Update in macro.
	(CALL_USED_REGISTERS): Update in macro.

Signed-off-by:Ajit Agarwal ajitkum@xilinx.com.
---
 gcc/config/microblaze/microblaze.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
index e115c42..dbfb652 100644
--- a/gcc/config/microblaze/microblaze.h
+++ b/gcc/config/microblaze/microblaze.h
@@ -253,14 +253,14 @@ extern enum pipeline_type microblaze_pipe;
 #define FIXED_REGISTERS							\
 {									\
   1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,			\
-  1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,			\
+  1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,			\
   1, 1, 1, 1 								\
 }
 
 #define CALL_USED_REGISTERS						\
 {									\
   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,			\
-  1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,			\
+  1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,			\
   1, 1, 1, 1								\
 }
 #define GP_REG_FIRST    0
-- 
1.7.1

Thanks & Regards
Ajit

Attachment: reg-reorg.patch
Description: reg-reorg.patch


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