Commit 63ad7472 authored by Matthias Braun's avatar Matthias Braun
Browse files

iropt: fix direct calls to compute_cmp

- The direct call did not respect the get_opt_constant_folding() flag
parent bf8c5a11
......@@ -614,6 +614,17 @@ static ir_tarval *compute_cmp(const ir_node *cmp)
return computed_value_Cmp_Confirm(cmp, left, right, relation);
}
/**
* some people want to call compute_cmp directly, in this case we have to
* test the constant folding flag again
*/
static ir_tarval *compute_cmp_ext(const ir_node *cmp)
{
if (!get_opt_constant_folding())
return tarval_bad;
return compute_cmp(cmp);
}
/**
* Return the value of a Cmp.
*
......@@ -1471,7 +1482,7 @@ static ir_node *equivalent_node_Mux(ir_node *n)
if (ts == tarval_bad && is_Cmp(sel)) {
/* try again with a direct call to compute_cmp, as we don't care
* about the MODEB_LOWERED flag here */
ts = compute_cmp(sel);
ts = compute_cmp_ext(sel);
}
/* Mux(true, f, t) == t */
......@@ -3539,7 +3550,7 @@ static ir_node *transform_node_Cond(ir_node *n)
if (ta == tarval_bad && is_Cmp(a)) {
/* try again with a direct call to compute_cmp, as we don't care
* about the MODEB_LOWERED flag here */
ta = compute_cmp(a);
ta = compute_cmp_ext(a);
}
if (ta != tarval_bad && get_irn_mode(a) == mode_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