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]

Re: FW: patch to fix PR21617


On 01/19/2012 03:52 PM, Vladimir Makarov wrote:
On 01/18/2012 02:30 PM, Zamyatin, Igor wrote:
Yes, we use Atom for EEMBC measurements.

We'll be glad to help you with your findings.


Thanks.

Unfortunately I tried several alternative patches but I did not find a better solution (it is mostly code size degradation on CoreI7). Now I am even thinking that the best action would have been ignoring the original PR.

Could you try the attached patch. It might work.

I've tried several approach to prevent small hole creation in ira-color.c::assign_hard_reg but it does not work well.

Thanks.


Index: ira-color.c
===================================================================
--- ira-color.c	(revision 183312)
+++ ira-color.c	(working copy)
@@ -1798,16 +1798,16 @@ bucket_allocno_compare_func (const void 
   int diff, a1_freq, a2_freq, a1_num, a2_num;
   int cl1 = ALLOCNO_CLASS (a1), cl2 = ALLOCNO_CLASS (a2);
 
-  /* Push pseudos requiring less hard registers first.  It means that
-     we will assign pseudos requiring more hard registers first
-     avoiding creation small holes in free hard register file into
-     which the pseudos requiring more hard registers can not fit.  */
-  if ((diff = (ira_reg_class_max_nregs[cl1][ALLOCNO_MODE (a1)]
-	       - ira_reg_class_max_nregs[cl2][ALLOCNO_MODE (a2)])) != 0)
-    return diff;
   a1_freq = ALLOCNO_FREQ (a1);
   a2_freq = ALLOCNO_FREQ (a2);
-  if ((diff = a1_freq - a2_freq) != 0)
+  /* Prefer to push pseudos requiring less hard registers first.  It
+     means that we will assign pseudos requiring more hard registers
+     first avoiding creation small holes in free hard register file
+     into which the pseudos requiring more hard registers can not
+     fit.  */
+  if ((diff = (a1_freq * ira_reg_class_max_nregs[cl1][ALLOCNO_MODE (a1)]
+	       - a2_freq * ira_reg_class_max_nregs[cl2][ALLOCNO_MODE (a2)]))
+      != 0)
     return diff;
   a1_num = ALLOCNO_COLOR_DATA (a1)->available_regs_num;
   a2_num = ALLOCNO_COLOR_DATA (a2)->available_regs_num;

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