From: Michael Beck Date: Mon, 29 Sep 2008 23:36:49 +0000 (+0000) Subject: - add a combo flag again, so inlining can use combo or df/cf depending on command... X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=1a6cba4219a5de6300ac4f8371e0b6e24adee156;p=libfirm - add a combo flag again, so inlining can use combo or df/cf depending on command line option [r22352] --- diff --git a/include/libfirm/irflag.h b/include/libfirm/irflag.h index 541f30dfe..e95b3de31 100644 --- a/include/libfirm/irflag.h +++ b/include/libfirm/irflag.h @@ -71,7 +71,7 @@ void set_opt_constant_folding(int value); * If opt_algebraic_simplification == 1 perform * - algebraic simplification (a * 0 ==> 0, a or a ==> a) * - simplification of tests ( !(a < b) ==> (a >= b)) - * Default: opt_constant_folding == 1. + * Default: opt_algebraic_simplification == 1. */ void set_opt_algebraic_simplification(int value); @@ -96,6 +96,15 @@ int get_opt_cse(void); */ void set_opt_global_cse(int value); +/** Enables/Disables usage of combo algorithm. + * + * If opt_combo == 1 perform combo optimization + * instead of combinations of optimiza_graph_df()/ + * optimize_graph_cf() + * Default: opt_combo == 1. + */ +void set_opt_combo(int value); + /** Enables/Disables strength reduction. * * If opt_strength_red == 1 perform strength reduction. diff --git a/ir/ir/irflag_t.def b/ir/ir/irflag_t.def index 1a1cf2939..e464a6c71 100644 --- a/ir/ir/irflag_t.def +++ b/ir/ir/irflag_t.def @@ -26,7 +26,7 @@ /* * We have 3 kinds of flags: - * I_FLAGS are INTERNAL flags: The is only a public set_opt_ function + * I_FLAGS are INTERNAL flags: There is only a public set_opt_ function * E_FLAGS are EXTERNAL flags: Public get_opt_ and set_opt_ fucntions exists * R_FLAGS are RUNNING flags: Use only internally in libfirm to indicate running states */ @@ -61,6 +61,9 @@ I_FLAG(control_flow_strong_simplification , 7, ON) /** Algebraic simplifications. */ I_FLAG(algebraic_simplification , 8, ON) +/** Use combo instead of df/cf optimizations. */ +I_FLAG(combo , 9, ON) + /** Remove dynamic method dispatch. */ E_FLAG(dyn_meth_dispatch , 11, ON) diff --git a/ir/opt/opt_inline.c b/ir/opt/opt_inline.c index 2bf5d8ff2..b13d397e7 100644 --- a/ir/opt/opt_inline.c +++ b/ir/opt/opt_inline.c @@ -2273,22 +2273,18 @@ void inline_functions(unsigned maxsize, int inline_threshold) { env = get_irg_link(irg); if (env->got_inline) { /* this irg got calls inlined: optimize it */ - - if (0) { - /* scalar replacement does not work well with Tuple nodes, so optimize them away */ - optimize_graph_df(irg); - + if (get_opt_combo()) { + if (env->local_vars) { + scalar_replacement_opt(irg); + } + combo(irg); + } else { if (env->local_vars) { if (scalar_replacement_opt(irg)) { optimize_graph_df(irg); } } optimize_cf(irg); - } else { - if (env->local_vars) { - scalar_replacement_opt(irg); - } - combo(irg); } } if (env->got_inline || (env->n_callers_orig != env->n_callers)) {