X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=driver%2Ffirm_opt.c;h=5843af7b88c21fa2a9184aa300d5ffcf80bd9206;hb=ed1ed2b5fb813fd8de24b2eaa6fffce033246a8c;hp=eb75247e9aab7442c6f397498874e25a16cbbf90;hpb=3294ed88964894e879810401479c52d456e6debe;p=cparser diff --git a/driver/firm_opt.c b/driver/firm_opt.c index eb75247..5843af7 100644 --- a/driver/firm_opt.c +++ b/driver/firm_opt.c @@ -6,6 +6,9 @@ * * $Id$ */ + +#include + #include #include #include @@ -21,14 +24,10 @@ #include "firm_timing.h" #include "ast2firm.h" -#ifdef _WIN32 -#define snprintf _snprintf -#endif - #if defined(_DEBUG) || defined(FIRM_DEBUG) #define DBG(x) dbg_printf x #else -#define DBG(x) +#define DBG(x) ((void)0) #endif /* _DEBUG || FIRM_DEBUG */ @@ -113,8 +112,6 @@ static create_intrinsic_fkt *arch_create_intrinsic = NULL; static void *create_intrinsic_ctx = NULL; static const ir_settings_if_conv_t *if_conv_info = NULL; -ir_mode *firm_imm_fp_mode = NULL; - /* entities of runtime functions */ ir_entity_ptr rts_entities[rts_max]; @@ -538,12 +535,6 @@ static void do_firm_optimizations(const char *input_filename) for (i = 0; i < get_irp_n_irgs(); i++) { ir_graph *irg = get_irp_irg(i); -#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) - do_irg_opt("onereturn"); -#endif - do_irg_opt(irg, "scalar"); do_irg_opt(irg, "local"); do_irg_opt(irg, "reassoc"); @@ -915,47 +906,22 @@ void gen_firm_init(void) params.cc_mask = 0; /* no regparam, cdecl */ params.builtin_dbg = NULL; - #ifdef FIRM_EXT_GRS - /* Activate Graph rewriting if SIMD optimization is turned on */ - /* This has to be done before init_firm() is called! */ - if (firm_ext_grs.simd_opt) - ext_grs_activate(); -#endif - - init_firm(¶ms); + ir_init(¶ms); if (firm_be_opt.selection == BE_FIRM_BE) { const backend_params *be_params = be_get_backend_param(); firm_opt.lower_ll = (a_byte) be_params->do_dw_lowering; - params.arch_op_settings = be_params->arch_op_settings; arch_create_intrinsic = be_params->arch_create_intrinsic_fkt; create_intrinsic_ctx = be_params->create_intrinsic_ctx; ad_param = be_params->dep_param; if_conv_info = be_params->if_conv_info; - - if (be_params->has_imm_fp_mode) - firm_imm_fp_mode = be_params->imm_fp_mode; - } - /* OS option must be set to the backend */ - 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; } dbg_init(NULL, NULL, dbg_snprint); edges_init_dbg(firm_opt.vrfy_edges); - //cbackend_set_debug_retrieve(dbg_retrieve); set_opt_precise_exc_context(firm_opt.precise_exc); set_opt_fragile_ops(firm_opt.fragile_ops); @@ -1090,23 +1056,6 @@ void gen_firm_finish(FILE *out, const char *input_filename, int c_mode, int new_ for (i = get_irp_n_irgs() - 1; i >= 0; --i) set_irg_phase_low(get_irp_irg(i)); - -#ifdef FIRM_EXT_GRS - /** SIMD Optimization Extensions **/ - - /* Pattern creation step. No code has to be generated, so - exit after pattern creation */ - if (firm_ext_grs.create_pattern) { - ext_grs_create_pattern(); - exit(0); - } - - /* SIMD optimization step. Uses graph patterns to find - rich instructions and rewrite */ - if (firm_ext_grs.simd_opt) - ext_grs_simd_opt(); -#endif - if (firm_dump.statistic & STAT_FINAL_IR) stat_dump_snapshot(input_filename, "final-ir"); @@ -1116,18 +1065,13 @@ void gen_firm_finish(FILE *out, const char *input_filename, int c_mode, int new_ if (firm_dump.statistic & STAT_FINAL) stat_dump_snapshot(input_filename, "final"); - -#if 0 - if (firm_opt.ycomp_dbg) - firm_finish_ycomp_debugger(); -#endif -} /* gen_firm_finish */ +} /** * Do very early initializations */ -void firm_early_init(void) { +void firm_early_init(void) +{ /* arg: need this here for command line options */ be_opt_register(); - firm_init_options(NULL, 0, NULL); -} /* firm_early_init */ +}