Filled using information from predict.def. */
struct predictor_info
{
- const char *name; /* Name used in the debugging dumps. */
- int hitrate; /* Expected hitrate used by
- predict_insn_def call. */
- int flags;
+ const char *const name; /* Name used in the debugging dumps. */
+ const int hitrate; /* Expected hitrate used by
+ predict_insn_def call. */
+ const int flags;
};
/* Use given predictor without Dempster-Shaffer theory if it matches
#define HITRATE(VAL) ((int)((VAL) * REG_BR_PROB_BASE + 50) / 100)
#define DEF_PREDICTOR(ENUM, NAME, HITRATE, FLAGS) {NAME, HITRATE, FLAGS},
-struct predictor_info predictor_info[] = {
+static const struct predictor_info predictor_info[] = {
#include "predict.def"
/* Upper bound on predictors. */
as canonicalize_condition will render this to us as
(lt r70, r71)
Could use cselib to try and reduce this further. */
- cond = XEXP (SET_SRC (PATTERN (insn)), 0);
+ cond = XEXP (SET_SRC (pc_set (insn)), 0);
cond = canonicalize_condition (insn, cond, 0, NULL, ev_reg);
if (! cond
|| XEXP (cond, 0) != ev_reg
estimate_bb_frequencies (loops)
struct loops *loops;
{
- block_info bi;
- edge_info ei;
- int edgenum = 0;
int i;
double freq_max = 0;
ENTRY_BLOCK_PTR->succ->probability = REG_BR_PROB_BASE;
/* Set up block info for each basic block. */
- bi = (block_info) xcalloc ((n_basic_blocks + 2), sizeof (*bi));
- ei = (edge_info) xcalloc ((n_edges), sizeof (*ei));
+ alloc_aux_for_blocks (sizeof (struct block_info_def));
+ alloc_aux_for_edges (sizeof (struct edge_info_def));
for (i = -2; i < n_basic_blocks; i++)
{
edge e;
bb = EXIT_BLOCK_PTR;
else
bb = BASIC_BLOCK (i);
- bb->aux = bi + i + 2;
BLOCK_INFO (bb)->tovisit = 0;
for (e = bb->succ; e; e = e->succ_next)
- {
- e->aux = ei + edgenum, edgenum++;
- EDGE_INFO (e)->back_edge_prob = ((double) e->probability
- / REG_BR_PROB_BASE);
- }
+ EDGE_INFO (e)->back_edge_prob = ((double) e->probability
+ / REG_BR_PROB_BASE);
}
/* First compute probabilities locally for each loop from innermost
to outermost to examine probabilities for back edges. */
+ 0.5);
}
- free (ei);
- free (bi);
+ free_aux_for_blocks ();
+ free_aux_for_edges ();
}