From patchwork Thu Mar 29 17:28:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 149447 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 EE003B6EF3 for ; Fri, 30 Mar 2012 04:29:22 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1333646963; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=3ncf1WB 9L5dxbJA8wXYYcRa42cA=; b=jPlLFecPsSbG7j5gkWldfhWsN17ppfjzFkIwxux eErkT/M6AE5/uVjAM+F8bhZBzwOIMlbYL9t4KzQyn61unTf/GcbJq7xBmvXTSQtB ge9rvGb75J6o0SZtglncMyuhs8wf1PDed1M6cEKLG3DvOMnP13v9NcEf9DfZ1vZe H5i8= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=N8HVoG1ugHnPgkkGc/NNahl/xLhdiODeYYvKS/sy9dyAJhW9NW/pPEb1ZfONqr PLy+BIvPvpdBU72n0HJ+FkAKGpAo7sgGapt/v9pC5TKQI9RScwrJ9IsQm6/nQBpQ bokR3GuSRtxQLviTRz9oM0s9ZNMkDKJ0rMieo/ZjA5L/g=; Received: (qmail 5427 invoked by alias); 29 Mar 2012 17:29:13 -0000 Received: (qmail 5419 invoked by uid 22791); 29 Mar 2012 17:29:11 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, 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; Thu, 29 Mar 2012 17:28:57 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2THSuw6000442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 29 Mar 2012 13:28:56 -0400 Received: from toll.usersys.redhat.com (unused [10.15.16.165] (may be forged)) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q2THSuc8032325; Thu, 29 Mar 2012 13:28:56 -0400 Message-ID: <4F749BC4.3040501@redhat.com> Date: Thu, 29 Mar 2012 13:28:36 -0400 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120316 Thunderbird/11.0 MIME-Version: 1.0 To: gcc-patches CC: =?ISO-8859-1?Q?Fr=E9d=E9ric_RISS?= Subject: patch to fix a bug in coloring in multi-register allocnos presence. 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 Frederic Riss sent me IRA dump files for an in-house GCC back-end which helped to find a bug in coloring in presence of multi-register allocnos. The bug resulted in making allocno colorable too earlier and as a consequence in worse code. The problem was in preventing processing of all conflicting objects of an allocno although the impact of each object was taken as 1. It was my mistake in merging code for IRA coloring without cover classes and Bernd's work on multi-object allocnos. The following patch changes SPEC2000 code on x86 (32-bit mode) for vpr, gcc, crafty, parser, and vortex and improves scores (up to 0.7% for crafty) and decrease code size (up to 0.5% for crafty) for these benchmarks. Frederic Riss also reported considerable improvements for his back-end. The patch was successfully bootstrapped on x86/x86-64 and committed as rev. 185971. 2012-03-29 Vladimir Makarov * ira-color.c (setup_left_conflict_sizes_p): Process all conflicting objects. Index: ira-color.c =================================================================== --- ira-color.c (revision 185967) +++ ira-color.c (working copy) @@ -821,7 +821,6 @@ setup_left_conflict_sizes_p (ira_allocno node_preorder_num = node->preorder_num; COPY_HARD_REG_SET (node_set, node->hard_regs->set); node_check_tick++; - curr_allocno_process++; for (k = 0; k < nobj; k++) { ira_object_t obj = ALLOCNO_OBJECT (a, k); @@ -838,12 +837,10 @@ setup_left_conflict_sizes_p (ira_allocno conflict_data = ALLOCNO_COLOR_DATA (conflict_a); if (! ALLOCNO_COLOR_DATA (conflict_a)->in_graph_p - || conflict_data->last_process == curr_allocno_process || ! hard_reg_set_intersect_p (profitable_hard_regs, conflict_data ->profitable_hard_regs)) continue; - conflict_data->last_process = curr_allocno_process; conflict_node = conflict_data->hard_regs_node; COPY_HARD_REG_SET (conflict_node_set, conflict_node->hard_regs->set); if (hard_reg_set_subset_p (node_set, conflict_node_set))