[patch] Speed up # of iterations analysis

Daniel Berlin dberlin@dberlin.org
Sun Apr 3 17:49:00 GMT 2005


On Sun, 2005-04-03 at 18:43 +0200, Zdenek Dvorak wrote:
> Hello,
> 
> on some testcases, we spend large amount of time in # of iterations
> analysis (about 3% on PR 18687).  There does not seem to be any
> significant problem with the usage of the analysis (we call it about
> three times per loop, from different optimization passes), just the
> analysis by itself is slow.  This patch contains a few speedups:
> 
> 1) makes tree-ssa-loop-niter use fold_build instead of
>    fold (build (...))
> 2) Adds a special handling for loops with step 1.
> 3) Removes simplify_using_outer_evolutions.  This function does
>    basically constant propagation in weird special cases,
>    like
> 
>    for (i = 0; i < 50; i++)
>      ...;
>    for (; i < 100; i++)
>      ...;
> 
>    to detect that the initial value of i in the second loop is 50.
>    In practice, this just wastes time.


Does your analysis still properly determine that the second loop has 50
iterations with that removed?





More information about the Gcc-patches mailing list