removed set_opt_overflow_unsafe_transform(), not needed anymore
[cparser] / driver / firm_opt.c
index 5c0a2e2..f0cddeb 100644 (file)
 #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
@@ -288,6 +292,7 @@ static void do_firm_optimizations(const char *input_filename, int firm_const_exi
   ir_graph *irg;
   unsigned aa_opt;
 
+  /* FIXME: cloning might ADD new graphs. */
   irg_dump_no = calloc(get_irp_last_idx(), sizeof(*irg_dump_no));
 
   set_opt_strength_red(firm_opt.strength_red);
@@ -337,7 +342,7 @@ static void do_firm_optimizations(const char *input_filename, int firm_const_exi
 
   if (firm_opt.func_calls) {
     timer_push(TV_REAL_FUNC_CALL);
-      optimize_funccalls(firm_const_exists);
+      optimize_funccalls(firm_const_exists, NULL);
     timer_pop();
     DUMP_ALL_C(firm_dump.ir_graph && firm_dump.all_phases, "func_call");
     CHECK_ALL(firm_opt.check_all);
@@ -351,6 +356,9 @@ 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++) {
     irg = current_ir_graph = get_irp_irg(i);
 
@@ -425,6 +433,7 @@ static void do_firm_optimizations(const char *input_filename, int firm_const_exi
     if (firm_opt.luffig) {
       opt_ldst2(irg);
       DUMP_ONE_C(firm_dump.ir_graph && firm_dump.all_phases, irg, "ldst2");
+      CHECK_ONE(firm_opt.check_all, irg);
     }
 
     timer_push(TV_CF_OPT);
@@ -519,7 +528,7 @@ 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);
     timer_pop();
     DUMP_ONE_C(firm_dump.ir_graph && firm_dump.all_phases, irg, "stred");
     CHECK_ONE(firm_opt.check_all, irg);
@@ -541,6 +550,7 @@ static void do_firm_optimizations(const char *input_filename, int firm_const_exi
   if (firm_opt.cloning) {
     proc_cloning((float)firm_opt.clone_threshold);
     DUMP_ALL_C(firm_dump.ir_graph && firm_dump.all_phases, "clone");
+    CHECK_ALL(firm_opt.check_all);
   }
 
   if (firm_dump.ir_graph) {
@@ -873,10 +883,8 @@ static void do_firm_lowering(const char *input_filename)
     DUMP_ALL(firm_dump.ir_graph, "-low-opt");
   }
 
-#if 0
   if (firm_opt.cc_opt)
     mark_private_methods();
-#endif
 
   /* set the phase to low */
   for (i = get_irp_n_irgs() - 1; i >= 0; --i)