Commit 216e8374 by Jan Hubicka Committed by Jan Hubicka

loop-doloop.c (doloop_optimize): Use get_estimated_loop_iterations_int and…

loop-doloop.c (doloop_optimize): Use get_estimated_loop_iterations_int and get_max_loop_iterations_int.

	* loop-doloop.c (doloop_optimize): Use get_estimated_loop_iterations_int
	and get_max_loop_iterations_int.

From-SVN: r236509
parent 77c9d5b4
2016-05-20 Jan Hubicka <hubicka@ucw.cz> 2016-05-20 Jan Hubicka <hubicka@ucw.cz>
* loop-doloop.c (doloop_optimize): Use get_estimated_loop_iterations_int
and get_max_loop_iterations_int.
2016-05-20 Jan Hubicka <hubicka@ucw.cz>
* tree-ssa-loop-niter.c (idx_infer_loop_bounds): We can not produce * tree-ssa-loop-niter.c (idx_infer_loop_bounds): We can not produce
realistic upper bounds here. realistic upper bounds here.
......
...@@ -610,7 +610,8 @@ doloop_optimize (struct loop *loop) ...@@ -610,7 +610,8 @@ doloop_optimize (struct loop *loop)
widest_int iterations, iterations_max; widest_int iterations, iterations_max;
rtx_code_label *start_label; rtx_code_label *start_label;
rtx condition; rtx condition;
unsigned level, est_niter; unsigned level;
HOST_WIDE_INT est_niter;
int max_cost; int max_cost;
struct niter_desc *desc; struct niter_desc *desc;
unsigned word_mode_size; unsigned word_mode_size;
...@@ -635,21 +636,16 @@ doloop_optimize (struct loop *loop) ...@@ -635,21 +636,16 @@ doloop_optimize (struct loop *loop)
} }
mode = desc->mode; mode = desc->mode;
est_niter = 3; est_niter = get_estimated_loop_iterations_int (loop);
if (desc->const_iter) if (est_niter == -1)
est_niter = desc->niter; est_niter = get_max_loop_iterations_int (loop);
/* If the estimate on number of iterations is reliable (comes from profile
feedback), use it. Do not use it normally, since the expected number if (est_niter >= 0 && est_niter < 3)
of iterations of an unrolled loop is 2. */
if (loop->header->count)
est_niter = expected_loop_iterations (loop);
if (est_niter < 3)
{ {
if (dump_file) if (dump_file)
fprintf (dump_file, fprintf (dump_file,
"Doloop: Too few iterations (%u) to be profitable.\n", "Doloop: Too few iterations (%u) to be profitable.\n",
est_niter); (unsigned int)est_niter);
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment