From 098ba001486fc4336ad43e8364aa74adc0fae9a1 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Wed, 20 Feb 2008 13:24:55 +0000 Subject: [PATCH] handle the new overflow_unsafe_transform option right; synchronize with edgfe [r18901] --- driver/firm_opt.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/driver/firm_opt.c b/driver/firm_opt.c index 4d4e90c..3eff5f0 100644 --- a/driver/firm_opt.c +++ b/driver/firm_opt.c @@ -20,6 +20,10 @@ #include "firm_cmdline.h" #include "firm_timing.h" +#ifdef _WIN32 +#define snprintf _snprintf +#endif + #if defined(_DEBUG) || defined(FIRM_DEBUG) #define DBG(x) dbg_printf x #else @@ -296,6 +300,10 @@ static void do_firm_optimizations(const char *input_filename, int firm_const_exi set_opt_auto_create_sync(firm_opt.auto_sync); set_opt_alias_analysis(firm_opt.alias_analysis); + /* Overflow unsafe transformation can be enabled here if OSR is disabled, else + must be disabled until OSR finished. */ + set_opt_overflow_unsafe_transform(firm_opt.strength_red == FALSE); + aa_opt = aa_opt_no_opt; if (firm_opt.strict_alias) aa_opt |= aa_opt_type_based | aa_opt_byte_type_may_alias; @@ -352,6 +360,7 @@ static void do_firm_optimizations(const char *input_filename, int firm_const_exi CHECK_ALL(firm_opt.check_all); } + /* do lowering on the const code irg */ lower_const_code(); for (i = 0; i < get_irp_n_irgs(); i++) { @@ -359,9 +368,9 @@ static void do_firm_optimizations(const char *input_filename, int firm_const_exi #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) - normalize_one_return(irg); + /* If SIMD optimization is on, make sure we have only 1 return */ + if (firm_ext_grs.create_pattern || firm_ext_grs.simd_opt) + normalize_one_return(irg); #endif @@ -523,7 +532,9 @@ static void do_firm_optimizations(const char *input_filename, int firm_const_exi } timer_push(TV_OSR); - opt_osr(current_ir_graph, osr_flag_default /*| osr_flag_ignore_x86_shift*/); + opt_osr(current_ir_graph, osr_flag_default | osr_flag_keep_reg_pressure | osr_flag_ignore_x86_shift); + /* now it is safe to enable overflow unsafe transformations */ + set_opt_overflow_unsafe_transform(1); timer_pop(); DUMP_ONE_C(firm_dump.ir_graph && firm_dump.all_phases, irg, "stred"); CHECK_ONE(firm_opt.check_all, irg); -- 2.20.1