Commit 00a4e075 authored by Matthias Braun's avatar Matthias Braun
Browse files

iropt: No need to check confirms for equality

Other localopts/confirm construction already optimize this case, so
testing a==b is enough to check for equality.
parent ba52718f
......@@ -334,15 +334,8 @@ static ir_tarval *computed_value_Sub(const ir_node *n)
const ir_node *b = get_Sub_right(n);
/* a - a == 0 (not possible for float because NaN - NaN == NaN */
if (get_mode_arithmetic(mode) == irma_twos_complement &&
(a == b ||
(is_Confirm(a) && is_Confirm(b) &&
get_Confirm_relation(a) == ir_relation_equal &&
get_Confirm_relation(b) == ir_relation_equal &&
get_Confirm_bound(a) == get_Confirm_value(b) &&
get_Confirm_bound(b) == get_Confirm_value(a)))) {
if (a == b && get_mode_arithmetic(mode) == irma_twos_complement)
return get_mode_null(mode);
}
ir_tarval *ta = value_of(a);
ir_tarval *tb = value_of(b);
......@@ -448,14 +441,8 @@ static ir_tarval *computed_value_Eor(const ir_node *n)
const ir_node *b = get_Eor_right(n);
/* a ^ a == 0 */
if (a == b ||
(is_Confirm(a) && is_Confirm(b) &&
get_Confirm_relation(a) == ir_relation_equal &&
get_Confirm_relation(b) == ir_relation_equal &&
get_Confirm_bound(a) == get_Confirm_value(b) &&
get_Confirm_bound(b) == get_Confirm_value(a))) {
if (a == b)
return get_mode_null(get_irn_mode(n));
}
/* x^~x => ~0 */
if (complement_values(a, 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