From patchwork Tue Aug 10 21:41:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [ira-improv] patch to fix perlbmk degradation after last merge Date: Tue, 10 Aug 2010 11:41:23 -0000 From: Vladimir Makarov X-Patchwork-Id: 61414 Message-Id: <4C61C783.9060306@redhat.com> To: gcc-patches 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 * ira-color.c (bucket_allocno_compare_func): Check frequency first. (push_allocno_to_stack): Print changing allocnpo colorability. 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"); + } } }