static void compute_function_frequency (void);
static void choose_function_section (void);
static bool can_predict_insn_p (rtx);
-static void estimate_bb_frequencies (void);
/* Information we hold about each branch predictor.
Filled using information from predict.def. */
static void
predict_loops (void)
{
- unsigned i;
+ loop_iterator li;
+ struct loop *loop;
scev_initialize ();
/* Try to predict out blocks in a loop that are not part of a
natural loop. */
- for (i = 1; i < current_loops->num; i++)
+ FOR_EACH_LOOP (li, loop, 0)
{
basic_block bb, *bbs;
unsigned j, n_exits;
- struct loop *loop = current_loops->parray[i];
VEC (edge, heap) *exits;
struct tree_niter_desc niter_desc;
edge ex;
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 - 1)))
+ && compare_tree_int (niter, max-1) == -1)
{
HOST_WIDE_INT nitercst = tree_low_cst (niter, 1) + 1;
probability = ((REG_BR_PROB_BASE + nitercst / 2)
count_max = MAX (true_count_max, 1);
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
bb->frequency = (bb->count * BB_FREQ_MAX + count_max / 2) / count_max;
+
return true_count_max;
}
/* Estimate basic blocks frequency by given branch probabilities. */
-static void
+void
estimate_bb_frequencies (void)
{
basic_block bb;