Correct inaccurate comment: The only corner case of wrong CF in NEG+ADD as replacemen...
[libfirm] / ir / be / bemain.c
index 07afa5d..af2cfe0 100644 (file)
@@ -86,7 +86,7 @@ static be_options_t be_options = {
        0,                                 /* try to omit frame pointer */
        0,                                 /* create PIC code */
        BE_VERIFY_WARN,                    /* verification level: warn */
-       "i44pc52.info.uni-karlsruhe.de",   /* ilp server */
+       "",                                /* ilp server */
        "cplex",                           /* ilp solver */
        0,                                 /* enable statistic event dumping */
        "",                                /* print stat events */
@@ -136,10 +136,8 @@ static const lc_opt_table_entry_t be_main_options[] = {
        LC_OPT_ENT_BOOL     ("statev",     "dump statistic events",                               &be_options.statev),
        LC_OPT_ENT_STR      ("filtev",     "filter for stat events (regex if support is active",  &be_options.filtev, sizeof(be_options.filtev)),
 
-#ifdef WITH_ILP
-       LC_OPT_ENT_STR ("ilp.server", "the ilp server name", be_options.ilp_server, sizeof(be_options.ilp_server)),
-       LC_OPT_ENT_STR ("ilp.solver", "the ilp solver name", be_options.ilp_solver, sizeof(be_options.ilp_solver)),
-#endif /* WITH_ILP */
+       LC_OPT_ENT_STR ("ilp.server", "the ilp server name", &be_options.ilp_server, sizeof(be_options.ilp_server)),
+       LC_OPT_ENT_STR ("ilp.solver", "the ilp solver name", &be_options.ilp_solver, sizeof(be_options.ilp_solver)),
        LC_OPT_LAST
 };
 
@@ -501,7 +499,6 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
        static const char suffix[] = ".prof";
 
        size_t        i, num_birgs;
-       int           stat_active = 0;
        be_main_env_t env;
        char          prof_filename[256];
        be_irg_t      *birgs;
@@ -567,8 +564,6 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
                num_birgs++;
        }
 
-       stat_active = stat_is_active();
-
        /* For all graphs */
        for (i = 0; i < num_birgs; ++i) {
                be_irg_t *birg = &birgs[i];
@@ -578,7 +573,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
                /* set the current graph (this is important for several firm functions) */
                current_ir_graph = irg;
 
-               stat_ev_if {
+               if (stat_ev_enabled) {
                        stat_ev_ctx_push_fobj("bemain_irg", irg);
                        be_stat_ev("bemain_insns_start", be_count_insns(irg));
                        be_stat_ev("bemain_blocks_start", be_count_blocks(irg));
@@ -613,10 +608,11 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
                        dump(DUMP_ABI, irg, "abi");
                }
 
-               /* we have to do cfopt+remove_critical_edges as we can't have Bad-blocks
-                * or critical edges in the backend */
-               optimize_cf(irg);
+               /* We can't have Bad-blocks or critical edges in the backend.
+                * Before removing Bads, we remove unreachable code. */
+               optimize_graph_df(irg);
                remove_critical_cf_edges(irg);
+               remove_bads(irg);
 
                /* We often have dead code reachable through out-edges here. So for
                 * now we rebuild edges (as we need correct user count for code
@@ -708,7 +704,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
                be_sched_verify(irg, be_options.verify_option);
                be_timer_pop(T_VERIFY);
 
-               stat_ev_if {
+               if (stat_ev_enabled) {
                        stat_ev_dbl("bemain_costs_before_ra",
                                        be_estimate_irg_costs(irg, birg->exec_freq));
                        be_stat_ev("bemain_insns_before_ra", be_count_insns(irg));
@@ -744,7 +740,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
 
                dump(DUMP_FINAL, irg, "finish");
 
-               stat_ev_if {
+               if (stat_ev_enabled) {
                        be_stat_ev("bemain_insns_finish", be_count_insns(irg));
                        be_stat_ev("bemain_blocks_finish", be_count_blocks(irg));
                }
@@ -854,7 +850,7 @@ void be_main(FILE *file_handle, const char *cup_name)
        if (be_options.timing == BE_TIME_ON) {
                ir_timer_stop(t);
                ir_timer_leave_high_priority();
-               stat_ev_if {
+               if (stat_ev_enabled) {
                        stat_ev_dbl("bemain_backend_time", ir_timer_elapsed_msec(t));
                } else {
                        double val = ir_timer_elapsed_usec(t) / 1000.0;