summaryrefslogtreecommitdiff
path: root/gcc/doc/loop.texi
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-10 23:34:20 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-10 23:34:20 +0000
commit0c3c2e56fcc261364645b2697ef79dd804747376 (patch)
tree49e4518b80f9f2c4c2ddf2edcbb93a2d6e48c84d /gcc/doc/loop.texi
parentfee18fdb7de997d75883919cfed1183b3059317c (diff)
downloadgcc-0c3c2e56fcc261364645b2697ef79dd804747376.tar.gz
* doc/loop.texi: Document number_of_latch_executions and
number_of_cond_exit_executions. * tree-scalar-evolution.c (compute_overall_effect_of_inner_loop, chrec_is_positive, number_of_iterations_for_all_loops, scev_const_prop): Use number_of_latch_executions. (set_nb_iterations_in_loop): Do not increase the value of the number of iterations. (number_of_iterations_in_loop): Renamed to ... (number_of_latch_executions): ... this. (number_of_exit_cond_executions): New function. * tree-scalar-evolution.h (number_of_iterations_in_loop): Declaration removed. (number_of_latch_executions, number_of_exit_cond_executions): Declare. * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables): Use number_of_latch_executions. * tree-data-ref.c (get_number_of_iters_for_loop): Use number_of_exit_cond_executions. * tree-vect-analyze.c (vect_get_loop_niters): Ditto. * cfgloop.h (struct loop): Improve description of the nb_iterations field. * gcc.dg/tree-ssa/loop-17.c: Update outcome. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119718 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/doc/loop.texi')
-rw-r--r--gcc/doc/loop.texi28
1 files changed, 15 insertions, 13 deletions
diff --git a/gcc/doc/loop.texi b/gcc/doc/loop.texi
index 354241f14c7..1b189c778fd 100644
--- a/gcc/doc/loop.texi
+++ b/gcc/doc/loop.texi
@@ -397,13 +397,15 @@ calculations.
@cindex Number of iterations analysis
Both on GIMPLE and on RTL, there are functions available to determine
-the number of iterations of a loop, with a similar interface. In many
-cases, it is not possible to determine number of iterations
-unconditionally -- the determined number is correct only if some
-assumptions are satisfied. The analysis tries to verify these
-conditions using the information contained in the program; if it fails,
-the conditions are returned together with the result. The following
-information and conditions are provided by the analysis:
+the number of iterations of a loop, with a similar interface. The
+number of iterations of a loop in GCC is defined as the number of
+executions of the loop latch. In many cases, it is not possible to
+determine the number of iterations unconditionally -- the determined
+number is correct only if some assumptions are satisfied. The analysis
+tries to verify these conditions using the information contained in the
+program; if it fails, the conditions are returned together with the
+result. The following information and conditions are provided by the
+analysis:
@itemize
@item @code{assumptions}: If this condition is false, the rest of
@@ -431,16 +433,16 @@ number of iterations -- @code{find_loop_niter} on GIMPLE and
@code{find_simple_exit} on RTL. Finally, there are functions that
provide the same information, but additionally cache it, so that
repeated calls to number of iterations are not so costly --
-@code{number_of_iterations_in_loop} on GIMPLE and
-@code{get_simple_loop_desc} on RTL.
+@code{number_of_latch_executions} on GIMPLE and @code{get_simple_loop_desc}
+on RTL.
Note that some of these functions may behave slightly differently than
others -- some of them return only the expression for the number of
iterations, and fail if there are some assumptions. The function
-@code{number_of_iterations_in_loop} works only for single-exit loops,
-and it returns the value for number of iterations higher by one with
-respect to all other functions (i.e., it returns number of executions of
-the exit statement, not of the loop latch).
+@code{number_of_latch_executions} works only for single-exit loops.
+The function @code{number_of_cond_exit_executions} can be used to
+determine number of executions of the exit condition of a single-exit
+loop (i.e., the @code{number_of_latch_executions} increased by one).
@node Dependency analysis
@section Data Dependency Analysis