diff options
author | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-09-15 11:17:18 +0000 |
---|---|---|
committer | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-09-15 11:17:18 +0000 |
commit | 883bb2bbc9d7d72a953f5bb685d05c13c4039449 (patch) | |
tree | 760d109441f8836d466cfee8c2c84acab7dcf3e4 /gcc/loop-doloop.c | |
parent | e7cfe3db2d9b23c69eb5e87c5987eb99744fd663 (diff) | |
download | gcc-883bb2bbc9d7d72a953f5bb685d05c13c4039449.tar.gz |
* params.def (PARAM_MAX_ITERATIONS_COMPUTATION_COST): New.
* loop-doloop.c (doloop_optimize): Use it to limit costs of
expanding the number of iterations.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116966 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop-doloop.c')
-rw-r--r-- | gcc/loop-doloop.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/loop-doloop.c b/gcc/loop-doloop.c index f63e3426a47..f2bb9baf1d7 100644 --- a/gcc/loop-doloop.c +++ b/gcc/loop-doloop.c @@ -484,7 +484,7 @@ doloop_optimize (struct loop *loop) rtx iterations_max; rtx start_label; rtx condition; - unsigned level, est_niter; + unsigned level, est_niter, max_cost; struct niter_desc *desc; unsigned word_mode_size; unsigned HOST_WIDE_INT word_mode_max; @@ -525,6 +525,17 @@ doloop_optimize (struct loop *loop) return false; } + max_cost + = COSTS_N_INSNS (PARAM_VALUE (PARAM_MAX_ITERATIONS_COMPUTATION_COST)); + if (rtx_cost (desc->niter_expr, SET) > max_cost) + { + if (dump_file) + fprintf (dump_file, + "Doloop: number of iterations too costly to compute.\n", + est_niter); + return false; + } + count = copy_rtx (desc->niter_expr); iterations = desc->const_iter ? desc->niter_expr : const0_rtx; iterations_max = GEN_INT (desc->niter_max); |