From: Matthias Braun Date: Mon, 14 Jul 2008 14:04:53 +0000 (+0000) Subject: sync driver with edgfe X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=2a7937c5a31479262a9677cc0da3defd50b92a03;p=cparser sync driver with edgfe [r20448] --- diff --git a/driver/firm_cmdline.c b/driver/firm_cmdline.c index d7ca466..d78dc09 100644 --- a/driver/firm_cmdline.c +++ b/driver/firm_cmdline.c @@ -26,8 +26,8 @@ struct a_firm_opt firm_opt = { /* reassoc = */ TRUE, /* cse = */ TRUE, /* control_flow = */ TRUE, - /* code_place = */ TRUE, - /* gvn_pre = */ FALSE, /* currently buggy */ + /* gcse = */ TRUE, + /* gvn_pre = */ FALSE, /* cond_eval = */ FALSE, /* if_conversion = */ FALSE, /* func_calls = */ TRUE, @@ -128,8 +128,8 @@ static const struct params { { X("no-const-fold"), &firm_opt.const_folding, 0, "firm: disable constant folding" }, { X("control_flow"), &firm_opt.control_flow, 1, "firm: enable control flow optimization" }, { X("no-control-flow"), &firm_opt.control_flow, 0, "firm: disable control flow optimization" }, - { X("code-place"), &firm_opt.code_place, 1, "firm: enable GCSE and code placement" }, - { X("no-code-place"), &firm_opt.code_place, 0, "firm: disable GCSE and code placement" }, + { X("gcse"), &firm_opt.gcse, 1, "firm: enable global common subexpression elimination" }, + { X("no-gcse"), &firm_opt.gcse, 0, "firm: disable global common subexpression elimination" }, { X("gvn-pre"), &firm_opt.gvn_pre, 1, "firm: enable GVN partial redundancy elimination" }, { X("no-gvn-pre"), &firm_opt.gvn_pre, 0, "firm: disable GVN partial redundancy elimination" }, { X("cond-eval"), &firm_opt.cond_eval, 1, "firm: enable partial condition evaluation optimization" }, @@ -290,7 +290,7 @@ static void disable_opts(void) { firm_opt.reassoc = FALSE; firm_opt.cse = FALSE; /* firm_opt.control_flow */ - firm_opt.code_place = FALSE; + firm_opt.gcse = FALSE; firm_opt.gvn_pre = FALSE; firm_opt.cond_eval = FALSE; firm_opt.if_conversion = FALSE; @@ -377,21 +377,6 @@ int firm_option(const char *opt) res &= firm_be_option("stabs"); return res; } - /* OS option must be set to the backend */ - else if (firm_options[i].flag == &firm_opt.os_support) { - switch (firm_opt.os_support) { - case OS_SUPPORT_MINGW: - firm_be_option("ia32-gasmode=mingw"); - break; - case OS_SUPPORT_MACHO: - firm_be_option("ia32-gasmode=macho"); - break; - case OS_SUPPORT_LINUX: - default: - firm_be_option("ia32-gasmode=linux"); - break; - } - } break; } } diff --git a/driver/firm_cmdline.h b/driver/firm_cmdline.h index decb01b..a34580b 100644 --- a/driver/firm_cmdline.h +++ b/driver/firm_cmdline.h @@ -32,8 +32,7 @@ struct a_firm_opt { a_byte reassoc; /**< enable reassociation */ a_byte cse; /**< enable common-subexpression elimination */ a_byte control_flow; /**< enable control flow optimizations */ - a_byte code_place; /**< enable global common-subexpression elimination - and code placement */ + a_byte gcse; /**< enable global common-subexpression elimination */ a_byte gvn_pre; /**< enable global common-subexpression elimination and partial redundancy elimination */ a_byte cond_eval; /**< enable condition evaluation */ diff --git a/driver/firm_codegen.c b/driver/firm_codegen.c index 941f559..4a4c767 100644 --- a/driver/firm_codegen.c +++ b/driver/firm_codegen.c @@ -71,19 +71,19 @@ void do_codegen(FILE *out, const char *file_name) { switch (firm_be_opt.selection) { #ifdef FIRM2C_BACKEND case BE_FIRM2C: - timer_push(TV_FIRM2C_BE); + timer_start(TV_FIRM2C_BE); cbackend_set_debug_retrieve(dbg_retrieve); generate_code_file(out); - timer_pop(); + timer_stop(TV_FIRM2C_BE); break; #endif #ifdef FIRM_BACKEND case BE_FIRM_BE: - timer_push(TV_FIRM_BE); + timer_start(TV_FIRM_BE); ir_set_debug_retrieve(dbg_retrieve); be_main(out, file_name); - timer_pop(); + timer_stop(TV_FIRM_BE); break; #endif diff --git a/driver/firm_opt.c b/driver/firm_opt.c index 4d30883..bacf110 100644 --- a/driver/firm_opt.c +++ b/driver/firm_opt.c @@ -354,13 +354,8 @@ static void do_firm_optimizations(const char *input_filename, int firm_const_exi lower_const_code(); for (i = 0; i < get_irp_n_irgs(); i++) { - int i2; - irg = current_ir_graph = get_irp_irg(i); - /* test hack... */ - for (i2 = 0; i2 < 3; i2++) { - #ifdef FIRM_EXT_GRS /* If SIMD optimization is on, make sure we have only 1 return */ if (firm_ext_grs.create_pattern || firm_ext_grs.simd_opt) @@ -543,9 +538,6 @@ static void do_firm_optimizations(const char *input_filename, int firm_const_exi timer_pop(); DUMP_ONE_C(firm_dump.ir_graph && firm_dump.all_phases, irg, "dead"); CHECK_ONE(firm_opt.check_all, irg); - - } - } if (firm_opt.do_inline) { diff --git a/driver/firm_opt.h b/driver/firm_opt.h index e4029ca..3c04f85 100644 --- a/driver/firm_opt.h +++ b/driver/firm_opt.h @@ -10,8 +10,8 @@ extern ir_mode *firm_imm_fp_mode; enum rts_names { rts_debugbreak, /**< the name of the __debugbreak() intrinsic */ rts_abort, /**< the name of the abort() function */ - rts_alloca, /**< the name of the alloca() function */ rts_abs, /**< the name of the abs() function */ + rts_alloca, /**< the name of the alloca() function */ rts_labs, /**< the name of the labs() function */ rts_llabs, /**< the name of the llabs() function */ rts_imaxabs, /**< the name of the imaxabs() function */ diff --git a/driver/gen_firm_asm.c b/driver/gen_firm_asm.c index ffb080d..66d47a2 100644 --- a/driver/gen_firm_asm.c +++ b/driver/gen_firm_asm.c @@ -510,7 +510,7 @@ static void generate_code_Const(FILE *f, ir_node *n) else { def_mode: tarval_snprintf(buf, sizeof(buf), tv); - fprintf(f, "new_tarval_from_str(\"%s\", %zd, ", buf, strlen(buf)); + fprintf(f, "new_tarval_from_str(\"%s\", %u, ", buf, strlen(buf)); fprintf(f, "mode_%s)", get_mode_name(mode)); } }