summaryrefslogtreecommitdiffhomepage
path: root/ir/be/beblocksched.c
diff options
context:
space:
mode:
authorMatthias Braun <matthias.braun@kit.edu>2012-07-10 15:52:01 +0200
committerMatthias Braun <matthias.braun@kit.edu>2012-07-10 15:52:01 +0200
commit31d36dd3e8a2b7b513958f005cc555e01b9c3d5b (patch)
tree416d7cfcacd3233e54eb18aa0e87c6f65c34b17b /ir/be/beblocksched.c
parente147f751c8a77f40096fa59cba555669e9af688b (diff)
make code C++ warning clean (again)
Diffstat (limited to 'ir/be/beblocksched.c')
-rw-r--r--ir/be/beblocksched.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/ir/be/beblocksched.c b/ir/be/beblocksched.c
index b9333e5..029bafd 100644
--- a/ir/be/beblocksched.c
+++ b/ir/be/beblocksched.c
@@ -127,6 +127,11 @@ struct blocksched_env_t {
int blockcount;
};
+static blocksched_entry_t* get_blocksched_entry(const ir_node *block)
+{
+ return (blocksched_entry_t*)get_irn_link(block);
+}
+
/**
* Collect cfg frequencies of all edges between blocks.
* Also determines edge with highest frequency.
@@ -598,11 +603,10 @@ static int add_ilp_edge(ir_node *block, int pos, double execfreq, blocksched_ilp
static void collect_egde_frequency_ilp(ir_node *block, void *data)
{
- blocksched_ilp_env_t *env = data;
+ blocksched_ilp_env_t *env = (blocksched_ilp_env_t*)data;
ir_graph *irg = env->env.irg;
ir_node *startblock = get_irg_start_block(irg);
int arity;
- lpp_cst_t cst;
char name[64];
int out_count;
blocksched_ilp_entry_t *entry;
@@ -627,9 +631,10 @@ static void collect_egde_frequency_ilp(ir_node *block, void *data)
}
else {
int i;
+ int cst_idx;
snprintf(name, sizeof(name), "block_in_constr_%ld", get_irn_node_nr(block));
- cst = lpp_add_cst_uniq(env->lpp, name, lpp_greater_equal, arity - 1);
+ cst_idx = lpp_add_cst_uniq(env->lpp, name, lpp_greater_equal, arity - 1);
for (i = 0; i < arity; ++i) {
double execfreq;
@@ -640,11 +645,15 @@ static void collect_egde_frequency_ilp(ir_node *block, void *data)
execfreq = get_block_execfreq(env->env.execfreqs, pred_block);
edgenum = add_ilp_edge(block, i, execfreq, env);
edge = &env->ilpedges[edgenum];
- lpp_set_factor_fast(env->lpp, cst, edge->ilpvar, 1.0);
+ lpp_set_factor_fast(env->lpp, cst_idx, edge->ilpvar, 1.0);
}
}
}
+static blocksched_ilp_entry_t *get_blocksched_ilp_entry(const ir_node *block)
+{
+ return (blocksched_ilp_entry_t*)get_irn_link(block);
+}
static void coalesce_blocks_ilp(blocksched_ilp_env_t *env)
{
@@ -663,7 +672,7 @@ static void coalesce_blocks_ilp(blocksched_ilp_env_t *env)
continue;
pred = get_Block_cfgpred_block(block, edge->pos);
- entry = get_irn_link(pred);
+ entry = get_blocksched_ilp_entry(pred);
DB((dbg, LEVEL_1, "Adding out cst to %+F from %+F,%d\n",
pred, block, edge->pos));
@@ -691,8 +700,8 @@ static void coalesce_blocks_ilp(blocksched_ilp_env_t *env)
continue;
pred = get_Block_cfgpred_block(block, edge->pos);
- entry = get_irn_link(block);
- pred_entry = get_irn_link(pred);
+ entry = get_blocksched_entry(block);
+ pred_entry = get_blocksched_entry(pred);
assert(entry->prev == NULL && pred_entry->next == NULL);
entry->prev = pred_entry;