- nods_block = get_nodes_block(load);
- load_ptr = get_Load_ptr(load);
- load_mem = get_Load_mem(load);
- // DDMN(load);
- /* The pointer predecessor of Load muss be a Sel node. */
- if (get_irn_op(load_ptr) == op_Sel) {
- /* If the link field of sel's entity is set to "ADDRESS_TAKEN", that means this value
- can't be scalar replaced. It is nothing to do and load_handling() must be exited. */
- if (get_entity_link(get_Sel_entity(load_ptr)) == ADDRESS_TAKEN)
- return;
-
- key.irn = nods_block;
- value = set_find(repairs, &key, sizeof(key), HASH_PTR(nods_block));
-
- /* Load's pointer predecessor's link field contains the position in the block's link, where
- must be searched the predecessor of this Load. */
- i = (unsigned)get_irn_link(load_ptr);
-
- /* If the link of Load's block doesn't contains at position "i" a node or isn't calculated,
- than pred_search() must be called .*/
- if (value == NULL) {
- block_link(load, env, repairs);
- key.irn = nods_block;
- value = set_find(repairs, &key, sizeof(key), HASH_PTR(nods_block));
- pred_search(load, value, repairs, i, 0);
- } else if (value->link[i] == NULL)
- pred_search(load, value, repairs, i, 0);
-
- /* If after the pred_search() call the link of Load's block at position "i" is equal to NULL,
- that means the loaded value wasn't initialized and the load predecessor is set to Unknown */
- if (value->link[i] == NULL)
- value->link[i] = new_Unknown(env->modes[i]);
-
- /* The Load node can be turned into a tuple now. This tuple will be optimized later. */
- turn_into_tuple(load, pn_Load_max);
- set_Tuple_pred(load, pn_Load_M, load_mem);
- set_Tuple_pred(load, pn_Load_res, value->link[i]);
- set_Tuple_pred(load, pn_Load_X_except, new_Bad());
- }