unsigned on_fallen:1; /**< Set, if this node is on the fallen list. */
unsigned is_follower:1; /**< Set, if this node is a follower. */
unsigned is_flagged:1; /**< Set, if this node is flagged by step(). */
+ unsigned by_all_const:1; /**< Set, if this node was once evaluated by all constants. */
};
/**
node->on_fallen = 0;
node->is_follower = 0;
node->is_flagged = 0;
+ node->by_all_const = 0;
set_irn_node(irn, node);
list_add_tail(&node->node_list, &part->Leader);
node_t *r = get_irn_node(get_Sub_right(sub));
lattice_elem_t a = l->type;
lattice_elem_t b = r->type;
+ tarval *tv;
if (a.tv == tarval_top || b.tv == tarval_top) {
node->type.tv = tarval_top;
} else {
node->type.tv = tarval_bottom;
}
+ node->by_all_const = 1;
} else if (r->part == l->part &&
(!mode_is_float(get_irn_mode(l->node)))) {
/*
* NaN op NaN = NaN, so we must check this here.
*/
ir_mode *mode = get_irn_mode(sub);
- node->type.tv = get_mode_null(mode);
+ tv = get_mode_null(mode);
+
+ /* if the node was ONCE evaluated by all constants, but now
+ this breakes AND we cat by partition a different result, switch to bottom.
+ This happens because initially all nodes are in the same partition ... */
+ if (node->by_all_const && node->type.tv != tv)
+ tv = tarval_bottom;
+ node->type.tv = tv;
} else {
node->type.tv = tarval_bottom;
}
lattice_elem_t a = l->type;
lattice_elem_t b = r->type;
pn_Cmp pnc = get_Proj_proj(proj);
+ tarval *tv;
if (a.tv == tarval_top || b.tv == tarval_top) {
node->type.tv = tarval_top;
} else if (is_con(a) && is_con(b)) {
default_compute(node);
+ node->by_all_const = 1;
} else if (r->part == l->part &&
(!mode_is_float(get_irn_mode(l->node)) || pnc == pn_Cmp_Lt || pnc == pn_Cmp_Gt)) {
/*
* BEWARE: a == a is NOT always True for floating Point values, as
* NaN != NaN is defined, so we must check this here.
*/
- node->type.tv = new_tarval_from_long(pnc & pn_Cmp_Eq, mode_b);
+ tv = new_tarval_from_long(pnc & pn_Cmp_Eq, mode_b);
+
+ /* if the node was ONCE evaluated by all constants, but now
+ this breakes AND we cat by partition a different result, switch to bottom.
+ This happens because initially all nodes are in the same partition ... */
+ if (node->by_all_const && node->type.tv != tv)
+ tv = tarval_bottom;
+ node->type.tv = tv;
} else {
node->type.tv = tarval_bottom;
}
/* register a debug mask */
FIRM_DBG_REGISTER(dbg, "firm.opt.combo");
- //firm_dbg_set_mask(dbg, SET_LEVEL_3);
+ firm_dbg_set_mask(dbg, SET_LEVEL_3);
DB((dbg, LEVEL_1, "Doing COMBO for %+F\n", irg));