- add a combo flag again, so inlining can use combo or df/cf depending on command...
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Mon, 29 Sep 2008 23:36:49 +0000 (23:36 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Mon, 29 Sep 2008 23:36:49 +0000 (23:36 +0000)
[r22352]

include/libfirm/irflag.h
ir/ir/irflag_t.def
ir/opt/opt_inline.c

index 541f30d..e95b3de 100644 (file)
@@ -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.
index 1a1cf29..e464a6c 100644 (file)
@@ -26,7 +26,7 @@
 
 /*
  * We have 3 kinds of flags:
- * I_FLAGS are INTERNAL flags: The is only a public set_opt_<flag> function
+ * I_FLAGS are INTERNAL flags: There is only a public set_opt_<flag> function
  * E_FLAGS are EXTERNAL flags: Public get_opt_<flag> and set_opt_<flag> 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)
 
index 2bf5d8f..b13d397 100644 (file)
@@ -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)) {