]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/21617 (CRC64 algorithm optimization problem on Intel 32-bit)
authorVladimir Makarov <vmakarov@redhat.com>
Mon, 12 Dec 2011 20:51:16 +0000 (20:51 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Mon, 12 Dec 2011 20:51:16 +0000 (20:51 +0000)
2011-12-12  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/21617
* ira-color.c (bucket_allocno_compare_func): Don't compare
allocno classes.  Compare number of hard registers needed.

From-SVN: r182263

gcc/ChangeLog
gcc/ira-color.c

index 0d1dea37ae03f38dd9f14b35c377763bb36f57b3..9de95711d42f43fbff4b296c3a07758e2653a65f 100644 (file)
@@ -1,3 +1,9 @@
+2011-12-12  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/21617
+       * ira-color.c (bucket_allocno_compare_func): Don't compare
+       allocno classes.  Compare number of hard registers needed.
+
 2011-12-12  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR tree-optimization/50569
index 1c03a4ae565654db83869f568276babfbbced91e..92f68bf0f1956f8eb6077c955ff6358678c472b6 100644 (file)
@@ -1797,8 +1797,14 @@ bucket_allocno_compare_func (const void *v1p, const void *v2p)
   ira_allocno_t a1 = *(const ira_allocno_t *) v1p;
   ira_allocno_t a2 = *(const ira_allocno_t *) v2p;
   int diff, a1_freq, a2_freq, a1_num, a2_num;
-
-  if ((diff = (int) ALLOCNO_CLASS (a2) - ALLOCNO_CLASS (a1)) != 0)
+  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);