Commit d729c062 authored by Matthias Braun's avatar Matthias Braun
Browse files

disallow Conv Is(xx b)

It was a strange feature only inspired by the lazyness of some frontend
developer (=me)
parent cbe46be4
......@@ -6124,28 +6124,6 @@ static ir_node *transform_node_Mux(ir_node *n)
}
}
}
/* more normalization: Mux(sel, 0, 1) is simply a conv from the mode_b
* value to integer. */
if (is_Const(t) && is_Const(f) && mode_is_int(mode)) {
ir_tarval *a = get_Const_tarval(t);
ir_tarval *b = get_Const_tarval(f);
if (tarval_is_one(a) && tarval_is_null(b)) {
ir_node *block = get_nodes_block(n);
ir_node *conv = new_r_Conv(block, sel, mode);
n = conv;
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_MUX_CONV);
return n;
} else if (tarval_is_null(a) && tarval_is_one(b)) {
ir_node *block = get_nodes_block(n);
ir_node *not_ = new_r_Not(block, sel, mode_b);
ir_node *conv = new_r_Conv(block, not_, mode);
n = conv;
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_MUX_CONV);
return n;
}
}
}
if (is_Cmp(sel) && mode_is_int(mode) && is_cmp_equality_zero(sel)) {
......
......@@ -1437,7 +1437,7 @@ static int verify_node_Conv(const ir_node *n)
ir_mode *mymode = get_irn_mode(n);
ir_mode *op1mode = get_irn_mode(get_Conv_op(n));
ASSERT_AND_RET_DBG(mode_is_datab(op1mode) && mode_is_data(mymode),
ASSERT_AND_RET_DBG(mode_is_data(op1mode) && mode_is_data(mymode),
"Conv node", 0,
show_unop_failure(n, "/* Conv: BB x datab --> data */");
);
......
......@@ -237,7 +237,7 @@ static bool needs_mode_b_input(const ir_node *node, int input)
/**
* Collects "roots" of a mode_b calculation. These are nodes which require a
* mode_b input (Cond, Mux, Conv(xxx_b))
* mode_b input (Cond, Mux)
*/
static void collect_needs_lowering(ir_node *node, void *env)
{
......@@ -245,7 +245,7 @@ static void collect_needs_lowering(ir_node *node, void *env)
int i;
(void) env;
/* if the node produces mode_b then it is a not a root (but should be
/* if the node produces mode_b then it is not a root (but should be
* something our lower_node function can handle) */
if (get_irn_mode(node) == mode_b) {
assert(is_And(node) || is_Or(node) || is_Eor(node) || is_Phi(node)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment