* @file ir/opt/ifconv.c
* @brief If conversion
* @author Christoph Mallon
- * @version $Id$
*/
#include "config.h"
bool changed; /**< Set if the graph was changed. */
} walker_env;
-DEBUG_ONLY(static firm_dbg_module_t *dbg);
+DEBUG_ONLY(static firm_dbg_module_t *dbg;)
/**
* Returns non-zero if a Block can be emptied.
mux_true = get_Phi_pred(p, i);
mux_false = get_Phi_pred(p, j);
}
- if (!env->allow_ifconv(sel, mux_false, mux_true)) {
+ if (mux_true == mux_false)
+ continue;
+ ir_mode *mode = get_irn_mode(mux_true);
+ if (mode == mode_M
+ || !env->allow_ifconv(sel, mux_false, mux_true)) {
supported = false;
break;
}
walker_env env;
const backend_params *be_params = be_get_backend_param();
+ assure_irg_properties(irg,
+ IR_GRAPH_PROPERTY_NO_CRITICAL_EDGES
+ | IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE
+ | IR_GRAPH_PROPERTY_NO_BADS
+ | IR_GRAPH_PROPERTY_ONE_RETURN);
+
/* get the parameters */
env.allow_ifconv = be_params->allow_ifconv;
env.changed = false;
DB((dbg, LEVEL_1, "Running if-conversion on %+F\n", irg));
- normalize_one_return(irg);
- remove_critical_cf_edges(irg);
-
compute_cdep(irg);
ir_reserve_resources(irg, IR_RESOURCE_BLOCK_MARK | IR_RESOURCE_PHI_LIST);
if (env.changed) {
local_optimize_graph(irg);
-
- /* graph has changed, invalidate analysis info */
- set_irg_extblk_inconsistent(irg);
- set_irg_loopinfo_inconsistent(irg);
- set_irg_doms_inconsistent(irg);
}
free_cdep(irg);
+
+ confirm_irg_properties(irg,
+ IR_GRAPH_PROPERTY_NO_CRITICAL_EDGES
+ | IR_GRAPH_PROPERTY_ONE_RETURN);
}
ir_graph_pass_t *opt_if_conv_pass(const char *name)