/*
- * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
memop_t **curr_id_2_memop; /**< current map of address ids to memops */
unsigned curr_adr_id; /**< number for address mapping */
unsigned n_mem_ops; /**< number of memory operations (Loads/Stores) */
- unsigned rbs_size; /**< size of all bitsets in bytes */
+ size_t rbs_size; /**< size of all bitsets in bytes */
int max_cfg_preds; /**< maximum number of block cfg predecessors */
int changed; /**< Flags for changed graph state */
#ifdef DEBUG_libfirm
*/
static void dump_curr(block_t *bl, const char *s)
{
- unsigned end = env.rbs_size - 1;
- unsigned pos;
- int i;
+ size_t end = env.rbs_size - 1;
+ size_t pos;
+ int i;
DB((dbg, LEVEL_2, "%s[%+F] = {", s, bl->block));
i = 0;
if (tlower == tarval_bad || tupper == tarval_bad)
return NULL;
- if (tarval_cmp(tv, tlower) & pn_Cmp_Lt)
+ if (tarval_cmp(tv, tlower) == ir_relation_less)
return NULL;
- if (tarval_cmp(tupper, tv) & pn_Cmp_Lt)
+ if (tarval_cmp(tupper, tv) == ir_relation_less)
return NULL;
/* ok, bounds check finished */
if (tlower == tarval_bad || tupper == tarval_bad)
return NULL;
- if (tarval_cmp(tv_index, tlower) & pn_Cmp_Lt)
+ if (tarval_cmp(tv_index, tlower) == ir_relation_less)
return NULL;
- if (tarval_cmp(tupper, tv_index) & pn_Cmp_Lt)
+ if (tarval_cmp(tupper, tv_index) == ir_relation_less)
return NULL;
/* ok, bounds check finished */
if (tlower == tarval_bad || tupper == tarval_bad)
return NULL;
- if (tarval_cmp(tv_index, tlower) & pn_Cmp_Lt)
+ if (tarval_cmp(tv_index, tlower) == ir_relation_less)
return NULL;
- if (tarval_cmp(tupper, tv_index) & pn_Cmp_Lt)
+ if (tarval_cmp(tupper, tv_index) == ir_relation_less)
return NULL;
/* ok, bounds check finished */
} /* update_Call_memop */
/**
- * Update a memop for a Div/Mod/Quot/DivMod.
+ * Update a memop for a Div/Mod.
*
* @param m the memop
*/
*/
static void update_Phi_memop(memop_t *m)
{
- /* the Phi is it's own mem */
+ /* the Phi is its own mem */
m->mem = m->node;
} /* update_Phi_memop */
/* we can those to find the memory edge */
break;
case iro_Div:
- case iro_DivMod:
- case iro_Quot:
case iro_Mod:
update_DivOp_memop(op);
break;
*/
static void kill_memops(const value_t *value)
{
- unsigned end = env.rbs_size - 1;
- unsigned pos;
+ size_t end = env.rbs_size - 1;
+ size_t pos;
for (pos = rbitset_next(env.curr_set, 0, 1); pos < end; pos = rbitset_next(env.curr_set, pos + 1, 1)) {
memop_t *op = env.curr_id_2_memop[pos];
ir_node *succ = get_Block_cfg_out(block, 0);
block_t *succ_bl = get_block_entry(succ);
int pred_pos = get_Block_cfgpred_pos(succ, block);
- unsigned end = env.rbs_size - 1;
- unsigned pos;
+ size_t end = env.rbs_size - 1;
+ size_t pos;
kill_all();
{
ir_node *block = bl->block;
int i, n = get_Block_n_cfgpreds(block);
- unsigned end = env.rbs_size - 1;
- unsigned pos;
+ size_t end = env.rbs_size - 1;
DB((dbg, LEVEL_3, "processing %+F\n", block));
if (n > 1) {
ir_node **ins;
- int pos;
+ size_t pos;
NEW_ARR_A(ir_node *, ins, n);
}
/*
* Ensure that all values are in the map: build Phi's if necessary:
- * Note: the last bit is the sentinel and ALWAYS set, so start with -2.
+ * Note: the last bit is the sentinel and ALWAYS set, so end with -2.
*/
- for (pos = env.rbs_size - 2; pos >= 0; --pos) {
+ for (pos = 0; pos < env.rbs_size - 1; ++pos) {
if (! rbitset_is_set(env.curr_set, pos))
env.curr_id_2_memop[pos] = NULL;
else {
}
if (n > 1) {
+ size_t pos;
+
/* check for partly redundant values */
for (pos = rbitset_next(bl->anticL_in, 0, 1);
pos < end;