ia32: Merge Test and Test8Bit.
[libfirm] / scripts / ir_spec.py
index 5ee504c..07a995a 100755 (executable)
@@ -181,7 +181,7 @@ class Bad:
        that a control flow edge can never be executed.
 
        The gigo optimisations ensures that nodes with Bad as their block, get
-       replaced by Bad themselfes. Nodes with at least 1 Bad input get exchanged
+       replaced by Bad themselves. Nodes with at least 1 Bad input get exchanged
        with Bad too. Exception to this rule are Block, Phi, Tuple and End node;
        This is because removing inputs from a Block is hairy operation (requiring,
        Phis to be shortened too for example). So instead of removing block inputs
@@ -229,13 +229,12 @@ class Block:
 
        init = '''
        res->attr.block.irg.irg     = irg;
-       res->attr.block.backedge    = new_backedge_arr(irg->obst, arity);
+       res->attr.block.backedge    = new_backedge_arr(get_irg_obstack(irg), arity);
        set_Block_matured(res, 1);
 
        /* Create and initialize array for Phi-node construction. */
-       if (get_irg_phase_state(irg) == phase_building) {
-               res->attr.block.graph_arr = NEW_ARR_D(ir_node *, irg->obst, irg->n_loc);
-               memset(res->attr.block.graph_arr, 0, irg->n_loc * sizeof(ir_node*));
+       if (irg_is_constrained(irg, IR_GRAPH_CONSTRAINT_CONSTRUCTION)) {
+               res->attr.block.graph_arr = NEW_ARR_DZ(ir_node*, get_irg_obstack(irg), irg->n_loc);
        }
        '''
 
@@ -776,12 +775,7 @@ class Phi:
        flags         = []
        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);'''
+       res->attr.phi.u.backedge = new_backedge_arr(get_irg_obstack(irg), arity);'''
        customSerializer = True
 
 @op