#include "statev.h"
typedef struct _bl_info_t {
- ir_node *block; /**< The block. */
+ const ir_node *block; /**< The block. */
int be_tgt_calc : 1;
int id : 31; /**< a tight number for the block.
bl_info_t **map;
};
-static void *init_block_data(ir_phase *ph, ir_node *irn, void *old)
+static void *init_block_data(ir_phase *ph, const ir_node *irn, void *old)
{
lv_chk_t *lv = container_of(ph, lv_chk_t, ph);
bl_info_t *bi = phase_alloc(ph, sizeof(bi[0]));
}
-static void compute_back_edge_chain(lv_chk_t *lv, ir_node *bl)
+static void compute_back_edge_chain(lv_chk_t *lv, const ir_node *bl)
{
bitset_t *tmp = bitset_alloca(lv->n_blocks);
bl_info_t *bi = get_block_info(lv, bl);
struct obstack *obst;
int i;
+ edges_deactivate(irg);
+ edges_activate(irg);
+ compute_doms(irg);
+
stat_ev_tim_push();
phase_init(&res->ph, "liveness check", irg, PHASE_DEFAULT_GROWTH, init_block_data, NULL);
obst = phase_obst(&res->ph);
res->back_edge_src = bitset_obstack_alloc(obst, res->n_blocks);
res->back_edge_tgt = bitset_obstack_alloc(obst, res->n_blocks);
res->map = obstack_alloc(obst, res->n_blocks * sizeof(res->map[0]));
+ memset(res->map, 0, res->n_blocks * sizeof(res->map[0]));
#if 0
{
for (i = res->n_blocks - 1; i >= 0; --i) {
ir_node *irn = (ir_node *) dfs_get_pre_num_node(res->dfs, i);
bl_info_t *bi = phase_get_or_set_irn_data(&res->ph, irn);
+ assert(bi->id < res->n_blocks);
+ assert(res->map[bi->id] == NULL);
res->map[bi->id] = bi;
}