Commit 6ef2e3b2 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

iropt: Improve equivalent_node_Sync().

- Do not handle Bad. This is done by unreachable code elimination.
- Handle NoMem.
parent d1c353f6
......@@ -1327,27 +1327,22 @@ static ir_node *equivalent_node_Phi(ir_node *n)
*/
static ir_node *equivalent_node_Sync(ir_node *n)
{
int arity = get_Sync_n_preds(n);
assert(arity > 0);
ir_node *op = get_Sync_pred(n, 0);
for (int i = 1; i < arity; i++) {
ir_node *pred = get_Sync_pred(n, i);
ir_node *op = NULL;
foreach_irn_in(n, i, pred) {
if (pred == op) {
continue;
}
/* We can ignore Bad predecessors */
if (is_Bad(op)) {
} else if (!op) {
op = pred;
} else if (is_NoMem(pred)) {
continue;
} else if (is_NoMem(op)) {
op = pred;
} else {
return n;
}
return n;
}
assert(op);
return op;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment