This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
tree-ssa.texi patchlet
- From: Andrew MacLeod <amacleod at redhat dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 15 Apr 2005 12:30:41 -0400
- Subject: tree-ssa.texi patchlet
I've checked in the following patch to address the grammer and
abbreviation issues in the last document update I did for immediate
uses.
Andrew
2005-04-15 Andrew Macleod <amacleod@redhat.com>
* doc/tree-ssa.texi: Grammer/abbreviation updates.
Index: tree-ssa.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tree-ssa.texi,v
retrieving revision 1.22
diff -c -p -r1.22 tree-ssa.texi
*** tree-ssa.texi 10 Apr 2005 17:26:03 -0000 1.22
--- tree-ssa.texi 15 Apr 2005 16:25:16 -0000
*************** print_ops (tree stmt)
*** 886,898 ****
@}
@end smallexample
! Operands use to be updated lazily via calls to @code{get_stmt_operands}.
! This function is now deprecated and operands are updated as soon as the stmt is
! finished via a call to @code{update_stmt}. If statement elements are
! changed via @code{SET_USE} or @code{SET_DEF}, no further action need be
! taken (ie, those macros take care of whatever updating is required). If
! changes are made by manipulating the statement's tree directly, then a call
! must be made to @code{update_stmt} when complete. Calling one of the
@code{bsi_insert} routines or @code{bsi_replace} performs an implicit call
to @code{update_stmt}.
--- 886,898 ----
@}
@end smallexample
! Operands were once updated lazily via calls to @code{get_stmt_operands}.
! This function is now deprecated and operands are updated as soon as the
! statement is finished via a call to @code{update_stmt}. If statement elements
! are changed via @code{SET_USE} or @code{SET_DEF}, then no further action is
! required (ie, those macros take care of updating the statement). If
! changes are made by manipulating the statement's tree directly, then a call
! must be made to @code{update_stmt} when complete. Calling one of the
@code{bsi_insert} routines or @code{bsi_replace} performs an implicit call
to @code{update_stmt}.
*************** iterators, you may examine every use of
*** 1033,1038 ****
--- 1033,1042 ----
to change each use of @code{ssa_var} to @code{ssa_var2}:
@smallexample
+ use_operand_p imm_use_p;
+ imm_use_iterator iterator;
+ tree ssa_var
+
FOR_EACH_IMM_USE_SAFE (imm_use_p, iterator, ssa_var)
SET_USE (imm_use_p, ssa_var_2);
@end smallexample
*************** Some useful functions and macros:
*** 1073,1099 ****
single use of @code{ssa_var}.
@item @code{single_imm_use (ssa_var, use_operand_p *ptr, tree *stmt)} :
Returns true if there is only a single use of @code{ssa_var}, and also returns
! the use pointer and stmt it occurs in in the second and third parameters.
@item @code{num_imm_uses (ssa_var)} : Returns the number of immediate uses of
! @code{ssa_var}. Its better not to use this if possible since it simply
utilizes a loop to count the uses.
@item @code{PHI_ARG_INDEX_FROM_USE (use_p)} : Given a use within a @code{PHI}
node, return the index number for the use. An assert is triggered if the use
isn't located in a @code{PHI} node.
! @item @code{USE_STMT (use_p)} : Return the stmt a use occurs in.
@end enumerate
Note that uses are not put into an immediate use list until their statement is
actually inserted into the instruction stream via a @code{bsi_*} routine.
! It is also still possible to utilize lazy updating of stmts, but this should be used only when absolutely required. Both alias analysis and the dominator
! optimizations currently do this.
When lazy updating is being used, the immediate use information is out of date
! and cannot be used reliably. Lazy updating is achieved by simply marking stmts
! modified via calls to @code{mark_stmt_modified} instead of @code{update_stmt}.
! When lazy updating is no longer required, all the modified stmts must have
! @code{update_stmt} called in order to bring them up to date. This must be done before the optimization is finished, or @code{verify_ssa} will trigger an abort.
This is done with a simple loop over the instruction stream:
@smallexample
--- 1077,1106 ----
single use of @code{ssa_var}.
@item @code{single_imm_use (ssa_var, use_operand_p *ptr, tree *stmt)} :
Returns true if there is only a single use of @code{ssa_var}, and also returns
! the use pointer and statement it occurs in in the second and third parameters.
@item @code{num_imm_uses (ssa_var)} : Returns the number of immediate uses of
! @code{ssa_var}. It is better not to use this if possible since it simply
utilizes a loop to count the uses.
@item @code{PHI_ARG_INDEX_FROM_USE (use_p)} : Given a use within a @code{PHI}
node, return the index number for the use. An assert is triggered if the use
isn't located in a @code{PHI} node.
! @item @code{USE_STMT (use_p)} : Return the statement a use occurs in.
@end enumerate
Note that uses are not put into an immediate use list until their statement is
actually inserted into the instruction stream via a @code{bsi_*} routine.
! It is also still possible to utilize lazy updating of statements, but this
! should be used only when absolutely required. Both alias analysis and the
! dominator optimizations currently do this.
When lazy updating is being used, the immediate use information is out of date
! and cannot be used reliably. Lazy updating is achieved by simply marking
! statements modified via calls to @code{mark_stmt_modified} instead of
! @code{update_stmt}. When lazy updating is no longer required, all the
! modified statements must have @code{update_stmt} called in order to bring them
! up to date. This must be done before the optimization is finished, or
! @code{verify_ssa} will trigger an abort.
This is done with a simple loop over the instruction stream:
@smallexample