ir_node* pred_block = get_nodes_block(get_irn_n(block, i));
int arity = get_irn_arity(block);
int new_pred_arity;
ir_node* pred_block = get_nodes_block(get_irn_n(block, i));
int arity = get_irn_arity(block);
int new_pred_arity;
new_pred_arity = get_irn_arity(pred_block) - 1;
NEW_ARR_A(ir_node*, pred_ins, new_pred_arity);
new_pred_arity = get_irn_arity(pred_block) - 1;
NEW_ARR_A(ir_node*, pred_ins, new_pred_arity);
for (k = 0; k < j; ++k) pred_ins[k] = get_irn_n(phi, k);
for (; k < new_pred_arity; ++k) pred_ins[k] = get_irn_n(phi, k + 1);
assert(k == new_pred_arity);
for (k = 0; k < j; ++k) pred_ins[k] = get_irn_n(phi, k);
for (; k < new_pred_arity; ++k) pred_ins[k] = get_irn_n(phi, k + 1);
assert(k == new_pred_arity);
if (new_pred_arity > 1) {
set_irn_in(phi, new_pred_arity, pred_ins);
} else {
if (new_pred_arity > 1) {
set_irn_in(phi, new_pred_arity, pred_ins);
} else {
for (cdep = find_cdep(pred0); cdep != NULL; cdep = cdep->next) {
const ir_node* dependency = cdep->node;
ir_node* projx0 = walk_to_projx(pred0, dependency);
for (cdep = find_cdep(pred0); cdep != NULL; cdep = cdep->next) {
const ir_node* dependency = cdep->node;
ir_node* projx0 = walk_to_projx(pred0, dependency);
#if 1
DB((dbg, LEVEL_1, "Welding block %+F and %+F\n", block, psi_block));
/* copy the block-info from the Psi-block to the block before merging */
#if 1
DB((dbg, LEVEL_1, "Welding block %+F and %+F\n", block, psi_block));
/* copy the block-info from the Psi-block to the block before merging */
- set_Block_mark(psi_block, get_Block_mark(psi_block) | get_Block_mark(block));
- set_irn_link(block, get_irn_link(psi_block));
+
+ mark = get_Block_mark(psi_block) | get_Block_mark(block);
+ set_Block_mark(block, mark);
+ set_Block_phis(block, get_Block_phis(psi_block));
set_irn_in(block, get_irn_arity(psi_block), get_irn_in(psi_block) + 1);
exchange_cdep(psi_block, block);
exchange(psi_block, block);
#else
DB((dbg, LEVEL_1, "Welding block %+F to %+F\n", block, psi_block));
set_irn_in(block, get_irn_arity(psi_block), get_irn_in(psi_block) + 1);
exchange_cdep(psi_block, block);
exchange(psi_block, block);
#else
DB((dbg, LEVEL_1, "Welding block %+F to %+F\n", block, psi_block));
- set_Block_mark(psi_block, get_Block_mark(psi_block) | get_Block_mark(block));
+ mark = get_Block_mark(psi_block) | get_Block_mark(block);
+ /* mark both block just to be sure, should be enough to mark psi_block */
+ set_Block_mark(psi_block, mark);
set_Block_mark(block, 0);
set_Block_phis(block, NULL);
}
set_Block_mark(block, 0);
set_Block_phis(block, NULL);
}