summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorElias Aebi <elias.aebi@student.kit.edu>2018-06-21 11:33:46 +0200
committerJohannes Bucher <johannes.bucher2@student.kit.edu>2019-01-24 17:42:00 +0100
commit738dd969745db4e6564b77342053268febb37c4a (patch)
treeeca7ec2c658c02e2e7ddc7ab3a72910c2c6bed3e
parent40d9f6a3a868477ca149c480945fdeed8e50e05e (diff)
clean up
-rw-r--r--ir/opt/lcssa.c3
-rw-r--r--ir/opt/loop_unrolling.c (renamed from ir/opt/loop2.c)2
2 files changed, 4 insertions, 1 deletions
diff --git a/ir/opt/lcssa.c b/ir/opt/lcssa.c
index 88cedc5..54794ab 100644
--- a/ir/opt/lcssa.c
+++ b/ir/opt/lcssa.c
@@ -183,6 +183,9 @@ void assure_loop_lcssa(ir_graph *const irg, ir_loop *const loop)
FIRM_DBG_REGISTER(dbg, "firm.opt.lcssa");
assure_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO | IR_GRAPH_PROPERTY_CONSISTENT_OUTS | IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
inc_irg_visited(irg);
+ ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK);
+ irg_walk_graph(irg, firm_clear_link, NULL, NULL);
insert_phis_for_loop(loop);
+ ir_free_resources(irg, IR_RESOURCE_IRN_LINK);
clear_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO | IR_GRAPH_PROPERTY_CONSISTENT_OUTS | IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
}
diff --git a/ir/opt/loop2.c b/ir/opt/loop_unrolling.c
index 3ff49c9..96410c3 100644
--- a/ir/opt/loop2.c
+++ b/ir/opt/loop_unrolling.c
@@ -82,6 +82,7 @@ static ir_node *duplicate_node(ir_node *const node, ir_node *const new_block)
ir_node *const new_node = exact_copy(node);
if (!is_Block(new_node))
set_nodes_block(new_node, new_block);
+ // link the original node and the most recent copy to the new node
ir_node *const link = get_irn_link(node);
if (link)
set_irn_link(link, new_node);
@@ -184,7 +185,6 @@ static void rewire_node(ir_node *const node, ir_node *const header)
return;
}
- // TODO: use foreach_irn_in
int const arity = get_irn_arity(new_node);
for (int i = 0; i < arity; ++i) {
ir_node *const pred = get_irn_n(new_node, i);