X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbemain.c;h=0b4f639000c77fc58575f11374e060484c1dcea0;hb=f8133875ddf70372c10a52b7266f3d04e8129486;hp=7db09791f39d2839049a10986f067b11f5dd6c0a;hpb=4d5c3365a58cba59993045a9e08e686d8ae079a7;p=libfirm diff --git a/ir/be/bemain.c b/ir/be/bemain.c index 7db09791f..0b4f63900 100644 --- a/ir/be/bemain.c +++ b/ir/be/bemain.c @@ -18,10 +18,11 @@ */ /** - * Backend driver. - * @author Sebastian Hack - * @date 25.11.2004 - * @cvsid $Id$ + * @file + * @brief Main Backend driver. + * @author Sebastian Hack + * @date 25.11.2004 + * @version $Id$ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -48,9 +49,7 @@ #include "irtools.h" #include "irvrfy.h" #include "irprintf.h" -#include "return.h" #include "firmstat.h" -#include "cfopt.h" #include "execfreq.h" #include "bearch_t.h" @@ -64,7 +63,6 @@ #include "belive_t.h" #include "bespillbelady.h" #include "bera.h" -#include "beraextern.h" #include "bechordal_t.h" #include "beifg.h" #include "beifg_impl.h" @@ -78,6 +76,7 @@ #include "beverify.h" #include "beprofile.h" #include "be_dbgout.h" +#include "beirg_t.h" #ifdef WITH_ILP #include "beilpsched.h" @@ -205,10 +204,14 @@ int be_parse_arg(const char *arg) { /** The be parameters returned by default, all off. */ const static backend_params be_params = { - NULL, - NULL, - 0, - NULL, + 0, /* need dword lowering */ + 0, /* don't support inlien assembler yet */ + 0, /* no different calling conventions */ + NULL, /* no additional opcodes */ + NULL, /* will be set later */ + NULL, /* but yet no creator function */ + NULL, /* context for create_intrinsic_fkt */ + NULL, /* no if conversion settings */ }; /* Perform schedule verification if requested. */ @@ -311,8 +314,9 @@ static void initialize_birg(be_irg_t *birg, ir_graph *irg, be_main_env_t *env) /* Normalize proj nodes. */ normalize_proj_nodes(irg); - /* Make just one return node. */ - normalize_one_return(irg); + /* we do this before critical edge split. As this produces less returns, + because sometimes (= 164.gzip) multiple returns are slower */ + normalize_n_returns(irg); /* Remove critical edges */ remove_critical_cf_edges(irg); @@ -324,6 +328,8 @@ static void initialize_birg(be_irg_t *birg, ir_graph *irg, be_main_env_t *env) be_phi_handler_reset(env->phi_handler); set_irg_phase_state(irg, phase_backend); + + dump(DUMP_INITIAL, irg, "-prepared", dump_ir_block_graph); } #define BE_TIMER_PUSH(timer) \ @@ -531,11 +537,14 @@ static void be_main_loop(FILE *file_handle, const char *cup_name) /** * Create execution frequencies from profile data or estimate some */ - if (be_profile_has_data()) { + if (be_profile_has_data()) birg->exec_freq = be_create_execfreqs_from_profile(irg); - } else { + else birg->exec_freq = compute_execfreq(irg, 10); - } + + + /* disabled for now, fails for EmptyFor.c and XXEndless.c */ + /* be_live_chk_compare(birg); */ /* let backend prepare scheduling */ BE_TIMER_PUSH(t_codegen); @@ -814,14 +823,14 @@ const char *be_retrieve_dbg_info(const dbg_info *dbg, unsigned *line) { return NULL; } -int be_put_ignore_regs(const be_irg_t *birg, const arch_register_class_t *cls, bitset_t *bs) +unsigned be_put_ignore_regs(const be_irg_t *birg, const arch_register_class_t *cls, bitset_t *bs) { - if(bs == NULL) + if (bs == NULL) bs = bitset_alloca(cls->n_regs); else bitset_clear_all(bs); - assert(bitset_size(bs) == (unsigned) cls->n_regs); + assert(bitset_size(bs) == (unsigned)cls->n_regs); arch_put_non_ignore_regs(birg->main_env->arch_env, cls, bs); bitset_flip_all(bs); be_abi_put_ignore_regs(birg->abi, cls, bs);