Remove keep-edge hacks for endless loop.
authorChristoph Mallon <christoph.mallon@gmx.de>
Thu, 8 Nov 2012 07:21:09 +0000 (08:21 +0100)
committerChristoph Mallon <christoph.mallon@gmx.de>
Thu, 8 Nov 2012 14:38:22 +0000 (15:38 +0100)
It is the job of the frontend to keep loops.
These hacks here only worked for some, but not all cases.
In particular a more clever SSA-construction algorithm might not place redundant PhiMs, which would render memory before memory-less loops unkept.

ir/ir/iropt.c
scripts/ir_spec.py

index 02c3a4b..61cadf1 100644 (file)
@@ -3346,8 +3346,6 @@ static ir_node *transform_node_Cond(ir_node *n)
                        set_Tuple_pred(n, pn_Cond_false, jmp);
                        set_Tuple_pred(n, pn_Cond_true, new_r_Bad(irg, mode_X));
                }
-               /* We might generate an endless loop, so keep it alive. */
-               add_End_keepalive(get_irg_end(irg), blk);
                clear_irg_properties(irg, IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE);
        }
        return n;
index 017a3c0..ed5c8f4 100755 (executable)
@@ -777,11 +777,6 @@ class Phi:
        attr_struct   = "phi_attr"
        init          = '''
        res->attr.phi.u.backedge = new_backedge_arr(irg->obst, arity);'''
-       init_after_opt = '''
-       /* Memory Phis in endless loops must be kept alive.
-          As we can't distinguish these easily we keep all of them alive. */
-       if (is_Phi(res) && mode == mode_M)
-               add_End_keepalive(get_irg_end(irg), res);'''
        customSerializer = True
 
 @op