[PATCH] Update loop docs

Richard Biener rguenther@suse.de
Tue Dec 18 12:43:00 GMT 2012


This updates loop docs to reflect changes I did for 4.8, which is
mostly that loop structures are now preserved from the start of
GIMPLE loop optimizations until the end of RTL loop optimizations.
Apart from the stale 'Lambda' chapter (and the missing GRAPHITE
chapter ...) things are surprisingly up-to-date.

Thus I'd welcome hints at what information you are currently
missing and I'll promise to fill in bits as I can (which means
_not_ GRAPHITE).  In particular the docs very well state what
information can be relied on in what cases.

Thanks,
Richard.

2012-12-18  Richard Biener  <rguenther@suse.de>

	* doc/loop.texi (Lambda): Remove section.
	(Loop representation): Update with respect to us now preserving
	loop structures througout most of the compilation.

Index: gcc/doc/loop.texi
===================================================================
*** gcc/doc/loop.texi	(revision 194552)
--- gcc/doc/loop.texi	(working copy)
*************** variable analysis and number of iteratio
*** 25,31 ****
  * loop-iv::                     Induction variables on RTL.
  * Number of iterations::        Number of iterations analysis.
  * Dependency analysis::         Data dependency analysis.
- * Lambda::                      Linear loop transformations framework.
  * Omega::                       A solver for linear programming problems.
  @end menu
  
--- 25,30 ----
*************** variable analysis and number of iteratio
*** 37,46 ****
  This chapter describes the representation of loops in GCC, and functions
  that can be used to build, modify and analyze this representation.  Most
  of the interfaces and data structures are declared in @file{cfgloop.h}.
! At the moment, loop structures are analyzed and this information is
! updated only by the optimization passes that deal with loops, but some
! efforts are being made to make it available throughout most of the
! optimization passes.
  
  In general, a natural loop has one entry block (header) and possibly
  several back edges (latches) leading to the header from the inside of
--- 36,48 ----
  This chapter describes the representation of loops in GCC, and functions
  that can be used to build, modify and analyze this representation.  Most
  of the interfaces and data structures are declared in @file{cfgloop.h}.
! Loop structures are analyzed and this information disposed or updated
! at the discretion of individual passes.  Still most of the generic
! CFG manipulation routines are aware of loop structures and try to
! keep them up-to-date.  By this means an increasing part of the
! compilation pipeline is setup to maintain loop structure across
! passes to allow attaching meta information to individual loops
! for consumption by later passes.
  
  In general, a natural loop has one entry block (header) and possibly
  several back edges (latches) leading to the header from the inside of
*************** recorded.
*** 139,147 ****
  These properties may also be computed/enforced later, using functions
  @code{create_preheaders}, @code{force_single_succ_latches},
  @code{mark_irreducible_loops} and @code{record_loop_exits}.
  
  The memory occupied by the loops structures should be freed with
! @code{loop_optimizer_finalize} function.
  
  The CFG manipulation functions in general do not update loop structures.
  Specialized versions that additionally do so are provided for the most
--- 141,153 ----
  These properties may also be computed/enforced later, using functions
  @code{create_preheaders}, @code{force_single_succ_latches},
  @code{mark_irreducible_loops} and @code{record_loop_exits}.
+ The properties can be queried using @code{loops_state_satisfies_p}.
  
  The memory occupied by the loops structures should be freed with
! @code{loop_optimizer_finalize} function.  When loop structures are
! setup to be preserved across passes this function reduces the
! information to be kept up-to-date to a minimum (only
! @code{LOOPS_MAY_HAVE_MULTIPLE_LATCHES} set).
  
  The CFG manipulation functions in general do not update loop structures.
  Specialized versions that additionally do so are provided for the most
*************** common tasks.  On GIMPLE, @code{cleanup_
*** 149,154 ****
--- 155,164 ----
  used to cleanup CFG while updating the loops structures if
  @code{current_loops} is set.
  
+ At the moment loop structure is preserved from the start of GIMPLE
+ loop optimizations until the end of RTL loop optimizations.  During
+ this time a loop can be tracked by its @code{struct loop} and number.
+ 
  @node Loop querying
  @section Loop querying
  @cindex Loop querying
*************** direction vectors for a data dependence
*** 593,629 ****
  @code{dump_data_references} prints the details of the data references
  contained in a data reference array.
  
- @node Lambda
- @section Linear loop transformations framework
- @cindex Linear loop transformations framework
- 
- Lambda is a framework that allows transformations of loops using
- non-singular matrix based transformations of the iteration space and
- loop bounds. This allows compositions of skewing, scaling, interchange,
- and reversal transformations.  These transformations are often used to
- improve cache behavior or remove inner loop dependencies to allow
- parallelization and vectorization to take place.
- 
- To perform these transformations, Lambda requires that the loopnest be
- converted into an internal form that can be matrix transformed easily.
- To do this conversion, the function
- @code{gcc_loopnest_to_lambda_loopnest} is provided.  If the loop cannot
- be transformed using lambda, this function will return NULL.
- 
- Once a @code{lambda_loopnest} is obtained from the conversion function,
- it can be transformed by using @code{lambda_loopnest_transform}, which
- takes a transformation matrix to apply.  Note that it is up to the
- caller to verify that the transformation matrix is legal to apply to the
- loop (dependence respecting, etc).  Lambda simply applies whatever
- matrix it is told to provide.  It can be extended to make legal matrices
- out of any non-singular matrix, but this is not currently implemented.
- Legality of a matrix for a given loopnest can be verified using
- @code{lambda_transform_legal_p}.
- 
- Given a transformed loopnest, conversion back into gcc IR is done by
- @code{lambda_loopnest_to_gcc_loopnest}.  This function will modify the
- loops so that they match the transformed loopnest.
- 
  
  @node Omega
  @section Omega a solver for linear programming problems
--- 603,608 ----



More information about the Gcc-patches mailing list