This is the mail archive of the
mailing list for the GCC project.
Re: [patch] Some ivopts improvements
> On Mon, May 16, 2005 at 09:24:29PM +0200, Zdenek Dvorak wrote:
> > 2) number_of_iterations_cond uses tree_expr_nonnegative_p to detect
> > whether we are not dealing with paradoxical loops. This test fails
> > when the control variable is unsigned, since then
> > tree_expr_nonnegative_p is always true.
> Got a test case for this one?
we are unable to determine number of iterations in
number_of_iterations_cond for example for
void foo (void)
for (a = 10; a > 5; a -= 2)
(the problem is masked, however -- we determine the number of
iterations by brute force evaluation in the ivcanon pass).
I will add a testcase to testsuite.
> > * tree-ssa-loop-ivopts.c (find_bivs, find_givs_in_stmt_scev): Apply
> > expand_simple_operations to bases of the ivs.
> > (tree_int_cst_sign_bit): Export.
> > * tree-flow.h (expand_simple_operations): Declare.
> > * tree-ssa-loop-niter.c (number_of_iterations_cond): Use
> > tree_int_cst_sign_bit.
> > (expand_simple_operations): Export.
> > * tree.h (tree_int_cst_sign_bit): Declare.