Patchwork [SH] Merge SCHED_REORDER macro into ready_reorder function

login
register
mail settings
Submitter Oleg Endo
Date April 11, 2012, 11:50 a.m.
Message ID <1334145008.19154.158.camel@yam-132-YW-E178-FTW>
Download mbox | patch
Permalink /patch/151764/
State New
Headers show

Comments

Oleg Endo - April 11, 2012, 11:50 a.m.
Hi,

The attached patch merges the SCHED_REORDER macro into the ready_reorder
function, since the macro is used only in that function.
Tested with 'make all-gcc'
OK?

Cheers,
Oleg


ChangeLog:
	
	* config/sh/sh.c (SCHED_REORDER): Merge macro into ...
	(ready_reorder): ... this function.
Kaz Kojima - April 11, 2012, 1:11 p.m.
Oleg Endo <oleg.endo@t-online.de> wrote:
> The attached patch merges the SCHED_REORDER macro into the ready_reorder
> function, since the macro is used only in that function.
> Tested with 'make all-gcc'
> OK?

OK.

Regards,
	kaz

Patch

Index: gcc/config/sh/sh.c
===================================================================
--- gcc/config/sh/sh.c	(revision 186311)
+++ gcc/config/sh/sh.c	(working copy)
@@ -10559,22 +10559,14 @@ 
   a[i + 1] = insn;
 }
 
-#define SCHED_REORDER(READY, N_READY)                                	\
-  do									\
-    {									\
-      if ((N_READY) == 2)						\
-	swap_reorder (READY, N_READY);					\
-      else if ((N_READY) > 2)						\
-	qsort (READY, N_READY, sizeof (rtx), rank_for_reorder);		\
-    }									\
-  while (0)
-
-/* Sort the ready list READY by ascending priority, using the SCHED_REORDER
-   macro.  */
+/* Sort the ready list by ascending priority.  */
 static void
 ready_reorder (rtx *ready, int nready)
 {
-  SCHED_REORDER (ready, nready);
+  if (nready == 2)
+    swap_reorder (ready, nready);
+  else if (nready > 2)
+     qsort (ready, nready, sizeof (rtx), rank_for_reorder);
 }
 
 /* Count life regions of r0 for a block.  */