X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbelistsched.c;h=5e98db60c4f78e3b3fc99cee46a0ca89775e1ca8;hb=afbbc0b1ccd684c4c24bfd43d0f994123245f39f;hp=22553360fc5dc793a272507144d67157f120293d;hpb=1eea702a194424852ded345128fc21866e234a5c;p=libfirm diff --git a/ir/be/belistsched.c b/ir/be/belistsched.c index 22553360f..5e98db60c 100644 --- a/ir/be/belistsched.c +++ b/ir/be/belistsched.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -61,8 +61,8 @@ #include "bestat.h" #include "beirg_t.h" -#include -#include +#include "lc_opts.h" +#include "lc_opts_enum.h" DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL); @@ -90,7 +90,7 @@ typedef struct _list_sched_options_t { } list_sched_options_t; static list_sched_options_t list_sched_options = { - BE_SCHED_SELECT_HEUR, /* mueller heuristic selector */ + BE_SCHED_SELECT_NORMAL, /* mueller heuristic selector */ BE_SCHED_PREP_NONE, /* no scheduling preparation */ }; @@ -229,7 +229,7 @@ static INLINE int make_ready(block_sched_env_t *env, ir_node *pred, ir_node *irn /* if irn is an End we have keep-alives and op might be a block, skip that */ if (is_Block(op)) { - assert(get_irn_op(irn) == op_End); + assert(is_End(irn)); continue; } @@ -452,14 +452,29 @@ static void list_sched_block(ir_node *block, void *env_ptr) /* Then one can add all nodes are ready to the set. */ foreach_out_edge(block, edge) { - ir_node *irn = get_edge_src_irn(edge); + ir_node *irn = get_edge_src_irn(edge); + ir_opcode code = get_irn_opcode(irn); + int users; - /* Skip the end node because of keepalive edges. */ - if (get_irn_opcode(irn) == iro_End) + if (code == iro_End) { + /* Skip the end node because of keep-alive edges. */ continue; + } else if (code == iro_Block) { + /* A Block-Block edge. This should be the MacroBlock + * edge, ignore it. */ + assert(get_Block_MacroBlock(irn) == block && "Block-Block edge found"); + continue; + } - if (get_irn_n_edges(irn) == 0) + users = get_irn_n_edges(irn); + if (users == 0) continue; + else if (users == 1) { /* ignore nodes that are only hold by the anchor */ + const ir_edge_t *edge = get_irn_out_edge_first_kind(irn, EDGE_KIND_NORMAL); + ir_node *user = get_edge_src_irn(edge); + if (is_Anchor(user)) + continue; + } if (is_Phi(irn)) { /* @@ -471,13 +486,10 @@ static void list_sched_block(ir_node *block, void *env_ptr) else if (irn == start_node) { /* The start block will be scheduled as the first node */ add_to_sched(&be, irn); -#ifdef SCHEDULE_PROJS - add_tuple_projs(&be, irn); -#endif } else { /* Other nodes must have all operands in other blocks to be made - * ready */ + * ready */ int ready = 1; /* Check, if the operands of a node are not local to this block */ @@ -504,8 +516,6 @@ static void list_sched_block(ir_node *block, void *env_ptr) /* Iterate over all remaining nodes */ while (ir_nodeset_size(&be.cands) > 0) { ir_nodeset_iterator_t iter; - /* collect statistics about amount of ready nodes */ - be_do_stat_sched_ready(block, &be.cands); /* Keeps must be scheduled immediately */ foreach_ir_nodeset(&be.cands, irn, iter) { @@ -586,7 +596,7 @@ void list_sched(be_irg_t *birg, be_options_t *be_opts) /* initialize environment for list scheduler */ memset(&env, 0, sizeof(env)); - env.selector = arch_env->isa->impl->get_list_sched_selector(arch_env->isa, &sel); + env.selector = arch_env_get_list_sched_selector(arch_env, &sel); env.arch_env = arch_env; env.irg = irg; env.sched_info = NEW_ARR_F(sched_irn_t, num_nodes); @@ -641,7 +651,7 @@ void list_sched_single_block(const be_irg_t *birg, ir_node *block, /* initialize environment for list scheduler */ memset(&env, 0, sizeof(env)); - env.selector = arch_env->isa->impl->get_list_sched_selector(arch_env->isa, &sel); + env.selector = arch_env_get_list_sched_selector(arch_env, &sel); env.arch_env = arch_env; env.irg = irg; env.sched_info = NEW_ARR_F(sched_irn_t, num_nodes);