From patchwork Tue Mar 24 01:50:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhouyi Zhou X-Patchwork-Id: 453684 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E052A1400DD for ; Tue, 24 Mar 2015 12:51:08 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=x2lafOLK; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:message-id:in-reply-to:references:subject:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=DTk GiFu/9GFt+IuMRznWUI+KlnvO1p4d77a+t+FGbimMIj27BQfDcWesRiQZTn+ID/W /hA+lLnBuPLO1jGPfbrQHjdni6T9FF7nIdzMOLODKQYAmhjuamDa514TRSBVBPRM riatCsLbxIKHbt/FkQu0U5NP5VYL3sMkvvxNxTqg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:message-id:in-reply-to:references:subject:mime-version :content-type:content-transfer-encoding; s=default; bh=qplNnRrBK +dxggdUdQABKb/ePh4=; b=x2lafOLK5dWQHgGfRQfXqI8jmQJNRUcL9IQdk5zUs 2aEaJdkjbyjkwU+9CbdHy15Rc0V0aZ4FdRnkPu1jvJ9L282LFnkP/2aVauu5bicI iPhijA6RZHG8FskdMyUcO1u1qqcsg7c8qRLoJoio2OPpC0eCb0PRWuntTnQaEfsq fI= Received: (qmail 20376 invoked by alias); 24 Mar 2015 01:50:59 -0000 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 Received: (qmail 19928 invoked by uid 89); 24 Mar 2015 01:50:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL, BAYES_50, SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: cstnet.cn Received: from smtp23.cstnet.cn (HELO cstnet.cn) (159.226.251.23) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 24 Mar 2015 01:50:56 +0000 Received: by ajax-webmail-app3 (Coremail) ; Tue, 24 Mar 2015 09:50:51 +0800 (GMT+08:00) Date: Tue, 24 Mar 2015 09:50:51 +0800 (GMT+08:00) From: "Zhouyi Zhou" To: gcc-patches@gcc.gnu.org, vmakarov@redhat.com, richard.guenther@gmail.com Message-ID: <89fd4a.f635.14c4979a69c.Coremail.yizhouzhou@ict.ac.cn> In-Reply-To: <1426124091-29606-1-git-send-email-yizhouzhou@ict.ac.cn> References: <1426124091-29606-1-git-send-email-yizhouzhou@ict.ac.cn> Subject: Ping: [PATCH V2] IRA: Speed up setup_left_conflict_sizes_p MIME-Version: 1.0 X-SendMailWithSms: false X-CM-CTRLDATA: 8y12P2Zvb3Rlcl90eHQ9MzI0MTo2 X-CM-TRANSID: SQCowJBb0+v8whBVrp_6AQ--.35521W X-CM-SenderInfo: x1l2x05x2k03g6lf3hldfou0/1tbiBAcSAFEVM3E1qAAAsK X-Coremail-Antispam: 1Ur529EdanIXcx71UUUUU7IcSsGvfJ3iIAIbVAYjsxI4VWxJw CS07vEb4IE77IF4wCS07vE1I0E4x80FVAKz4kxMIAIbVAFxVCaYxvI4VCIwcAKzIAtYxBI daVFxhVjvjDU= Hi Vladimir, I am studying IRA in my offer hours because it is marvellous and very educative. Did you get a chance to look at the below patch. The elements of allocno_hard_regs_subnode_index are setup in function setup_allocno_hard_regs_subnode_index where elements representing subnodes of a node are nonegative. I think we can avoid involving the parent itself into the loop below because when the loop invariant i == 0, allocno_hard_regs_nodes[i + node_preorder_num] will be current node, I guess we are not interested in computing left conflict subnodes size of current node's parent in current function context. Thanks and Regards Zhouyi ---------- Forwarded message ---------- From: Zhouyi Zhou Date: Thu, Mar 12, 2015 at 9:34 AM Subject: [PATCH V2] IRA: Speed up setup_left_conflict_sizes_p To: gcc-patches@gcc.gnu.org, richard.guenther@gmail.com Cc: Zhouyi Zhou , Zhouyi Zhou From: Zhouyi Zhou In function setup_left_conflict_sizes_p, left conflict subnodes sizes are computed in a bottom-to-up fashion through the regnodes foreast. Speed up the process from prevent node itself to involve in this computation. I have no write access to GCC SVN repository, if it OK, can you commit for me? (Thanks Richard for reviewing) Bootstrap and regtest scheduled on x86_64 GNU/Linux Signed-off-by: Zhouyi Zhou --- gcc/ChangeLog | 5 +++++ gcc/ira-color.c | 8 +++----- 2 files changed, 8 insertions(+), 5 deletions(-) -- 1.7.10.4 diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 53f582b..a495dfc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-03-12 Zhouyi Zhou + + * ira-color.c (setup_left_conflict_sizes_p): Prevent node itself + from computing left conflict subnodes size. + 2015-03-10 Jan Hubicka * cgraph.c (cgraph_node::release_body): Free function_in_decl_state. diff --git a/gcc/ira-color.c b/gcc/ira-color.c index ff1fe8a..d2d5102 100644 --- a/gcc/ira-color.c +++ b/gcc/ira-color.c @@ -938,7 +938,7 @@ setup_left_conflict_sizes_p (ira_allocno_t a) subnodes[i].left_conflict_subnodes_size = 0; } start = node_preorder_num * allocno_hard_regs_nodes_num; - for (i = data->hard_regs_subnodes_num - 1; i >= 0; i--) + for (i = data->hard_regs_subnodes_num - 1; i > 0; i--) { int size, parent_i; allocno_hard_regs_node_t parent; @@ -948,12 +948,10 @@ setup_left_conflict_sizes_p (ira_allocno_t a) - subnodes[i].left_conflict_subnodes_size, subnodes[i].left_conflict_size)); parent = allocno_hard_regs_nodes[i + node_preorder_num]->parent; - if (parent == NULL) - continue; + gcc_checking_assert(parent); parent_i = allocno_hard_regs_subnode_index[start + parent->preorder_num]; - if (parent_i < 0) - continue; + gcc_checking_assert(parent_i >= 0); subnodes[parent_i].left_conflict_subnodes_size += size; } left_conflict_subnodes_size = subnodes[0].left_conflict_subnodes_size;