Patchwork [ira-improv] patch to fix perlbmk degradation after last merge

login
register
mail settings
Submitter Vladimir Makarov
Date Aug. 10, 2010, 9:41 p.m.
Message ID <4C61C783.9060306@redhat.com>
Download mbox | patch
Permalink /patch/61414/
State New
Headers show

Comments

Vladimir Makarov - Aug. 10, 2010, 9:41 p.m.
After last merge with the trunk I found a big (3%) SPEC2000 perlbmk 
degradation.  The following patch solves the problem.  When any register 
set can be a cover class there is no necessity to sort colorable 
allocnos in bucket according their available hard regs because allocno 
class now contains only available registers in most cases.  The first 
level priority becomes a frequency of allocno usage.

2010-08-10  Vladimir Makarov <vmakarov@redhat.com>

     * ira-color.c (bucket_allocno_compare_func): Check frequency
     first.
     (push_allocno_to_stack): Print changing allocnpo colorability.

Patch

Index: ira-color.c
===================================================================
--- ira-color.c	(revision 163061)
+++ ira-color.c	(working copy)
@@ -1777,13 +1777,13 @@  bucket_allocno_compare_func (const void 
   if ((diff = (int) ALLOCNO_CLASS (a2) - ALLOCNO_CLASS (a1)) != 0)
     return diff;
   a1_freq = ALLOCNO_FREQ (a1);
-  a1_num = ALLOCNO_COLOR_DATA (a1)->available_regs_num;
   a2_freq = ALLOCNO_FREQ (a2);
+  if ((diff = a1_freq - a2_freq) != 0)
+    return diff;
+  a1_num = ALLOCNO_COLOR_DATA (a1)->available_regs_num;
   a2_num = ALLOCNO_COLOR_DATA (a2)->available_regs_num;
   if ((diff = a2_num - a1_num) != 0)
     return diff;
-  else if ((diff = a1_freq - a2_freq) != 0)
-    return diff;
   return ALLOCNO_NUM (a2) - ALLOCNO_NUM (a1);
 }
 
@@ -1923,6 +1923,12 @@  push_allocno_to_stack (ira_allocno_t a)
 		    (conflict_a, &uncolorable_allocno_bucket);
 	      add_allocno_to_ordered_bucket
 		(conflict_a, &colorable_allocno_bucket);
+	      if (internal_flag_ira_verbose > 4 && ira_dump_file != NULL)
+		{
+		  fprintf (ira_dump_file, "        Making");
+		  ira_print_expanded_allocno (conflict_a);
+		  fprintf (ira_dump_file, " colorable\n");
+		}
 	    }
 	  
 	}