summaryrefslogtreecommitdiff
path: root/gcc/cfgloopanal.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2016-07-12 17:27:36 +0200
committerMartin Liska <marxin@gcc.gnu.org>2016-07-12 15:27:36 +0000
commit4661839ee33dff6b43625e9e69fd9a74830556b4 (patch)
tree70856e5c2b14b375399cf75b6678131352b177dd /gcc/cfgloopanal.c
parentf507d20235bb7c05ce24c92f65b8aead2594e797 (diff)
downloadgcc-4661839ee33dff6b43625e9e69fd9a74830556b4.tar.gz
Introduce new param: AVG_LOOP_NITER
* params.def: Add avg-loop niter. * tree-ssa-loop-ivopts.c (avg_loop_niter): Use the param. * cfgloopanal.c (expected_loop_iterations_unbounded): Likewise. * doc/invoke.texi: Document the new parameter. From-SVN: r238252
Diffstat (limited to 'gcc/cfgloopanal.c')
-rw-r--r--gcc/cfgloopanal.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/cfgloopanal.c b/gcc/cfgloopanal.c
index c1639869278..2739f44a3a6 100644
--- a/gcc/cfgloopanal.c
+++ b/gcc/cfgloopanal.c
@@ -241,10 +241,9 @@ expected_loop_iterations_unbounded (const struct loop *loop,
if (read_profile_p)
*read_profile_p = false;
- /* Average loop rolls about 3 times. If we have no profile at all, it is
- best we can do. */
+ /* If we have no profile at all, use AVG_LOOP_NITER. */
if (profile_status_for_fn (cfun) == PROFILE_ABSENT)
- expected = 3;
+ expected = PARAM_VALUE (PARAM_AVG_LOOP_NITER);
else if (loop->latch->count || loop->header->count)
{
gcov_type count_in, count_latch;
@@ -282,9 +281,9 @@ expected_loop_iterations_unbounded (const struct loop *loop,
if (freq_in == 0)
{
- /* If we have no profile at all, expect 3 iterations. */
+ /* If we have no profile at all, use AVG_LOOP_NITER iterations. */
if (!freq_latch)
- expected = 3;
+ expected = PARAM_VALUE (PARAM_AVG_LOOP_NITER);
else
expected = freq_latch * 2;
}