diff options
Diffstat (limited to 'gcc/doc/loop.texi')
-rw-r--r-- | gcc/doc/loop.texi | 28 |
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 |