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: 141 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f503:0:0:0:0:0 with SMTP id q3csp611267wro; Sat, 23 Jul 2022 02:27:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tB8vSrwkjxcKLMlCa41S5P0wKAagh1xnzEE/zpnUx7ego+rAntyidns4+x86xFfmbt/O3+ X-Received: by 2002:a05:6402:220e:b0:43b:e1e3:47e0 with SMTP id cq14-20020a056402220e00b0043be1e347e0mr839483edb.104.1658568428746; Sat, 23 Jul 2022 02:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658568428; cv=none; d=google.com; s=arc-20160816; b=HBKJmKAapXJhiPKlb6YIYVDabcFXJIyOpaV2W+b4IH9cNy6saczxi3TXXHO4SBsKqQ tGiTDJ6n59+jsoC8m2Q3ca3FsAxYIbc2rpYeraXmLcfhy3HftrostS4oN4zTKzHJPJiS ASlCJyF9MKuubafzz9Sh4hRAIBOMdnEiKP/VN+qAQciPkggNOoR1cpqFWuUFfdZ+HxL7 bqU9l73jHrlZkdnlbQ5v/6lUL5QDsO+2pZhmPRrh15Llpm9/D45/YhUwFsb7M3wMb223 asvR2oaBP4HACmvce+GwhVE767ET5jDTTAH20FwbUeXw24UGP018JamT8x6LwCTXCb0s wOEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-language:thread-index :mime-version:message-id:date:subject:to:from:dkim-signature :dmarc-filter:delivered-to; bh=i9/BX/UZ78CrjuqKB3H+lLxytmCxLdlU4G2tLDi9JxQ=; b=WoPz8DqtfnVbucARt3VzV/0VTmAgwNzzEuGArx69m37mM9oOwBztRqRoGYXOWIjSqC HF/dR9V4gpPuXYkyEhQlXwojduvphoz+EnaaqPNREBvFZMXTEx+gDVltwteyyqeTriJm ij1/VEeBXXwfBD+FSOUpPpNC4CtWqjSsqhjbT4RI520Ft3+N7RgPN3XL4oRfqwwxqgZu gmm/Tcb0SIqc+BxfZGjPzK3EKd9MVJmh7IZ024vzN4BSfMBfP6+NLrMtHevtv8wKKzqi vJ5WNsV0GxHjZzhGX84TPEbDhxXvFvL8LCKLrVUduG9Q2LETZuuXxSelchPoC2hS+WIU CH5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nextmovesoftware.com header.s=default header.b=GcOQWqQV; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id o15-20020a50fd8f000000b0043bcd0ecd74si4614035edt.202.2022.07.23.02.27.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jul 2022 02:27:08 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=fail header.i=@nextmovesoftware.com header.s=default header.b=GcOQWqQV; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F34933857415 for ; Sat, 23 Jul 2022 09:27:01 +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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1739135048874490223?= X-GMAIL-MSGID: =?utf-8?q?1739135048874490223?= 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