X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeirgmod.c;h=bf6506c110ac6e0a4329d9b31b3bc5ffa3fa46b4;hb=82eea1b6b7887bdc834affa49038734e42012395;hp=64f517ebd5ce98956e18d0501a9a0fa35ef54fb3;hpb=1a3b7d363474ab544c13093a2f0b578718d37c7a;p=libfirm diff --git a/ir/be/beirgmod.c b/ir/be/beirgmod.c index 64f517ebd..bf6506c11 100644 --- a/ir/be/beirgmod.c +++ b/ir/be/beirgmod.c @@ -22,7 +22,6 @@ * @brief Backend IRG modification routines. * @author Sebastian Hack, Daniel Grund, Matthias Braun, Christian Wuerdig * @date 04.05.2005 - * @version $Id$ * * This file contains the following IRG modifications for be routines: * - insertion of Perm nodes @@ -52,7 +51,7 @@ #include "irgraph_t.h" #include "irgopt.h" #include "irgmod.h" -#include "irprintf_t.h" +#include "irprintf.h" #include "irgwalk.h" #include "be_t.h" @@ -70,6 +69,15 @@ DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;) +static int cmp_node_nr(const void *a, const void *b) +{ + ir_node **p1 = (ir_node**)a; + ir_node **p2 = (ir_node**)b; + long n1 = get_irn_node_nr(*p1); + long n2 = get_irn_node_nr(*p2); + return (n1>n2) - (n1reachable, get_irn_idx(node))) continue; - if (env->lv) + if (env->lv != NULL) be_liveness_remove(env->lv, node); sched_remove(node); + + /* kill projs */ + if (get_irn_mode(node) == mode_T) { + foreach_out_edge_safe(node, edge) { + ir_node *proj = get_edge_src_irn(edge); + if (!is_Proj(proj)) + continue; + if (env->lv != NULL) + be_liveness_remove(env->lv, proj); + kill_node(proj); + } + } kill_node(node); } } @@ -328,7 +341,7 @@ void be_remove_dead_nodes_from_schedule(ir_graph *irg) irg_block_walk_graph(irg, remove_dead_nodes_walker, NULL, &env); } -BE_REGISTER_MODULE_CONSTRUCTOR(be_init_irgmod); +BE_REGISTER_MODULE_CONSTRUCTOR(be_init_irgmod) void be_init_irgmod(void) { FIRM_DBG_REGISTER(dbg, "firm.be.irgmod");