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

code_placement: fix only kept nodes getting moved into loops

Privously nodes that only had a keep-alive users would be moved up but
never down again.
parent 4b21ee16
...@@ -256,7 +256,7 @@ static ir_node *get_deepest_common_dom_ancestor(ir_node *node, ir_node *dca) ...@@ -256,7 +256,7 @@ static ir_node *get_deepest_common_dom_ancestor(ir_node *node, ir_node *dca)
} }
} }
if (dca == NULL) if (dca == NULL)
return get_nodes_block(node); return NULL;
foreach_out_edge_kind(node, edge, EDGE_KIND_DEP) { foreach_out_edge_kind(node, edge, EDGE_KIND_DEP) {
ir_node *succ = get_edge_src_irn(edge); ir_node *succ = get_edge_src_irn(edge);
...@@ -331,12 +331,14 @@ static void place_floats_late(ir_node *n, pdeq *worklist) ...@@ -331,12 +331,14 @@ static void place_floats_late(ir_node *n, pdeq *worklist)
blocks depending on us; our final placement has to dominate blocks depending on us; our final placement has to dominate
DCA. */ DCA. */
ir_node *dca = get_deepest_common_dom_ancestor(n, NULL); ir_node *dca = get_deepest_common_dom_ancestor(n, NULL);
assert(dca != NULL); /* this node had no user? This can happen if a node is only kept alive,
* do nothing in this case. */
if (dca == NULL)
return;
set_nodes_block(n, dca); set_nodes_block(n, dca);
move_out_of_loops(n, block); move_out_of_loops(n, block);
if (get_irn_mode(n) == mode_T) { if (get_irn_mode(n) == mode_T)
set_projs_block(n, get_nodes_block(n)); set_projs_block(n, get_nodes_block(n));
}
} }
/** /**
......
Supports Markdown
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