the problems ...
[r17813]
/** 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.
/** */
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)
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 */
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
) {
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;
}
}
* @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);
}
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);