* - empty block elimination
* - a simple dead node elimination (set inputs of unreachable nodes to BAD)
*/
-#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
#include <stdlib.h>
DBG((dbg, LEVEL_1, "Insert Perm after: %+F\n", pos));
ir_nodeset_init(&live);
- be_liveness_nodes_live_at(lv, birg->main_env->arch_env, cls, pos, &live);
+ be_liveness_nodes_live_at(lv, cls, pos, &live);
n = ir_nodeset_size(&live);
if(n == 0) {
assert(succ_block == NULL);
succ_block = get_edge_src_irn(edge);
+ if (has_Block_label(succ_block) && has_Block_label(block)) {
+ /*
+ * Currently we can add only one label for a block.
+ * Therefore we cannot combine them if both block already have one.
+ */
+ goto check_preds;
+ }
set_irn_n(succ_block, pos, pred);
}
+ if (has_Block_label(block)) {
+ /* move the label to the successor block */
+ ir_label_t label = get_Block_label(block);
+ set_Block_label(succ_block, label);
+ }
+
/* there can be some non-scheduled Pin nodes left in the block, move them
* to the succ block (Pin) or pred block (Sync) */
foreach_out_edge_safe(block, edge, next) {
node = get_edge_src_irn(edge);
- if(node == jump)
+ if (node == jump)
continue;
if (is_Block(node)) {
/* a Block->Block edge: This should be the MacroBlock
assert(get_Block_MacroBlock(node) == block && "Wrong Block->Block edge");
continue;
}
+ /* we simply kill Pins, because there are some strange interactions
+ * between condeval, which produce PhiMs with Pins, we simply kill
+ * the pins here, everything is scheduled anyway */
if (is_Pin(node)) {
- set_nodes_block(node, succ_block);
+ exchange(node, get_Pin_op(node));
continue;
}
if (is_Sync(node)) {
remove_empty_block(get_irg_end_block(irg));
end = get_irg_end(irg);
arity = get_irn_arity(end);
- for(i = 0; i < arity; ++i) {
+ for (i = 0; i < arity; ++i) {
ir_node *pred = get_irn_n(end, i);
- if(!is_Block(pred))
+ if (!is_Block(pred))
continue;
remove_empty_block(pred);
}