This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Speed up # of iterations analysis
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 03 Apr 2005 13:48:54 -0400
- Subject: Re: [patch] Speed up # of iterations analysis
- References: <20050403164308.GA3060@atrey.karlin.mff.cuni.cz>
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?