break;
}
}
- if (i < 0)
+ if (i < 0) {
n = set_Block_dead(n);
+ DBG_OPT_DEAD_BLOCK(oldn, n);
+ }
}
return n;
return get_opt_remove_Confirm() ? get_Confirm_value(n) : n;
}
+/**
+ * Optimize CopyB(mem, x, x) into a Nop
+ */
+static ir_node *equivalent_node_CopyB(ir_node *n)
+{
+ ir_node *a = get_CopyB_dst(n);
+ ir_node *b = get_CopyB_src(n);
+
+ if (a == b) {
+ /* Turn CopyB into a tuple (mem, bad, bad) */
+ ir_node *mem = get_CopyB_mem(n);
+ turn_into_tuple(n, pn_CopyB_max);
+ set_Tuple_pred(n, pn_CopyB_M, mem);
+ set_Tuple_pred(n, pn_CopyB_X_except, new_Bad()); /* no exception */
+ set_Tuple_pred(n, pn_Call_M_except, new_Bad());
+ }
+ return n;
+}
+
/**
* equivalent_node() returns a node equivalent to input n. It skips all nodes that
* perform no actual computation, as, e.g., the Id nodes. It does not create
CASE(Mux);
CASE(Cmp);
CASE(Confirm);
+ CASE(CopyB);
default:
op->equivalent_node = NULL;
}