From patchwork Wed Dec 16 20:35:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 557748 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 52CED1402BF for ; Thu, 17 Dec 2015 07:35:58 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=gCpZbkdF; 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 :subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=o0ausKRzN8ZHqK1aV 8oZxHje8wWh3gg69wv+h9Z23DvcWvqRtizSRhFgeOARitIw2rUUuwXPkY0pfKqyT 0qAr7eCZu61DGEYcfQuB+/iQvjOV1mADGaIFiVwzSQXE2RDq0TUl0AjK/iyzzi3r 3QX5BDzIfIkdsoq8qhb0aVGcUk= 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 :subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=3bp202OrkNb82M21PIhLE8M aGrI=; b=gCpZbkdFgIKco/XsKgB9EEK/l0Pd33RB9dePp4oLrG0KcjLg2ZDOSCc 1LVPedPxVbiM6MPE3HFHFtp3DaKyFLNxKsmyI504mYHKL6nGmhCSQWklitAzQeH3 NtPvsFC+UDGbk4P+kHBC2rmhbaZiLYodYFAXlkk9JQwS8xuyyiNk= Received: (qmail 84244 invoked by alias); 16 Dec 2015 20:35:48 -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 83965 invoked by uid 89); 16 Dec 2015 20:35:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=nvptx.h, UD:nvptx.h, nvptxh X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 16 Dec 2015 20:35:46 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id AAF8A8F4F1; Wed, 16 Dec 2015 20:35:45 +0000 (UTC) Received: from localhost.localdomain (ovpn-113-83.phx2.redhat.com [10.3.113.83]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBGKZjv6019642; Wed, 16 Dec 2015 15:35:45 -0500 Subject: Re: [RFA] [PATCH] Fix invalid redundant extension elimination for rl78 port To: gcc-patches , rdsandiford@googlemail.com References: <56537379.4030101@redhat.com> <871tb655i9.fsf@googlemail.com> From: Jeff Law Message-ID: <5671CB21.70004@redhat.com> Date: Wed, 16 Dec 2015 13:35:45 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <871tb655i9.fsf@googlemail.com> X-IsSubscribed: yes On 12/01/2015 12:32 PM, Richard Sandiford wrote: > Jeff Law writes: >> @@ -1080,6 +1070,18 @@ add_removable_extension (const_rtx expr, rtx_insn *insn, >> } >> } >> >> + /* Fourth, if the extended version occupies more registers than the >> + original and the source of the extension is the same hard register >> + as the destination of the extension, then we can not eliminate >> + the extension without deep analysis, so just punt. >> + >> + We allow this when the registers are different because the >> + code in combine_reaching_defs will handle that case correctly. */ >> + if ((HARD_REGNO_NREGS (REGNO (dest), mode) >> + != HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg))) >> + && REGNO (dest) == REGNO (reg)) >> + return; >> + >> /* Then add the candidate to the list and insert the reaching definitions >> into the definition map. */ >> ext_cand e = {expr, code, mode, insn}; > > I might be wrong, but the check looks specific to little-endian. Would > it make sense to use reg_overlap_mentioned_p instead of the REGNO check? Fixed thusly. Installed on the trunk after the usual testing on x86_64-linux-gnu and verifying that rl78-elf doesn't botch pr42833.c. Jeff commit 362f406136207b89bddab99f5ff904b0798b7115 Author: law Date: Wed Dec 16 20:34:31 2015 +0000 * ree.c (add_removable_extension): Use reg_overlap_mentioned_p rather than testing hard register #s. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231719 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1d2a994..a8475b7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-12-16 Jeff Law + + * ree.c (add_removable_extension): Use reg_overlap_mentioned_p + rather than testing hard register #s. + 2015-12-16 Nathan Sidwell * config/nvptx/nvptx.h (OUTGOING_STATIC_CHAIN_REGNUM): Remove. diff --git a/gcc/ree.c b/gcc/ree.c index 6cfc477..d12e24d 100644 --- a/gcc/ree.c +++ b/gcc/ree.c @@ -1085,7 +1085,7 @@ add_removable_extension (const_rtx expr, rtx_insn *insn, code in combine_reaching_defs will handle that case correctly. */ if ((HARD_REGNO_NREGS (REGNO (dest), mode) != HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg))) - && REGNO (dest) == REGNO (reg)) + && reg_overlap_mentioned_p (dest, reg)) return; /* Then add the candidate to the list and insert the reaching definitions