From patchwork Sat Jul 23 09:26:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Sayle X-Patchwork-Id: 1659850 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nextmovesoftware.com header.i=@nextmovesoftware.com header.a=rsa-sha256 header.s=default header.b=GcOQWqQV; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LqgtW0561z9t0G for ; Sat, 23 Jul 2022 19:26:57 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6E4753857BA9 for ; Sat, 23 Jul 2022 09:26:49 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from server.nextmovesoftware.com (server.nextmovesoftware.com [162.254.253.69]) by sourceware.org (Postfix) with ESMTPS id 7A7803858C50 for ; Sat, 23 Jul 2022 09:26:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7A7803858C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=nextmovesoftware.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nextmovesoftware.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nextmovesoftware.com; s=default; h=Content-Type:MIME-Version:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=i9/BX/UZ78CrjuqKB3H+lLxytmCxLdlU4G2tLDi9JxQ=; b=GcOQWqQVTy0hJ+JeoXVm4Ev0dI 7LpCZa1hfzOnhyd/P+9Fw/DxC7jhu3Ox71wI7TYfnV/47ELwPTb9s9zcNwbsx+RMKbfbHjB88MzVn OQF5qXBUI7v68LoBofpXZVIvEMRSUWjswaA8UYers4qb4lm1vZb1F82hjZVs3+j6TZXUZYVHyMsmq DpmnTP0GUb1bDE62Gjn8ZcphwkqSa5TZz4BSRu4iZVyTx6DNk0PPITSh/SrCSRPdxdFr+V1UxG/lY 8YlTcm4QjJ2381ZSPlyy8l0XYZ+IqgMqaTJmFt0QdnDItfIb3Q671rqRhP3YlLqFgiI7ACnWZieu0 uSSdTVfw==; Received: from host109-154-33-170.range109-154.btcentralplus.com ([109.154.33.170]:55476 helo=Dell) by server.nextmovesoftware.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oFBPA-0002eq-QV for gcc-patches@gcc.gnu.org; Sat, 23 Jul 2022 05:26:37 -0400 From: "Roger Sayle" To: "'GCC Patches'" Subject: [Documentation] Correct RTL documentation: (use (mem ...)) is allowed. Date: Sat, 23 Jul 2022 10:26:34 +0100 Message-ID: <06f201d89e76$4ddb3210$e9919630$@nextmovesoftware.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdiedaHS00uNQURJRnGXcZAXkmSqzg== Content-Language: en-gb X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server.nextmovesoftware.com X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - nextmovesoftware.com X-Get-Message-Sender-Via: server.nextmovesoftware.com: authenticated_id: roger@nextmovesoftware.com X-Authenticated-Sender: server.nextmovesoftware.com: roger@nextmovesoftware.com X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" This patch is a one line correction/clarification to GCC's current RTL documentation that explains a USE of a MEM is permissible. PR rtl-optimization/99930 is an interesting example on x86_64 where the backend generates better code when a USE is a (const) MEM than when it is a REG. In fact the backend relies on CSE to propagate the MEM (a constant pool reference) into the USE, to enable combine to merge/simplify instructions. This change has been tested with a make bootstrap, but as it might provoke a discussion, I've decided to not consider it "obvious". Ok for mainline (to document the actual current behavior)? 2022-07-23 Roger Sayle gcc/ChangeLog * doc/rtl.texi (use): Document that the operand may be a MEM. Roger diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi index 43c9ee8..995c8be 100644 --- a/gcc/doc/rtl.texi +++ b/gcc/doc/rtl.texi @@ -3283,7 +3283,8 @@ Represents the use of the value of @var{x}. It indicates that the value in @var{x} at this point in the program is needed, even though it may not be apparent why this is so. Therefore, the compiler will not attempt to delete previous instructions whose only effect is to -store a value in @var{x}. @var{x} must be a @code{reg} expression. +store a value in @var{x}. @var{x} must be a @code{reg} or a @code{mem} +expression. In some situations, it may be tempting to add a @code{use} of a register in a @code{parallel} to describe a situation where the value