- Get rid of the infamous Start->ProjX->Start backedge
authorMatthias Braun <matze@braunis.de>
Fri, 19 Jun 2009 12:10:54 +0000 (12:10 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 19 Jun 2009 12:10:54 +0000 (12:10 +0000)
[r26162]

ir/ana/irouts.c
ir/ir/irgraph.c

index 5267729..3804180 100644 (file)
@@ -420,32 +420,6 @@ static ir_def_use_edge *set_out_edges(ir_graph *irg, ir_def_use_edge *free) {
        return free;
 }
 
-
-/**
- * We want that the out of ProjX from Start contains the next block at
- * position 0, the Start block at position 1.  This is necessary for
- * the out block walker.
- */
-static inline void fix_start_proj(ir_graph *irg) {
-       ir_node *startbl = get_irg_start_block(irg);
-
-       if (get_Block_n_cfg_outs(startbl)) {
-               ir_node *proj = get_irg_initial_exec(irg);
-               ir_node *irn;
-               int     block_pos, other_pos;
-
-               if (get_irn_n_outs(proj) == 2) {
-                       if (get_irn_out_ex(proj, 0, &block_pos) == startbl) {
-                               irn = get_irn_out_ex(proj, 1, &other_pos);
-                               set_irn_out(proj, 0, irn, other_pos);
-                               set_irn_out(proj, 1, startbl, block_pos);
-                       }
-               } else {
-                       assert(get_irg_phase_state(irg) == phase_backend);
-               }
-       }
-}
-
 /* compute the outs for a given graph */
 void compute_irg_outs(ir_graph *irg) {
        ir_graph        *rem = current_ir_graph;
@@ -477,11 +451,6 @@ void compute_irg_outs(ir_graph *irg) {
        /* Check how much memory we have used */
        assert (end == (irg->outs + n_out_edges));
 
-       /* We want that the out of ProjX from Start contains the next block at
-          position 0, the Start block at position 1.  This is necessary for
-          code placement (place_early() ONLY if started GCSE on graphs with dead blocks) */
-       fix_start_proj(irg);
-
        current_ir_graph->outs_state = outs_consistent;
        current_ir_graph = rem;
 }
index 8f254e0..feb0844 100644 (file)
@@ -262,7 +262,6 @@ ir_graph *new_r_ir_graph(ir_entity *ent, int n_loc) {
        initial_mem             = new_Proj(start, mode_M, pn_Start_M);
        set_irg_initial_mem(res, initial_mem);
 
-       add_immBlock_pred(start_block, projX);
        set_store(initial_mem);
 
        res->index       = get_irp_new_irg_idx();
@@ -270,11 +269,6 @@ ir_graph *new_r_ir_graph(ir_entity *ent, int n_loc) {
        res->graph_nr    = get_irp_new_node_nr();
 #endif
 
-       /*
-        * The code generation needs it. leave it in now.
-        * Use of this edge is matter of discussion, unresolved. Also possible:
-        * add_immBlock_pred(res->start_block, res->start_block), but invalid typed.
-        */
        mature_immBlock(res->current_block);
 
        /*-- Make a block to start with --*/
@@ -358,7 +352,6 @@ ir_graph *new_const_code_irg(void)
        /* Proj results of start node */
        set_irg_initial_mem(res, new_Proj(start, mode_M, pn_Start_M));
        projX = new_Proj(start, mode_X, pn_Start_X_initial_exec);
-       add_immBlock_pred(start_block, projX);
        mature_immBlock(start_block);
 
        body_block = new_immBlock();