This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pretty-ipa merge 15: loop finiteness testing


Hi,

> this patch adds finite_loop_p I would like to use in pure/const and cd-dce later.
> It is basically same logic as in niter, just bit relaxed in three ways:
> 
>   1) It is not working hard enough to find minimal number of iterations
>   2) In pure/const functions it assumes that all loops must be finite.
>   3) It also assume for flag_unsafe_loop_optimizations.
> 
> I would hope that later we will add more tricks.
> 
> I also wonder why !just_once_each_iteration_p is needed here?  It does
> not matter if the exit sits inside nested loop, right?

it's used there to test that the exit is executed at least once in each
iteration.

> + /* Return true if loop is known to be finite.  */
> + 
> + bool
> + finite_loop_p (struct loop *loop)

This comment is a bit missleading -- it is not entirely clear
what does it mean that the loop is finite.  finite_loop_p can return true for
loops that never end (e.g. if the loop has an infinite subloop, or
calls a function containing such a loop).

Otherwise OK,

Zdenek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]