From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46612 invoked by alias); 25 Jul 2017 22:29:50 -0000 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 Received: (qmail 46574 invoked by uid 89); 25 Jul 2017 22:29:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=depended, opportunity 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 ESMTP; Tue, 25 Jul 2017 22:29:47 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 70933155B9; Tue, 25 Jul 2017 22:29:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 70933155B9 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=law@redhat.com Received: from localhost.localdomain (ovpn-116-49.phx2.redhat.com [10.3.116.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA4FF6BF7B; Tue, 25 Jul 2017 22:29:45 +0000 (UTC) Subject: Re: [PATCH] Fix PR46932: Block auto increment on frame pointer To: Wilco Dijkstra , GCC Patches Cc: nd References: <27a1b18b-a698-f50d-f026-1dc956e3c673@redhat.com> From: Jeff Law Message-ID: <1f366303-728e-afda-eebe-286226adbdcb@redhat.com> Date: Tue, 25 Jul 2017 22:29:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2017-07/txt/msg01615.txt.bz2 On 07/25/2017 03:25 PM, Wilco Dijkstra wrote: > Jeff Law wrote: > >> My only concern here would be cases where we don't end up eliminating FP >> to SP. But I'd think it's unlikely that we'd have enough auto-inc >> opportunities on the frame pointer for it to matter much anyway. > > What kind of case are you thinking of? Whether it is SP or FP doesn't matter, > we cannot copy propagate the pointer: None in particular. My point was that we're unlikely to even see that many cases where an autoinc opportunity exists using the frame pointer to begin with. So I don't see that restricting auto-incs involving FP should ever cause significant problems. > > add x1, fp, 32 > strb w0, [x1, -1]! > > Not even if the elimination offset is zero: > > mov x1, fp > strb w0, [x1, 31]! > > Basically an independent add is better than the above: > > strb w0, [fp, 31] > add x1, fp, 31 > > I think the phase is still overly aggressive and there are more cases where it > doesn't make sense to use auto increment. For example you will extra moves > just like the 2nd case above when it's not the last use of the source. Certainly possible in the general sense, though we have some targets (SH IIRC) that try really hard to exploit autoinc addressing modes. On modern processors I would think the independent add is usually a better choice. Instructions with multiple outputs are problematic for out-of-order processors. You often end up holding resources within the CPU until the instruction can fully retire and often no dependent insns are allowed to move forward either, even if they just depended on the embedded arithmetic which may be ready to retire had it been issued as a separate instruction. Jeff