From b4a9343cf59f4ccb03c5be05a9314ff1f45712b4 Mon Sep 17 00:00:00 2001 From: Zdenek Dvorak Date: Tue, 14 Jun 2011 16:29:58 +0200 Subject: re PR middle-end/45098 (Missed induction variable optimization) 2011-06-14 Zdenek Dvorak Tom de Vries PR target/45098 * cfgloop.h (nb_iterations_upper_bound, nb_iterations_estimate): Document changed semantics. (max_stmt_executions, max_stmt_executions_int): Declare. * tree-data-ref.c (estimated_loop_iterations) (estimated_loop_iterations_int): Move functions... * tree-ssa-loop-niter.c (estimated_loop_iterations) (estimated_loop_iterations_int): here. (record_estimate): Change nb_iterations_upper_bound and nb_iterations_estimate semantics. (max_stmt_executions, max_stmt_executions_int): New function. * tree-data-ref.c (estimated_loop_iterations_tree): Rename to ... (max_stmt_executions_tree): this. (analyze_miv_subscript): Use max_stmt_executions_tree instead of estimated_loop_iterations_tree. tree-ssa-loop-ivopts.c (avg_loop_niter): Use max_stmt_executions_int instead of estimated_loop_iterations_int. * predict.c (predict_loops): Idem. * tree-parloops.c (parallelize_loops): Idem. * tree-data-ref.c (analyze_siv_subscript_cst_affine) (compute_overlap_steps_for_affine_1_2, analyze_subscript_affine_affine) (init_omega_for_ddr_1): Idem. * tree-ssa-loop-prefetch.c (determine_loop_nest_reuse) (loop_prefetch_arrays): Idem * graphite-sese-to-poly.c (build_loop_iteration_domains): Use max_stmt_executions instead of estimated_loop_iterations. * tree-data-ref.c (estimated_loop_iterations_tree): Idem. * tree-vrp.c (adjust_range_with_scev): Use estimated_loop_iterations instead of nb_iterations_upper_bound. Co-Authored-By: Tom de Vries From-SVN: r175022 --- gcc/cfgloop.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gcc/cfgloop.h') diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h index 0ff44de..510bc10 100644 --- a/gcc/cfgloop.h +++ b/gcc/cfgloop.h @@ -143,11 +143,13 @@ struct GTY ((chain_next ("%h.next"))) loop { computes and caches the computed information in this field. */ tree nb_iterations; - /* An integer guaranteed to bound the number of iterations of the loop - from above. */ + /* An integer guaranteed to be greater or equal to nb_iterations. Only + valid if any_upper_bound is true. */ double_int nb_iterations_upper_bound; - /* An integer giving the expected number of iterations of the loop. */ + /* An integer giving an estimate on nb_iterations. Unlike + nb_iterations_upper_bound, there is no guarantee that it is at least + nb_iterations. */ double_int nb_iterations_estimate; bool any_upper_bound; @@ -278,7 +280,9 @@ extern rtx doloop_condition_get (rtx); void estimate_numbers_of_iterations_loop (struct loop *, bool); HOST_WIDE_INT estimated_loop_iterations_int (struct loop *, bool); +HOST_WIDE_INT max_stmt_executions_int (struct loop *, bool); bool estimated_loop_iterations (struct loop *, bool, double_int *); +bool max_stmt_executions (struct loop *, bool, double_int *); /* Loop manipulation. */ extern bool can_duplicate_loop_p (const struct loop *loop); -- cgit v1.1