static void
predict_insn (rtx insn, enum br_predictor predictor, int probability)
{
- if (!any_condjump_p (insn))
- abort ();
+ gcc_assert (any_condjump_p (insn));
if (!flag_guess_branch_prob)
return;
/* Save the prediction into CFG in case we are seeing non-degenerated
conditional jump. */
- if (EDGE_COUNT (bb->succs) > 1)
+ if (!single_succ_p (bb))
{
BRANCH_EDGE (bb)->probability = combined_probability;
FALLTHRU_EDGE (bb)->probability
= REG_BR_PROB_BASE - combined_probability;
}
}
- else if (EDGE_COUNT (bb->succs) > 1)
+ else if (!single_succ_p (bb))
{
int prob = INTVAL (XEXP (prob_note, 0));
FALLTHRU_EDGE (bb)->probability = REG_BR_PROB_BASE - prob;
}
else
- EDGE_SUCC (bb, 0)->probability = REG_BR_PROB_BASE;
+ single_succ_edge (bb)->probability = REG_BR_PROB_BASE;
}
/* Combine predictions into single probability and store them into CFG.
care for error returns and other are often used for fast paths
trought function. */
if ((e->dest == EXIT_BLOCK_PTR
- || (EDGE_COUNT (e->dest->succs) == 1
- && EDGE_SUCC (e->dest, 0)->dest == EXIT_BLOCK_PTR))
+ || (single_succ_p (e->dest)
+ && single_succ (e->dest) == EXIT_BLOCK_PTR))
&& !predicted_by_p (bb, PRED_NULL_RETURN)
&& !predicted_by_p (bb, PRED_CONST_RETURN)
&& !predicted_by_p (bb, PRED_NEGATIVE_RETURN)
&& TREE_CHAIN (arglist))
{
TREE_OPERAND (stmt, 1) = TREE_VALUE (arglist);
- modify_stmt (stmt);
+ update_stmt (stmt);
}
}
}
fast paths trought function. */
if (e->dest == EXIT_BLOCK_PTR
&& TREE_CODE (last_stmt (bb)) == RETURN_EXPR
- && EDGE_COUNT (bb->preds) > 1)
+ && !single_pred_p (bb))
{
edge e1;
edge_iterator ei1;
cond = simplify_rtx (cond);
/* Turn the condition into a scaled branch probability. */
- if (cond != const_true_rtx && cond != const0_rtx)
- abort ();
+ gcc_assert (cond == const_true_rtx || cond == const0_rtx);
predict_insn_def (insn, PRED_BUILTIN_EXPECT,
cond == const_true_rtx ? TAKEN : NOT_TAKEN);
}
return (bb->next_bb == EXIT_BLOCK_PTR
|| (bb->next_bb->next_bb == EXIT_BLOCK_PTR
- && EDGE_COUNT (bb->succs) == 1
- && EDGE_SUCC (bb, 0)->dest->next_bb == EXIT_BLOCK_PTR));
+ && single_succ_p (bb)
+ && single_succ (bb)->next_bb == EXIT_BLOCK_PTR));
}
/* Sets branch probabilities according to PREDiction and
{
#ifdef ENABLE_CHECKING
FOR_EACH_EDGE (e, ei, bb->preds)
- if (bitmap_bit_p (tovisit, e->src->index)
- && !(e->flags & EDGE_DFS_BACK))
- abort ();
+ gcc_assert (!bitmap_bit_p (tovisit, e->src->index)
+ || (e->flags & EDGE_DFS_BACK));
#endif
FOR_EACH_EDGE (e, ei, bb->preds)
/* We can not compute accurately for large thresholds due to scaled
frequencies. */
- if (threshold > BB_FREQ_MAX)
- abort ();
+ gcc_assert (threshold <= BB_FREQ_MAX);
/* Frequencies are out of range. This either means that function contains
internal loop executing more than BB_FREQ_MAX times or profile feedback
mark_dfs_back_edges ();
- EDGE_SUCC (ENTRY_BLOCK_PTR, 0)->probability = REG_BR_PROB_BASE;
+ single_succ_edge (ENTRY_BLOCK_PTR)->probability = REG_BR_PROB_BASE;
/* Set up block info for each basic block. */
tovisit = BITMAP_ALLOC (NULL);