From 5d6cfd12693c34b702aab148038ebb562f2695f9 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Sun, 3 Jan 2010 11:28:44 +0000 Subject: [PATCH] I was annoyed by the compiler warnings about implicit conversions. [r26895] --- ir/be/beblocksched.c | 4 ++-- ir/be/beprefalloc.c | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ir/be/beblocksched.c b/ir/be/beblocksched.c index 52665a03f..7c0ce9f54 100644 --- a/ir/be/beblocksched.c +++ b/ir/be/beblocksched.c @@ -163,11 +163,11 @@ static void collect_egde_frequency(ir_node *block, void *data) } else if (arity == 1) { ir_node *pred_block = get_Block_cfgpred_block(block, 0); ir_loop *pred_loop = get_irn_loop(pred_block); - float freq = get_block_execfreq(env->execfreqs, block); + float freq = (float)get_block_execfreq(env->execfreqs, block); /* is it an edge leaving a loop */ if (get_loop_depth(pred_loop) > get_loop_depth(loop)) { - float pred_freq = get_block_execfreq(env->execfreqs, pred_block); + float pred_freq = (float)get_block_execfreq(env->execfreqs, pred_block); edge.outedge_penalty_freq = -(pred_freq - freq); } diff --git a/ir/be/beprefalloc.c b/ir/be/beprefalloc.c index feefba35a..bcfa253ca 100644 --- a/ir/be/beprefalloc.c +++ b/ir/be/beprefalloc.c @@ -345,7 +345,7 @@ static void check_defs(const ir_nodeset_t *live_nodes, float weight, */ 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; @@ -693,7 +693,7 @@ static bool try_optimistic_split(ir_node *to_split, ir_node *before, 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; @@ -804,7 +804,7 @@ static void assign_reg(const ir_node *block, ir_node *node, 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; @@ -1448,7 +1448,7 @@ static void adapt_phi_prefs(ir_node *phi) 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; } @@ -1470,7 +1470,7 @@ static void propagate_phi_register(ir_node *phi, unsigned assigned_r) 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; @@ -1536,7 +1536,7 @@ static void assign_phi_registers(ir_node *block) 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])); } @@ -1814,7 +1814,7 @@ static void determine_block_order(void) 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; -- 2.20.1