+ entry->id = env.curr_adr_id++;
+ ir_nodemap_insert(&env.adr_map, adr, entry);
+
+ DB((dbg, LEVEL_3, "ADDRESS %+F has ID %u\n", adr, entry->id));
+#ifdef DEBUG_libfirm
+ ARR_APP1(ir_node *, env.id_2_address, adr);
+#endif
+ }
+ return entry->id;
+} /* register_address */
+
+
+/**
+ * translate an address through a Phi node into a given predecessor
+ * block.
+ *
+ * @param address the address
+ * @param block the block
+ * @param pos the position of the predecessor in block
+ */
+static ir_node *phi_translate(ir_node *address, const ir_node *block, int pos)
+{
+ if (is_Phi(address) && get_nodes_block(address) == block)
+ address = get_Phi_pred(address, pos);
+ return address;
+} /* phi_translate */
+
+/**
+ * Walker: allocate an block entry for every block
+ * and register all potential addresses.
+ */
+static void prepare_blocks(ir_node *irn, void *ctx)
+{
+ (void)ctx;
+
+ if (is_Block(irn)) {
+ block_t *entry = OALLOC(&env.obst, block_t);
+ int n;
+
+ entry->memop_forward = NULL;
+ entry->memop_backward = NULL;
+ entry->avail_out = NULL;
+ entry->id_2_memop_avail = NULL;
+ entry->anticL_in = NULL;
+ entry->id_2_memop_antic = NULL;
+ entry->block = irn;
+ entry->forward_next = NULL;
+ entry->backward_next = NULL;
+ entry->avail = NULL;
+ entry->trans_results = NULL;
+ set_irn_link(irn, entry);
+
+ set_Block_phis(irn, NULL);
+
+ /* use block marks to track unreachable blocks */
+ set_Block_mark(irn, 0);
+
+ n = get_Block_n_cfgpreds(irn);
+ if (n > env.max_cfg_preds)
+ env.max_cfg_preds = n;
+ } else {
+ ir_mode *mode = get_irn_mode(irn);
+
+ if (mode_is_reference(mode)) {
+ /*
+ * Register ALL possible addresses: this is overkill yet but
+ * simpler then doing it for all possible translated addresses
+ * (which would be sufficient in the moment.
+ */
+ (void)register_address(irn);
+ }
+ }
+} /* prepare_blocks */
+
+/**
+ * Post-Walker, link in all Phi's
+ */
+static void link_phis(ir_node *irn, void *ctx)
+{
+ (void)ctx;
+
+ if (is_Phi(irn)) {
+ ir_node *block = get_nodes_block(irn);
+ add_Block_phi(block, irn);
+ }
+} /* link_phis */
+
+/**
+ * Block walker: creates the inverse post-order list for the CFG.
+ */
+static void inverse_post_order(ir_node *block, void *ctx)
+{
+ block_t *entry = get_block_entry(block);
+
+ (void)ctx;
+
+ /* mark this block IS reachable from start */
+ set_Block_mark(block, 1);