public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch,microblaze]: Optimized register reorganization for Microblaze.
@ 2016-01-12 17:42 Ajit Kumar Agarwal
  2016-01-21 17:11 ` Michael Eager
  0 siblings, 1 reply; 2+ messages in thread
From: Ajit Kumar Agarwal @ 2016-01-12 17:42 UTC (permalink / raw)
  To: GCC Patches
  Cc: Vinod Kathail, Shail Aditya Gupta, Vidhumouli Hunsigida, Nagaraju Mekala

[-- Attachment #1: Type: text/plain, Size: 2504 bytes --]

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 #2: reg-reorg.patch --]
[-- Type: application/octet-stream, Size: 2262 bytes --]

From 1199d4ccf030ef3a73e16e954d2b37d53c6c1882 Mon Sep 17 00:00:00 2001
From: Ajit Kumar Agarwal <ajitkum@xilix.com>
Date: Tue, 12 Jan 2016 22:55:54 +0530
Subject: [PATCH] [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 availibiilty 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.

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Patch,microblaze]: Optimized register reorganization for Microblaze.
  2016-01-12 17:42 [Patch,microblaze]: Optimized register reorganization for Microblaze Ajit Kumar Agarwal
@ 2016-01-21 17:11 ` Michael Eager
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Eager @ 2016-01-21 17:11 UTC (permalink / raw)
  To: Ajit Kumar Agarwal, GCC Patches
  Cc: Vinod Kathail, Shail Aditya Gupta, Vidhumouli Hunsigida, Nagaraju Mekala

On 01/12/2016 09:42 AM, Ajit Kumar Agarwal wrote:
> 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
>

Committed revision 232682.

-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-01-21 17:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-12 17:42 [Patch,microblaze]: Optimized register reorganization for Microblaze Ajit Kumar Agarwal
2016-01-21 17:11 ` Michael Eager

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).