Remove the unsafe overflow opt flag again :-( It does not solve
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 20 Feb 2008 16:51:47 +0000 (16:51 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 20 Feb 2008 16:51:47 +0000 (16:51 +0000)
the problems ...

[r17813]

include/libfirm/irflag.h
ir/ir/irflag_t.def
ir/ir/iropt.c
ir/opt/opt_osr.c
ir/opt/reassoc.c

index d7263ea..f167f92 100644 (file)
@@ -134,15 +134,6 @@ void set_opt_control_flow_weak_simplification(int value);
 /** Enables/Disables strong if and loop simplification (in optimize_cf). */
 void set_opt_control_flow_strong_simplification(int value);
 
-/**
- * Enables/Disable overflow unsafe transformations (default off).
- * If enabled, SubIu(x, 1) might be transformed into AddIu(x, 0xFFFFFFFF).
- * While enabling generates better code, it invalidates strength reduction
- * of linear-function-test-replacement.
- * So, if strength reduction is used, enable it AFTER strength reduction runs.
- */
-void set_opt_overflow_unsafe_transform(int value);
-
 /** Enable/Disable optimization of dynamic method dispatch.
  *
  * This flag enables/disables the optimization of dynamic method dispatch.
index 38d0ead..fc7f00a 100644 (file)
@@ -58,9 +58,6 @@ I_FLAG(control_flow_weak_simplification   , 6, ON)
 /** */
 I_FLAG(control_flow_strong_simplification , 7, ON)
 
-/** If set, overflow unsafe transformations are allowed. */
-I_FLAG(overflow_unsafe_transform          , 8, OFF)
-
 /** Remove dynamic method dispatch. */
 E_FLAG(dyn_meth_dispatch                  , 11, ON)
 
index 6127de3..53c4d9b 100644 (file)
@@ -1257,7 +1257,7 @@ static ir_node *equivalent_node_Phi(ir_node *n) {
        for (i = 0; i < n_preds; ++i) {
                first_val = get_Phi_pred(n, i);
                if (   (first_val != n)                            /* not self pointer */
-#if 0
+#if 1
                    && (! is_Bad(first_val))
 #endif
                   ) {        /* value not dead */
@@ -1276,7 +1276,7 @@ static ir_node *equivalent_node_Phi(ir_node *n) {
                ir_node *scnd_val = get_Phi_pred(n, i);
                if (   (scnd_val != n)
                    && (scnd_val != first_val)
-#if 0
+#if 1
                    && (! is_Bad(scnd_val))
 #endif
                        ) {
@@ -2098,27 +2098,17 @@ restart:
        if (mode_is_float(mode) && (get_irg_fp_model(current_ir_graph) & fp_strict_algebraic))
                return n;
 
-       if (is_Const(b)) {
-               ir_mode *b_mode = get_irn_mode(b);
-               int allow;
-
-               if (get_opt_overflow_unsafe_transform())
-                       allow = b_mode != mode_P;
-               else
-                       allow = mode_is_signed(b_mode);
-
-               if (allow) {
-                       /* a - C -> a + (-C) */
-                       ir_node *cnst = const_negate(b);
-                       if (cnst != NULL) {
-                               ir_node  *block = get_nodes_block(n);
-                               dbg_info *dbgi  = get_irn_dbg_info(n);
-                               ir_graph *irg   = get_irn_irg(n);
+       if (is_Const(b) && get_irn_mode(b) != mode_P) {
+               /* a - C -> a + (-C) */
+               ir_node *cnst = const_negate(b);
+               if (cnst != NULL) {
+                       ir_node  *block = get_nodes_block(n);
+                       dbg_info *dbgi  = get_irn_dbg_info(n);
+                       ir_graph *irg   = get_irn_irg(n);
 
-                               n = new_rd_Add(dbgi, irg, block, a, cnst, mode);
-                               DBG_OPT_ALGSIM0(oldn, n, FS_OPT_SUB_TO_ADD);
-                               return n;
-                       }
+                       n = new_rd_Add(dbgi, irg, block, a, cnst, mode);
+                       DBG_OPT_ALGSIM0(oldn, n, FS_OPT_SUB_TO_ADD);
+                       return n;
                }
        }
 
index 934dd8e..43734a1 100644 (file)
@@ -1225,14 +1225,6 @@ static void do_lftr(ir_node *cmp, void *ctx) {
  * @param env   the IV environment
  */
 static void lftr(ir_graph *irg, iv_env *env) {
-       if ((env->flags & osr_flag_lftr_with_ov_check)  &&
-               get_opt_overflow_unsafe_transform()) {
-               /*
-                * If overflow unsafe transformation are allowed, we cannot perform
-                * linear function test replacement with overflow checks.
-                */
-               return;
-       }
        irg_walk_graph(irg, NULL, do_lftr, env);
 }
 
index b390e73..8cfcd8c 100644 (file)
@@ -169,11 +169,6 @@ static int reassoc_Sub(ir_node **in)
                        return 0;
                }
 
-               if (!get_opt_overflow_unsafe_transform() && !mode_is_signed(rmode)) {
-                       /* do not transform unsigned, overflow will occur */
-                       return 0;
-               }
-
                mode = get_irn_mode(n);
                dbi  = get_irn_dbg_info(n);