From patchwork Wed Sep 18 19:16:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 275778 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 993FD2C00F8 for ; Thu, 19 Sep 2013 05:16:20 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=AMnUh7N43em7mBPp7EIcDeomV/c8NOhReuvprGQLe3dpQ0 Uq7ImyIgin254AUG5WZBVKljLSnreH3/TJM31WAtVPA53KuS9eSZh0Otg3/Jl3TS 3xK9+9gNfee6qlcUHdIQGnDdi7M/WaMFV/tWbhlie2mhhIqqAD0bC4C0y+Po0= 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 :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=oSBKDkJKfCzCo4NviIadtRW/fb0=; b=nxNbJmg39sju1ed6tWgb AlehnFGeDBZ3+6M4Oj8636B2b2DZZzjeC1NLX31u4112ECKPLbu+j+84X7R43+To hUjAWNToSmCOgiYIXg/wLwdsPOUl8qaM7AstSLkV6uaWosC33gEx8UPx67t29iwy htyUCvQaLwdmRUK5bwZ3W6o= Received: (qmail 6275 invoked by alias); 18 Sep 2013 19:16:13 -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 6251 invoked by uid 89); 18 Sep 2013 19:16:12 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Sep 2013 19:16:12 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8IJG8rK031735 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 18 Sep 2013 15:16:09 -0400 Received: from topor.usersys.redhat.com ([10.15.16.142]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r8IJG7Au025753 for ; Wed, 18 Sep 2013 15:16:07 -0400 Message-ID: <5239FBF7.7070206@redhat.com> Date: Wed, 18 Sep 2013 15:16:07 -0400 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: gcc-patches Subject: patch to support HARD_REGNO_CALL_PART_CLOBBERED in LRA X-IsSubscribed: yes Yvan Roux working on porting LRA to AARCH64 reported that LRA does not support macro HARD_REGNO_CALL_PART_CLOBBERED. Here is the patch implementing such support. Yvan wrote me that the patch solves the problem (removing some gcc testsuite failures). The patch was bootstrapped on x86/x86-64. Committed as rev. 202721. 2013-09-18 Vladimir Makarov * lra-constraints.c (need_for_all_save_p): Use macro HARD_REGNO_CALL_PART_CLOBBERED. * lra-lives.c (check_pseudos_live_through_calls): Use the macro to set up pseudo conflict hard regs. Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 202714) +++ lra-constraints.c (working copy) @@ -4335,7 +4335,9 @@ need_for_call_save_p (int regno) return (usage_insns[regno].calls_num < calls_num && (overlaps_hard_reg_set_p (call_used_reg_set, - PSEUDO_REGNO_MODE (regno), reg_renumber[regno]))); + PSEUDO_REGNO_MODE (regno), reg_renumber[regno]) + || HARD_REGNO_CALL_PART_CLOBBERED (reg_renumber[regno], + PSEUDO_REGNO_MODE (regno)))); } /* Global registers occurring in the current EBB. */ Index: lra-lives.c =================================================================== --- lra-lives.c (revision 202626) +++ lra-lives.c (working copy) @@ -457,11 +457,17 @@ lra_setup_reload_pseudo_preferenced_hard static inline void check_pseudos_live_through_calls (int regno) { + int hr; + if (! sparseset_bit_p (pseudos_live_through_calls, regno)) return; sparseset_clear_bit (pseudos_live_through_calls, regno); IOR_HARD_REG_SET (lra_reg_info[regno].conflict_hard_regs, call_used_reg_set); + + for (hr = 0; hr < FIRST_PSEUDO_REGISTER; hr++) + if (HARD_REGNO_CALL_PART_CLOBBERED (hr, PSEUDO_REGNO_MODE (regno))) + SET_HARD_REG_BIT (lra_reg_info[regno].conflict_hard_regs, hr); #ifdef ENABLE_CHECKING lra_reg_info[regno].call_p = true; #endif