diff options
author | Martin Liska <mliska@suse.cz> | 2016-07-12 17:27:36 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2016-07-12 15:27:36 +0000 |
commit | 4661839ee33dff6b43625e9e69fd9a74830556b4 (patch) | |
tree | 70856e5c2b14b375399cf75b6678131352b177dd /gcc/tree-ssa-loop-ivopts.c | |
parent | f507d20235bb7c05ce24c92f65b8aead2594e797 (diff) | |
download | gcc-4661839ee33dff6b43625e9e69fd9a74830556b4.zip gcc-4661839ee33dff6b43625e9e69fd9a74830556b4.tar.gz gcc-4661839ee33dff6b43625e9e69fd9a74830556b4.tar.bz2 |
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/tree-ssa-loop-ivopts.c')
-rw-r--r-- | gcc/tree-ssa-loop-ivopts.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index f5f6e78..20cf9ef 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -115,8 +115,6 @@ along with GCC; see the file COPYING3. If not see /* The infinite cost. */ #define INFTY 10000000 -#define AVG_LOOP_NITER(LOOP) 5 - /* Returns the expected number of loop iterations for LOOP. The average trip count is computed from profile data if it exists. */ @@ -128,8 +126,9 @@ avg_loop_niter (struct loop *loop) if (niter == -1) { niter = likely_max_stmt_executions_int (loop); - if (niter == -1 || niter > AVG_LOOP_NITER (loop)) - return AVG_LOOP_NITER (loop); + + if (niter == -1 || niter > PARAM_VALUE (PARAM_AVG_LOOP_NITER)) + return PARAM_VALUE (PARAM_AVG_LOOP_NITER); } return niter; |