From patchwork Tue Aug 10 21:41:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 61414 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 84B94B70AA for ; Wed, 11 Aug 2010 07:41:38 +1000 (EST) Received: (qmail 23096 invoked by alias); 10 Aug 2010 21:41:33 -0000 Received: (qmail 23081 invoked by uid 22791); 10 Aug 2010 21:41:31 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, TW_CN, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Aug 2010 21:41:25 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7ALfO6j030645 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 10 Aug 2010 17:41:24 -0400 Received: from toll.yyz.redhat.com (toll.yyz.redhat.com [10.15.16.165]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7ALfNVl004420 for ; Tue, 10 Aug 2010 17:41:23 -0400 Message-ID: <4C61C783.9060306@redhat.com> Date: Tue, 10 Aug 2010 17:41:23 -0400 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100720 Fedora/3.1.1-1.fc13 Thunderbird/3.1.1 MIME-Version: 1.0 To: gcc-patches Subject: [ira-improv] patch to fix perlbmk degradation after last merge X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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"); + } } }