ir_node *proj = new_r_Proj(irg, bl, perm, mode, i);
arch_set_irn_register(arch_env, proj, reg);
-#ifdef SCHEDULE_PROJS
- sched_add_after(curr, proj);
-#endif
curr = proj;
be_ssa_construction_init(&senv, birg);
static void remove_empty_block(ir_node *block, void *data) {
const ir_edge_t *edge, *next;
ir_node *node;
+ ir_node *pred_block;
+ ir_node *succ_block;
int *changed = data;
ir_node *jump = NULL;
return;
if (jump != NULL) {
/* we should never have 2 jumps in a block */
- panic("We should never have 2 jumps in a block");
+ panic("found 2 jumps in a block");
}
jump = node;
}
if (jump == NULL)
return;
- node = get_Block_cfgpred(block, 0);
+ pred_block = get_Block_cfgpred(block, 0);
+ succ_block = NULL;
foreach_out_edge_safe(jump, edge, next) {
- ir_node *block = get_edge_src_irn(edge);
- int pos = get_edge_src_pos(edge);
+ int pos = get_edge_src_pos(edge);
+
+ assert(succ_block == NULL);
+ succ_block = get_edge_src_irn(edge);
+
+ set_irn_n(succ_block, pos, pred_block);
+ }
+
+ /* there can be some non-scheduled Pin nodes left in the block, move them
+ * to the succ block */
+ foreach_out_edge_safe(block, edge, next) {
+ node = get_edge_src_irn(edge);
- set_irn_n(block, pos, node);
+ if(node == jump)
+ continue;
+ if(is_Pin(node)) {
+ set_nodes_block(node, succ_block);
+ continue;
+ }
+ panic("Unexpected node %+F in block %+F with empty schedule", node,
+ block);
}
set_Block_cfgpred(block, 0, new_Bad());