summaryrefslogtreecommitdiff
path: root/gcc/cfgloopanal.c
diff options
context:
space:
mode:
authormarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2016-07-12 15:27:36 +0000
committermarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2016-07-12 15:27:36 +0000
commit91188633bb94dd42076106c0052a874e9864868c (patch)
tree70856e5c2b14b375399cf75b6678131352b177dd /gcc/cfgloopanal.c
parent94ee1e9c3d96cf04dc6a8105bdb4aec6f49af549 (diff)
downloadgcc-91188633bb94dd42076106c0052a874e9864868c.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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@238252 138bc75d-0d04-0410-961f-82ee72b054a4
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;
}