Commit d65e657f authored by Matthias Braun's avatar Matthias Braun
Browse files

remove_tuples: add missing confirm_irg_properties() call

parent a3aaea42
......@@ -22,6 +22,7 @@
*/
static void exchange_tuple_projs(ir_node *node, void *env)
{
bool *changed = (bool*)env;
if (!is_Proj(node))
return;
......@@ -35,19 +36,27 @@ static void exchange_tuple_projs(ir_node *node, void *env)
int pn = get_Proj_proj(node);
ir_node *tuple_pred = get_Tuple_pred(pred, pn);
exchange(node, tuple_pred);
*changed = true;
}
void remove_tuples(ir_graph *irg)
{
irg_walk_graph(irg, exchange_tuple_projs, NULL, NULL);
bool changed = false;
irg_walk_graph(irg, exchange_tuple_projs, NULL, &changed);
/* remove Tuples only held by keep-alive edges */
ir_node *end = get_irg_end(irg);
for (int i = get_End_n_keepalives(end); i-- > 0; ) {
ir_node *irn = get_End_keepalive(end, i);
if (is_Tuple(irn))
if (is_Tuple(irn)) {
remove_End_n(end, i);
changed = true;
}
}
confirm_irg_properties(irg, changed
? IR_GRAPH_PROPERTIES_CONTROL_FLOW | IR_GRAPH_PROPERTY_ONE_RETURN
| IR_GRAPH_PROPERTY_MANY_RETURNS | IR_GRAPH_PROPERTY_NO_BADS
: IR_GRAPH_PROPERTIES_ALL);
add_irg_properties(irg, IR_GRAPH_PROPERTY_NO_TUPLES);
}
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