Commit 946fa0cb authored by Matthias Braun's avatar Matthias Braun
Browse files

iropt: (x+C1,C2) => Cmp(X,C1-C2) is only beneficial if Add has no other users

parent 85646be4
...@@ -5211,7 +5211,8 @@ is_bittest: { ...@@ -5211,7 +5211,8 @@ is_bittest: {
DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_OP_C); DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_OP_C);
} }
} }
} else if (is_Add(left) || is_Or_Eor_Add(left)) { } else if ((is_Add(left) || is_Or_Eor_Add(left))
&& only_one_user(left)) {
/* a + c1 ==/!= c2 ==> a ==/!= c2 - c1 */ /* a + c1 ==/!= c2 ==> a ==/!= c2 - c1 */
ir_tarval *tv2 = value_of(get_binop_right(left)); ir_tarval *tv2 = value_of(get_binop_right(left));
if (tarval_is_constant(tv2)) { if (tarval_is_constant(tv2)) {
......
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