From 5bfb295525b0e0811b61106bb47375e2aaf77c54 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Sat, 10 Apr 2010 11:34:42 +0000 Subject: [PATCH] Reverted r27368, needed for propagation of changed nodes ... [r27373] --- ir/opt/combo.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/ir/opt/combo.c b/ir/opt/combo.c index 972bca5c8..f8a507082 100644 --- a/ir/opt/combo.c +++ b/ir/opt/combo.c @@ -2290,6 +2290,43 @@ static void compute_Eor(node_t *node) } } /* compute_Eor */ +/** + * (Re-)compute the type for Cmp. + * + * @param node the node + */ +static void compute_Cmp(node_t *node) +{ + ir_node *cmp = node->node; + node_t *l = get_irn_node(get_Cmp_left(cmp)); + node_t *r = get_irn_node(get_Cmp_right(cmp)); + lattice_elem_t a = l->type; + lattice_elem_t b = r->type; + ir_mode *mode = get_irn_mode(get_Cmp_left(cmp)); + + if (a.tv == tarval_top || b.tv == tarval_top) { + node->type.tv = tarval_top; + } else if (r->part == l->part) { + /* both nodes congruent, we can probably do something */ + if (mode_is_float(mode)) { + /* beware of NaN's */ + node->type.tv = tarval_bottom; + } else { + node->type.tv = tarval_b_true; + } + } else if (is_con(a) && is_con(b)) { + /* both nodes are constants, we can probably do something */ + if (mode_is_float(mode)) { + /* beware of NaN's */ + node->type.tv = tarval_bottom; + } else { + node->type.tv = tarval_b_true; + } + } else { + node->type.tv = tarval_bottom; + } +} /* compute_Cmp */ + /** * (Re-)compute the type for a Proj(Cmp). * @@ -3491,6 +3528,7 @@ static void set_compute_functions(void) SET(Sub); SET(Eor); SET(SymConst); + SET(Cmp); SET(Proj); SET(Confirm); SET(Return); -- 2.20.1