aboutsummaryrefslogtreecommitdiff
path: root/gcc/predict.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/predict.c')
-rw-r--r--gcc/predict.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/gcc/predict.c b/gcc/predict.c
index e2f7262..8f50ba0 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -624,8 +624,9 @@ predict_loops (struct loops *loops_info, bool rtlsimpleloops)
niter = desc.niter + 1;
if (niter == 0) /* We might overflow here. */
niter = desc.niter;
- if (niter > MAX_PRED_LOOP_ITERATIONS)
- niter = MAX_PRED_LOOP_ITERATIONS;
+ if (niter
+ > (unsigned int) PARAM_VALUE (PARAM_MAX_PREDICTED_ITERATIONS))
+ niter = PARAM_VALUE (PARAM_MAX_PREDICTED_ITERATIONS);
prob = (REG_BR_PROB_BASE
- (REG_BR_PROB_BASE + niter /2) / niter);
@@ -653,19 +654,17 @@ predict_loops (struct loops *loops_info, bool rtlsimpleloops)
if (TREE_CODE (niter) == INTEGER_CST)
{
int probability;
+ int max = PARAM_VALUE (PARAM_MAX_PREDICTED_ITERATIONS);
if (host_integerp (niter, 1)
&& tree_int_cst_lt (niter,
- build_int_cstu (NULL_TREE,
- MAX_PRED_LOOP_ITERATIONS - 1)))
+ build_int_cstu (NULL_TREE, max - 1)))
{
HOST_WIDE_INT nitercst = tree_low_cst (niter, 1) + 1;
probability = ((REG_BR_PROB_BASE + nitercst / 2)
/ nitercst);
}
else
- probability = ((REG_BR_PROB_BASE
- + MAX_PRED_LOOP_ITERATIONS / 2)
- / MAX_PRED_LOOP_ITERATIONS);
+ probability = ((REG_BR_PROB_BASE + max / 2) / max);
predict_edge (exits[j], PRED_LOOP_ITERATIONS, probability);
}