Commit 5b03f167 authored by yb9976's avatar yb9976
Browse files

Fixed only_used_by_keepalive function.

For newly created nodes without any user the function now correctly
returns false. Thus, these nodes are no longer ignored when performing
(global?) common subexpression elimination.
parent 3174e915
......@@ -1197,16 +1197,21 @@ ir_switch_table *ir_switch_table_duplicate(ir_graph *irg,
bool only_used_by_keepalive(const ir_node *node)
{
bool kept = false;
foreach_out_edge(node, edge) {
ir_node *succ = get_edge_src_irn(edge);
if (is_End(succ))
if (is_End(succ)) {
kept = true;
continue;
}
if (is_Proj(succ) && only_used_by_keepalive(succ))
return true;
/* found a real user */
return false;
}
return true;
return kept;
}
/* include generated code */
......
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