X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fcondeval.c;h=da6a529750c9d1bfbce202127290ea0b525abaef;hb=5768beabd98907ab01f249284322ae9a9309a442;hp=4e0ab939aff8571043a49828022a4da98eac2bcb;hpb=cd43bc0f2f1f6b17d588628df070bd3437d11bbf;p=libfirm diff --git a/ir/opt/condeval.c b/ir/opt/condeval.c index 4e0ab939a..da6a52975 100644 --- a/ir/opt/condeval.c +++ b/ir/opt/condeval.c @@ -1,3 +1,13 @@ +/* + * Project: libFIRM + * File name: ir/opt/cfopt.c + * Purpose: Partial condition evaluation + * Author: Christoph Mallon, Matthias Braun + * Created: 10. Sep. 2006 + * CVS-ID: $Id$ + * Copyright: (c) 1998-2006 Universität Karlsruhe + * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + */ #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -13,6 +23,7 @@ #include "irnode.h" #include "irnode_t.h" #include "iredges.h" +#include "iredges_t.h" #include "irtools.h" #include "tv.h" @@ -37,7 +48,6 @@ static void add_pred(ir_node* node, ir_node* x) set_irn_in(node, n + 1, ins); } - /** * Remove predecessor j from node, which is either a Block or a Phi * returns true if only one predecessor is left @@ -54,8 +64,10 @@ static int remove_pred(ir_node* node, int j) if (is_Block(node)) { pred = get_nodes_block(pred); - set_irn_in(node, get_irn_arity(pred), get_irn_in(pred) + 1); - exchange(pred, node); + ir_fprintf(stderr, "Exchaning %+F with %+F\n", node, pred); + //set_irn_in(node, get_irn_arity(pred), get_irn_in(pred) + 1); + //exchange(node, pred); + edges_reroute(node, pred, current_ir_graph); } else { exchange(node, pred); } @@ -72,7 +84,6 @@ static int remove_pred(ir_node* node, int j) } } - static ir_node *search_def_and_create_phis(ir_node *block, ir_mode *mode) { int i; @@ -122,7 +133,6 @@ static ir_node *search_def_and_create_phis(ir_node *block, ir_mode *mode) return phi; } - /** * Given a set of values this function constructs SSA-form for all users of the * values (the user are determined through the out-edges of the values).