+ ir_node **nodes;
+ int i, n;
+
+ stat_ev_tim_push();
+ n = get_irg_last_idx(lv->irg);
+ nodes = NEW_ARR_F(ir_node *, n);
+ memset(nodes, 0, sizeof(nodes[0]) * n);
+
+ /*
+ * inserting the variables sorted by their ID is probably
+ * more efficient since the binary sorted set insertion
+ * will not need to move around the data.
+ */
+ irg_walk_graph(lv->irg, NULL, collect_liveness_nodes, nodes);
+
+ re.lv = lv;
+ re.visited = bitset_malloc(n);
+
+ for (i = 0; i < n; ++i) {
+ if (nodes[i] != NULL)
+ liveness_for_node(nodes[i]);
+ }
+
+ DEL_ARR_F(nodes);
+ free(re.visited);
+ register_hook(hook_node_info, &lv->hook_info);
+ stat_ev_tim_pop("be_lv_sets_cons");
+}
+
+void be_liveness_assure_sets(be_lv_t *lv)
+{
+ if (!lv->nodes) {
+ be_timer_push(T_LIVE);
+
+ lv->nodes = bitset_malloc(2 * get_irg_last_idx(lv->irg));
+ phase_init(&lv->ph, lv->irg, lv_phase_data_init);
+ compute_liveness(lv);
+ /* be_live_chk_compare(lv, lv->lvc); */
+
+ be_timer_pop(T_LIVE);
+ }
+}
+
+void be_liveness_assure_chk(be_lv_t *lv)
+{
+#ifndef USE_LIVE_CHK
+ be_timer_push(t_verify);
+ be_liveness_assure_sets(lv);
+ be_timer_pop(t_verify);
+#else
+ (void) lv;
+#endif
+}
+
+void be_liveness_invalidate(be_lv_t *lv)
+{
+ if (lv && lv->nodes) {
+ unregister_hook(hook_node_info, &lv->hook_info);
+ phase_deinit(&lv->ph);
+ bitset_free(lv->nodes);
+ lv->nodes = NULL;
+ }