From patchwork Thu Nov 4 07:38:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 47030 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3FE1C385801E for ; Thu, 4 Nov 2021 07:39:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3FE1C385801E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1636011573; bh=HAsCeYGUBv31ilMKKX0n5qLHc2Mc01zBssLSNBxolEU=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=E8/xTvbmgt0HLzzbcRNBUc91vfn1BbyonhakGf+WIZHrDToMagFJV+drtuomG6Lkx hLoYfms+GxIdAD3sdTB+fynhogaN7Q9j6kMBv2+/G6QT+Rg1TKdH3SSLu01Fq/D+pR QrXb4SdbLQaeCgaUTGxGav2iIwJGapMUXN+QML0k= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id A4DE73857C64 for ; Thu, 4 Nov 2021 07:38:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A4DE73857C64 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 70F1D21763 for ; Thu, 4 Nov 2021 07:38:50 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 54F9013EB0 for ; Thu, 4 Nov 2021 07:38:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id z+f3EgqOg2FDDQAAMHmgww (envelope-from ) for ; Thu, 04 Nov 2021 07:38:50 +0000 Date: Thu, 4 Nov 2021 08:38:49 +0100 (CET) To: gcc-patches@gcc.gnu.org Subject: [PATCH] Update TARGET_MEM_REF documentation Message-ID: MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , X-Patchwork-Original-From: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" This updates the internals manual documentation of TARGET_MEM_REF and amends MEM_REF. The former was seriously out of date. Pushed to trunk. 2021-11-04 Richard Biener * doc/generic.text: Update TARGET_MEM_REF and MEM_REF documentation. --- gcc/doc/generic.texi | 58 +++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/gcc/doc/generic.texi b/gcc/doc/generic.texi index d317f65fa9f..69f6f375181 100644 --- a/gcc/doc/generic.texi +++ b/gcc/doc/generic.texi @@ -1223,25 +1223,12 @@ meanings. The type of these expressions must be an array whose component type is the same as that of the first operand. The range of that array type determines the amount of data these expressions access. -@item TARGET_MEM_REF -These nodes represent memory accesses whose address directly map to -an addressing mode of the target architecture. The first argument -is @code{TMR_SYMBOL} and must be a @code{VAR_DECL} of an object with -a fixed address. The second argument is @code{TMR_BASE} and the -third one is @code{TMR_INDEX}. The fourth argument is -@code{TMR_STEP} and must be an @code{INTEGER_CST}. The fifth -argument is @code{TMR_OFFSET} and must be an @code{INTEGER_CST}. -Any of the arguments may be NULL if the appropriate component -does not appear in the address. Address of the @code{TARGET_MEM_REF} -is determined in the following way. - -@smallexample -&TMR_SYMBOL + TMR_BASE + TMR_INDEX * TMR_STEP + TMR_OFFSET -@end smallexample - -The sixth argument is the reference to the original memory access, which -is preserved for the purposes of the RTL alias analysis. The seventh -argument is a tag representing the results of tree level alias analysis. +@item COMPONENT_REF +These nodes represent non-static data member accesses. The first +operand is the object (rather than a pointer to it); the second operand +is the @code{FIELD_DECL} for the data member. The third operand represents +the byte offset of the field, but should not be used directly; call +@code{component_ref_field_offset} instead. @item ADDR_EXPR These nodes are used to represent the address of an object. (These @@ -1264,16 +1251,33 @@ pointer or reference type. These nodes are used to represent the object pointed to by a pointer offset by a constant. The first operand is the pointer being dereferenced; it will always have -pointer or reference type. The second operand is a pointer constant. -Its type is specifying the type to be used for type-based alias analysis. +pointer or reference type. The second operand is a pointer constant +serving as constant offset applied to the pointer being dereferenced +with its type specifying the type to be used for type-based alias analysis. +The type of the node specifies the alignment of the access. -@item COMPONENT_REF -These nodes represent non-static data member accesses. The first -operand is the object (rather than a pointer to it); the second operand -is the @code{FIELD_DECL} for the data member. The third operand represents -the byte offset of the field, but should not be used directly; call -@code{component_ref_field_offset} instead. +@item TARGET_MEM_REF +These nodes represent memory accesses whose address directly map to +an addressing mode of the target architecture. The first argument +is @code{TMR_BASE} and is a pointer to the object being accessed. +The second argument is @code{TMR_OFFSET} which is a pointer constant +with dual purpose serving both as constant offset and holder of +the type used for type-based alias analysis. The first two operands +have exactly the same semantics as @code{MEM_REF}. The third +and fourth operand are @code{TMR_INDEX} and @code{TMR_STEP} where +the former is an integer and the latter an integer constant. The +fifth and last operand is @code{TMR_INDEX2} which is an alternate +non-constant offset. Any of the third to last operands may be +@code{NULL} if the corresponding component does not appear in +the address, but @code{TMR_INDEX} and @code{TMR_STEP} shall be +always supplied in pair. The Address of the @code{TARGET_MEM_REF} +is determined in the following way. + +@smallexample +TMR_BASE + TMR_OFFSET + TMR_INDEX * TMR_STEP + TMR_INDEX2 +@end smallexample +The type of the node specifies the alignment of the access. @end table