diff mbox series

Update TARGET_MEM_REF documentation

Message ID r4pr4p8-74oo-582p-2rr2-115s477015p3@fhfr.qr
State New
Headers show
Series Update TARGET_MEM_REF documentation | expand

Commit Message

Richard Biener Nov. 4, 2021, 7:38 a.m. UTC
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  <rguenther@suse.de>

	* doc/generic.text: Update TARGET_MEM_REF and MEM_REF
	documentation.
---
 gcc/doc/generic.texi | 58 +++++++++++++++++++++++---------------------
 1 file changed, 31 insertions(+), 27 deletions(-)
diff mbox series

Patch

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