return;
penalty *= NEIGHBOR_FACTOR;
- n_allowed = rbitset_popcnt(limited, n_regs);
+ n_allowed = rbitset_popcount(limited, n_regs);
if (n_allowed > 1) {
/* only create a very weak penalty if multiple regs are allowed */
penalty = (penalty * 0.8f) / n_allowed;
int arity = get_irn_arity(insn);
int i;
- float factor = 1.0f / rbitset_popcnt(&req->other_same, arity);
+ float factor = 1.0f / rbitset_popcount(&req->other_same, arity);
for (i = 0; i < arity; ++i) {
ir_node *op;
unsigned r;
*/
static void analyze_block(ir_node *block, void *data)
{
- float weight = get_block_execfreq(execfreqs, block);
+ float weight = (float)get_block_execfreq(execfreqs, block);
ir_nodeset_t live_nodes;
ir_node *node;
(void) data;
from_reg = arch_get_irn_register(to_split);
from_r = arch_register_get_index(from_reg);
block = get_nodes_block(before);
- split_threshold = get_block_execfreq(execfreqs, block) * SPLIT_DELTA;
+ split_threshold = (float)get_block_execfreq(execfreqs, block) * SPLIT_DELTA;
if (pref_delta < split_threshold*0.5)
return false;
in_node = skip_Proj(node);
if (req->type & arch_register_req_type_should_be_same) {
- float weight = get_block_execfreq(execfreqs, block);
+ float weight = (float)get_block_execfreq(execfreqs, block);
int arity = get_irn_arity(in_node);
int i;
DB((dbg, LEVEL_2, "Perm %+F (perm %+F,%+F, before %+F)\n",
perm, in[0], in[1], before));
- proj0 = new_r_Proj(block, perm, get_irn_mode(in[0]), 0);
+ proj0 = new_r_Proj(perm, get_irn_mode(in[0]), 0);
mark_as_copy_of(proj0, in[0]);
reg = arch_register_for_index(cls, old_r);
use_reg(proj0, reg);
- proj1 = new_r_Proj(block, perm, get_irn_mode(in[1]), 1);
+ proj1 = new_r_Proj(perm, get_irn_mode(in[1]), 1);
mark_as_copy_of(proj1, in[1]);
reg = arch_register_for_index(cls, r2);
use_reg(proj1, reg);
continue;
/* give bonus for already assigned register */
- weight = get_block_execfreq(execfreqs, pred_block);
+ weight = (float)get_block_execfreq(execfreqs, pred_block);
r = arch_register_get_index(reg);
info->prefs[r] += weight * AFF_PHI;
}
ir_node *pred_block = get_Block_cfgpred_block(block, i);
unsigned r;
float weight
- = get_block_execfreq(execfreqs, pred_block) * AFF_PHI;
+ = (float)get_block_execfreq(execfreqs, pred_block) * AFF_PHI;
if (info->prefs[assigned_r] >= weight)
continue;
costs = costs < 0 ? -logf(-costs+1) : logf(costs+1);
costs *= 100;
costs += 10000;
- hungarian_add(bp, n, r, costs);
+ hungarian_add(bp, n, r, (int)costs);
DB((dbg, LEVEL_3, " %s(%f)", arch_register_for_index(cls, r)->name,
info->prefs[r]));
}
block_costs_t *cost_info;
ir_node *block = blocklist[i];
- float execfreq = get_block_execfreq(execfreqs, block);
+ float execfreq = (float)get_block_execfreq(execfreqs, block);
float costs = execfreq;
int n_cfgpreds = get_Block_n_cfgpreds(block);
int p;
}
}
block = best_pred;
- } while(block != NULL && !Block_block_visited(block));
+ } while (block != NULL && !Block_block_visited(block));
/* now put all nodes in the worklist in our final order */
while (!pdeq_empty(worklist)) {
static void dump(int mask, ir_graph *irg, const char *suffix,
void (*dumper)(ir_graph *, const char *))
{
- if(birg->main_env->options->dump_flags & mask)
+ if (birg->main_env->options->dump_flags & mask)
be_dump(irg, suffix, dumper);
}
obstack_free(&obst, NULL);
}
-/**
- * Initializes this module.
- */
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_pref_alloc);
void be_init_pref_alloc(void)
{
static be_ra_t be_ra_pref = {
be_register_allocator("pref", &be_ra_pref);
FIRM_DBG_REGISTER(dbg, "firm.be.prefalloc");
}
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_pref_alloc);