X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Firconsconfirm.c;h=999447200b8b9ff158575f8c598a8179a50579be;hb=832d6190467e344baee9d1948665cdeb95da66a5;hp=c2821fb7d9414c0640e9f31c5fc375cffe68b927;hpb=1a3b7d363474ab544c13093a2f0b578718d37c7a;p=libfirm diff --git a/ir/ana/irconsconfirm.c b/ir/ana/irconsconfirm.c index c2821fb7d..999447200 100644 --- a/ir/ana/irconsconfirm.c +++ b/ir/ana/irconsconfirm.c @@ -308,14 +308,14 @@ static void handle_if(ir_node *block, ir_node *cmp, ir_relation rel, env_t *env) * left == Const and we found a movable user of left in a * dominator of the Cond block */ - const ir_edge_t *edge, *next; - for (edge = get_irn_out_edge_first(user); edge; edge = next) { - ir_node *usr_of_usr = get_edge_src_irn(edge); - int npos = get_edge_src_pos(edge); - ir_node *blk = get_effective_use_block(usr_of_usr, npos); - - next = get_irn_out_edge_next(user, edge); - if (block_dominates(block, blk)) { + const ir_edge_t *user_edge; + const ir_edge_t *user_next; + foreach_out_edge_safe(user, user_edge, user_next) { + ir_node *usr_of_usr = get_edge_src_irn(user_edge); + int npos = get_edge_src_pos(user_edge); + ir_node *user_blk = get_effective_use_block(usr_of_usr, npos); + + if (block_dominates(block, user_blk)) { /* * The user of the user is dominated by our true/false * block. So, create a copy of user WITH the constant @@ -592,14 +592,6 @@ void construct_confirms(ir_graph *irg) irg_block_walk_graph(irg, insert_Confirm_in_block, NULL, &env); } - if (env.num_confirms | env.num_consts | env.num_eq) { - /* we have add nodes or changed DF edges */ - set_irg_outs_inconsistent(irg); - - /* the new nodes are not in the loop info */ - set_irg_loopinfo_inconsistent(irg); - } - DB((dbg, LEVEL_1, "# Confirms inserted : %u\n", env.num_confirms)); DB((dbg, LEVEL_1, "# Const replacements: %u\n", env.num_consts)); DB((dbg, LEVEL_1, "# node equalities : %u\n", env.num_eq));