From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9245 invoked by alias); 14 Mar 2013 15:22:02 -0000 Received: (qmail 9225 invoked by uid 22791); 14 Mar 2013 15:22:00 -0000 X-SWARE-Spam-Status: No, hits=-8.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS 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, 14 Mar 2013 15:21:47 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2EFLkeF007990 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 14 Mar 2013 11:21:46 -0400 Received: from toll.usersys.redhat.com (toll.yyz.redhat.com [10.15.16.165]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2EFLj6Y012475; Thu, 14 Mar 2013 11:21:45 -0400 Message-ID: <5141E8A1.5010203@redhat.com> Date: Thu, 14 Mar 2013 15:22:00 -0000 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Tom de Vries CC: gcc-patches@gcc.gnu.org Subject: Re: [PATCH][IRA] Analysis of register usage of functions for usage by IRA. References: <510282FE.1060809@mentor.com> <5102A694.5010000@redhat.com> <5113FC6B.7090702@mentor.com> <511C1538.308@redhat.com> <514199BC.9070608@mentor.com> In-Reply-To: <514199BC.9070608@mentor.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2013-03/txt/msg00508.txt.bz2 On 03/14/2013 05:34 AM, Tom de Vries wrote: > On 13/02/13 23:35, Vladimir Makarov wrote: >> >> Sorry for the delay with the answer. I was and am quite busy with other >> more urgent things. I'll work on it when I have more free time. In any >> case, I'll do it before stage1 to have your patch ready. > Vladimir, > > do you have an ETA on this review? > > Actually, I am done with it. In general, it is ok. Although I have some minors comments: In Changelog, you missed '*" before cgraph.h: * haifa-sched.c (recompute_todo_spec, check_clobbered_conditions): Add new argument to find_all_hard_reg_sets call. cgraph.h (struct cgraph_node): Add function_used_regs, function_used_regs_initialized and function_used_regs_valid fields. @@ -3391,6 +3394,7 @@ df_get_call_refs (struct df_collection_r } } else if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i) I'd remove the test of regs_invalidated_by_call. + && TEST_HARD_REG_BIT (fn_reg_set_usage, i) /* no clobbers for regs that are the result of the call */ && !TEST_HARD_REG_BIT (defs_generated, i) +static void +collect_fn_hard_reg_usage (void) +{ + rtx insn; + int i; + struct cgraph_node *node; + struct hard_reg_set_container other_usage; + + if (!flag_use_caller_save) + return; + + node = cgraph_get_node (current_function_decl); + gcc_assert (node != NULL); + + gcc_assert (!node->function_used_regs_initialized); + node->function_used_regs_initialized = 1; + + for (insn = get_insns (); insn != NULL_RTX; insn = next_insn (insn)) + { + HARD_REG_SET insn_used_regs; + + if (!NONDEBUG_INSN_P (insn)) + continue; + + find_all_hard_reg_sets (insn, &insn_used_regs, false); + + if (CALL_P (insn) + && !get_call_reg_set_usage (insn, &insn_used_regs, call_used_reg_set)) + { + CLEAR_HARD_REG_SET (node->function_used_regs); + return; + } + I'd put it before find_all_hard_reg_sets + IOR_HARD_REG_SET (node->function_used_regs, insn_used_regs); + } + But you can ignore my two last 2 comments. The patch is ok for me for trunk at stage1. But I think you need a formal approval for df-scan.c, arm.c, mips.c, GCC testsuite expect files (lib/target-supports.exp and gcc.target/mips/mips.exp) as I am not a maintainer of these parts although these changes look ok for me. Thanks for your hard work and sorry for the review delay. I guess you need to pay attention to reported problems for some time after you commit the patch as it affects all targets.