diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-10-31 14:48:57 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-10-31 14:48:57 +0000 |
commit | d5d4ea6fac084ac36524c5b00f4c5d8973d612c7 (patch) | |
tree | ccb62239319136a6317c794f1949a20d9bf8f1af /gcc/predict.def | |
parent | d2acc292321be80eca9847a42b5099e8babb4932 (diff) | |
download | gcc-d5d4ea6fac084ac36524c5b00f4c5d8973d612c7.tar.gz |
PR profile/24487
* predict.c (predict_loops): Do not estimate more than
MAX_PRED_LOOP_ITERATIONS in PRED_LOOP_ITERATIONS heuristic.
* predict.def (MAX_PRED_LOOP_ITERATIONS): Define.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106276 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/predict.def')
-rw-r--r-- | gcc/predict.def | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/predict.def b/gcc/predict.def index 997f4d2cc98..fefe2ed3eee 100644 --- a/gcc/predict.def +++ b/gcc/predict.def @@ -58,6 +58,18 @@ DEF_PREDICTOR (PRED_UNCONDITIONAL, "unconditional jump", PROB_ALWAYS, DEF_PREDICTOR (PRED_LOOP_ITERATIONS, "loop iterations", PROB_ALWAYS, PRED_FLAG_FIRST_MATCH) +/* For guessed profiles, the loops having unknown number of iterations + are predicted to iterate relatively few (10) times at average. + For functions containing one loop with large known number of iterations + and other loops having unbounded loops we would end up predicting all + the other loops cold that is not usually the case. So we need to artifically + flatten the profile. + + We need to cut the maximal predicted iterations to large enought iterations + so the loop appears important, but safely within HOT_BB_COUNT_FRACTION + range. */ +#define MAX_PRED_LOOP_ITERATIONS 100 + /* Hints dropped by user via __builtin_expect feature. */ DEF_PREDICTOR (PRED_BUILTIN_EXPECT, "__builtin_expect", PROB_VERY_LIKELY, PRED_FLAG_FIRST_MATCH) |