Commit 30e39a61 authored by yb9976's avatar yb9976
Browse files

Add local optimization: ~x - y --> ~(x + y).

parent e42660d9
......@@ -2973,6 +2973,15 @@ restart:
return n;
}
}
/* ~x - y = ~(x + y) */
if (is_Not(a)) {
dbg_info *dbgi = get_irn_dbg_info(n);
ir_node *block = get_nodes_block(n);
ir_mode *mode = get_irn_mode(n);
ir_node *add = new_rd_Add(dbgi, block, get_Not_op(a), b, mode);
ir_node *not = new_rd_Not(dbgi, block, add, mode);
return not;
}
/* x-(x&y) = x & ~y */
if (is_And(b)) {
ir_node *and_left = get_And_left(b);
......
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