} else if (r->part == l->part && !mode_is_float(get_irn_mode(l->node))) {
tv = relation & ir_relation_equal ? tarval_b_true : tarval_b_false;
- /* if the node was ONCE evaluated by all constants, but now
+ /* if the node was ONCE evaluated to a constant, but now
this breaks AND we get from the argument partitions a different
- result, switch to bottom.
+ result, ensure monotony by fall to bottom.
This happens because initially all nodes are in the same partition ... */
- if (node->type.tv != tv)
+ if (node->type.tv == tarval_bottom)
+ tv = tarval_bottom;
+ else if (node->type.tv != tv && is_constant_type(node->type))
tv = tarval_bottom;
node->type.tv = tv;
} else {
return 0;
else if (is_Jmp(pred))
return 1;
+ else if (is_Raise(pred)) {
+ /* Raise is a tuple and usually has only one reachable ProjX,
+ * but it must not be eliminated like a Jmp */
+ return 0;
+ }
else if (get_irn_mode(pred) == mode_T) {
/* if the predecessor block has more than one
reachable outputs we cannot remove the block */
}
}
- /* the EndBlock is always reachable even if the analysis
- finds out the opposite :-) */
- if (block != get_irg_end_block(current_ir_graph)) {
- /* mark dead blocks */
- //set_Block_dead(block);
- //ir_graph *irg = get_irn_irg(block);
- //exchange(block, get_irg_bad(irg));
- DB((dbg, LEVEL_1, "Removing dead %+F\n", block));
- } else {
- /* the endblock is unreachable */
+ if (block == get_irg_end_block(current_ir_graph)) {
+ /* Analysis found out that the end block is unreachable,
+ * hence we remove all its control flow predecessors. */
set_irn_in(block, 0, NULL);
}
return;
node_t *block = get_irn_node(get_nodes_block(irn));
if (block->type.tv == tarval_unreachable) {
- ir_node *bad = get_irg_bad(current_ir_graph);
+ ir_graph *irg = get_irn_irg(irn);
+ ir_mode *mode = get_irn_mode(node->node);
+ ir_node *bad = new_r_Bad(irg, mode);
/* here, bad might already have a node, but this can be safely ignored
as long as bad has at least ONE valid node */
if (env.modified) {
/* control flow might changed */
- set_irg_outs_inconsistent(irg);
set_irg_extblk_inconsistent(irg);
set_irg_doms_inconsistent(irg);
- set_irg_loopinfo_inconsistent(irg);
set_irg_entity_usage_state(irg, ir_entity_usage_not_computed);
}