summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorElias Aebi <elias.aebi@student.kit.edu>2018-04-24 12:00:40 +0200
committerJohannes Bucher <johannes.bucher2@student.kit.edu>2019-01-24 17:42:00 +0100
commit1b337aeac2a1f2ef508fc88bf680d21842d859fd (patch)
treec2b889d5f952225381eaf6c26281f08e86bd2fb6
parent4dd8221aa5d80b8f671732798adb43b26fad864f (diff)
clean up
-rw-r--r--ir/opt/lcssa.c20
-rw-r--r--ir/opt/loop2.c31
2 files changed, 0 insertions, 51 deletions
diff --git a/ir/opt/lcssa.c b/ir/opt/lcssa.c
index 9878dfd..88cedc5 100644
--- a/ir/opt/lcssa.c
+++ b/ir/opt/lcssa.c
@@ -15,26 +15,6 @@ static bool is_inside_loop(ir_node const *const node)
return loop && loop != get_irg_loop(graph);
}
-// insert a phi node between node and its nth predecessor in block
-static ir_node *insert_phi(ir_node *const node, int const n, ir_node *const block)
-{
- ir_node *const pred = get_irn_n(node, n);
- int const block_arity = get_irn_arity(block);
- ir_node **const in = ALLOCAN(ir_node *, block_arity);
- for (int i = 0; i < block_arity; ++i) {
- in[i] = pred;
- }
- ir_mode *const mode = get_irn_mode(pred);
- int const opt = get_optimize();
- set_optimize(0);
- ir_node *const phi = new_r_Phi(block, block_arity, in, mode);
- set_optimize(opt);
- set_irn_n(node, n, phi);
- mark_irn_visited(phi);
- DB((dbg, LEVEL_3, "inserting phi %N\n", phi));
- return phi;
-}
-
static ir_node *insert_phis_recursive(ir_node *const pred, ir_node *const block)
{
if (block == get_nodes_block(pred))
diff --git a/ir/opt/loop2.c b/ir/opt/loop2.c
index a29c5d8..1565519 100644
--- a/ir/opt/loop2.c
+++ b/ir/opt/loop2.c
@@ -91,23 +91,6 @@ static ir_node *duplicate_node(ir_node *const node, ir_node *const new_block)
return new_node;
}
-static void rewire_successor_phi(ir_node *const phi, ir_node *const block, int arity, int new_arity)
-{
- ir_node **const in = ALLOCAN(ir_node *, new_arity);
- for (int i = 0, j = arity; i < arity; ++i) {
- ir_node *const pred_phi = get_irn_n(phi, i);
- ir_node *const new_pred_phi = get_irn_link(pred_phi);
- ir_node *const pred_block = get_irn_n(block, i);
- ir_node *const new_pred_block = get_irn_link(pred_block);
-
- in[i] = pred_phi;
- if (new_pred_block && new_pred_block != pred_block) {
- in[j++] = new_pred_phi ? new_pred_phi : pred_phi;
- }
- }
- set_irn_in(phi, new_arity, in);
-}
-
static void rewire_successor_block(ir_node *const block, int n)
{
ir_node *const node = get_irn_n(block, n);
@@ -240,19 +223,6 @@ static void rewire_block(ir_node *const block, ir_node *const header)
}
}
-static void rewire_keepalives(ir_node *const header)
-{
- ir_node *const end = get_irg_end(get_irn_irg(header));
- int const arity = get_irn_arity(end);
- for (int i = 0; i < arity; ++i) {
- ir_node *const pred = get_irn_n(end, i);
- ir_node *const new_pred = get_irn_link(pred);
- if (new_pred) {
- add_End_keepalive(end, new_pred);
- }
- }
-}
-
static void duplicate_loop(ir_loop *const loop, int factor)
{
ir_node *const header = get_loop_header(loop);
@@ -275,7 +245,6 @@ static void duplicate_loop(ir_loop *const loop, int factor)
}
// step 2: rewire the edges
- inc_irg_visited(get_irn_irg(header));
for (size_t i = 0; i < n_elements; ++i) {
loop_element const element = get_loop_element(loop, i);
if (*element.kind == k_ir_node) {