From patchwork Fri Apr 20 20:15:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Bergner X-Patchwork-Id: 154136 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 2E5AEB6FBD for ; Sat, 21 Apr 2012 06:16:36 +1000 (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=1335557797; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Received:Message-ID:Subject:From:To: Cc:Date:Content-Type:Content-Transfer-Encoding:Mime-Version: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=FkrvH0+ePImZDnnUKFGA UpNz0nA=; b=x92zfJbhD7x3fWBbg5i74/t7rJRFvqd63eXynFxLKDKE8nDfL1vX Gc2r9e/zi04xB44VeYf2TznI58PiT+UPhcxPX3UjRw1O3yyolI3gq7183pAcy2fa wqpgNkPmKs7gacXxxVi9a/eOPQ32FAJw7lDsXYf7rjywQRSOYm4223w= 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:Received:Received:Received:Received:Message-ID:Subject:From:To:Cc:Date:Content-Type:Content-Transfer-Encoding:Mime-Version:X-Content-Scanned:x-cbid:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=PmX/cy9tzb1qLCjWSGsOofV+vUPEtmN+2UFm9AEeZnfn71UnMmq63wEew1gkqE DAj6rp1WAhtipLcVrxYo/Y2N3lsowI9lBzgmgZWtrdXnSa1HW0hQ9A1ziAL7pxvt iNXhWQS5wb4L8Jb19ly08LvpHdkAVwwq0eZtA6yBLxOzk=; Received: (qmail 6618 invoked by alias); 20 Apr 2012 20:16:18 -0000 Received: (qmail 6594 invoked by uid 22791); 20 Apr 2012 20:16:17 -0000 X-SWARE-Spam-Status: No, hits=-3.7 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, SPF_SOFTFAIL, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e39.co.us.ibm.com (HELO e39.co.us.ibm.com) (32.97.110.160) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 20 Apr 2012 20:16:02 +0000 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 20 Apr 2012 14:16:02 -0600 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e39.co.us.ibm.com (192.168.1.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 20 Apr 2012 14:16:00 -0600 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 16E9419D8058 for ; Fri, 20 Apr 2012 14:15:50 -0600 (MDT) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q3KKFrvj130672 for ; Fri, 20 Apr 2012 14:15:57 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q3KKFrdS018135 for ; Fri, 20 Apr 2012 14:15:53 -0600 Received: from [192.168.1.103] (vorma.rchland.ibm.com [9.10.86.174]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q3KKFobI017797; Fri, 20 Apr 2012 14:15:51 -0600 Message-ID: <1334952949.3078.38.camel@otta> Subject: [PATCH, LTO, 4.6] Backport Honza's PR48246 patch From: Peter Bergner To: "gcc-patches@gcc.gnu.org" Cc: Jan Hubicka Date: Fri, 20 Apr 2012 15:15:49 -0500 Mime-Version: 1.0 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12042020-4242-0000-0000-000001694079 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 We're still hitting the overzealous assert identified in PR49246 that is looking for empty LTO partitions, even after the change to a checking assert. How about we backport Honza's mainline patch that stops the creation of empty partitions in the first place? Speaking with honza on IRC, he thought it was probably a good idea to backport it. I bootstrapped and regtested the backport patch below on powerpc64-linux with no regressions. Ok for the 4.6 branch? Peter Backport from mainline 2011-06-11 Jan Hubicka PR lto/48246 * lto.c (lto_1_to_1_map): Don't create empty partitions. (lto_balanced_map): Likewise. Index: gcc/lto/lto.c =================================================================== --- gcc/lto/lto.c (revision 186600) +++ gcc/lto/lto.c (working copy) @@ -893,7 +893,8 @@ lto_1_to_1_map (void) for (node = cgraph_nodes; node; node = node->next) { - if (!partition_cgraph_node_p (node)) + if (!partition_cgraph_node_p (node) + || node->aux) continue; file_data = node->local.lto_file_data; @@ -923,13 +924,13 @@ lto_1_to_1_map (void) npartitions++; } - if (!node->aux) - add_cgraph_node_to_partition (partition, node); + add_cgraph_node_to_partition (partition, node); } for (vnode = varpool_nodes; vnode; vnode = vnode->next) { - if (!partition_varpool_node_p (vnode)) + if (!partition_varpool_node_p (vnode) + || vnode->aux) continue; file_data = vnode->lto_file_data; slot = pointer_map_contains (pmap, file_data); @@ -943,8 +944,7 @@ lto_1_to_1_map (void) npartitions++; } - if (!vnode->aux) - add_varpool_node_to_partition (partition, vnode); + add_varpool_node_to_partition (partition, vnode); } for (node = cgraph_nodes; node; node = node->next) node->aux = NULL; @@ -1050,8 +1050,9 @@ lto_balanced_map (void) for (i = 0; i < n_nodes; i++) { - if (!order[i]->aux) - add_cgraph_node_to_partition (partition, order[i]); + if (order[i]->aux) + continue; + add_cgraph_node_to_partition (partition, order[i]); total_size -= order[i]->global.size; /* Once we added a new node to the partition, we also want to add @@ -1231,6 +1232,8 @@ lto_balanced_map (void) } i = best_i; /* When we are finished, avoid creating empty partition. */ + while (i < n_nodes - 1 && order[i + 1]->aux) + i++; if (i == n_nodes - 1) break; partition = new_partition ("");