}
}
else if (get_opt_unreachable_code() &&
- (n != current_ir_graph->start_block) &&
- (n != current_ir_graph->end_block) ) {
+ (n != get_irg_start_block(current_ir_graph)) &&
+ (n != get_irg_end_block(current_ir_graph)) ) {
int i;
/* If all inputs are dead, this block is dead too, except if it is
/* @@@ fliegt 'raus, sollte aber doch immer wahr sein!!!
assert(get_irn_arity(block) == n_preds && "phi in wrong block!"); */
if ((is_Block_dead(block)) || /* Control dead */
- (block == current_ir_graph->start_block)) /* There should be no Phi nodes */
- return new_Bad(); /* in the Start Block. */
+ (block == get_irg_start_block(current_ir_graph))) /* There should be no Phi nodes */
+ return new_Bad(); /* in the Start Block. */
if (n_preds == 0) return n; /* Phi of dead Region without predecessors. */
proj_nr = get_inversed_pnc(proj_nr);
changed |= 1;
}
- else if (left > right) {
+ else if (get_irn_idx(left) > get_irn_idx(right)) {
ir_node *t = left;
left = right;
ir_node *r = get_binop_right(n);
/* for commutative operators perform a OP b == b OP a */
- if (l > r) {
+ if (get_irn_idx(l) > get_irn_idx(r)) {
set_binop_left(n, r);
set_binop_right(n, l);
}
if (is_Bad(pred))
return new_Bad();
+#if 0
+ /* Propagating Unknowns here seems to be a bad idea, because
+ sometimes we need a node as a input and did not want that
+ it kills it's user.
+ However, i might be useful to move this into a later phase
+ (it you thing optimizing such code is useful). */
if (is_Unknown(pred) && mode_is_data(get_irn_mode(node)))
return new_Unknown(get_irn_mode(node));
+#endif
}
}
#if 0
edges_node_deleted(n, current_ir_graph);
/* evaluation was successful -- replace the node. */
- obstack_free(current_ir_graph->obst, n);
+ irg_kill_node(current_ir_graph, n);
nw = new_Const(get_tarval_mode (tv), tv);
if (old_tp && get_type_mode(old_tp) == get_tarval_mode (tv))
edges_node_deleted(oldn, current_ir_graph);
/* We found an existing, better node, so we can deallocate the old node. */
- obstack_free (current_ir_graph->obst, oldn);
-
+ irg_kill_node(current_ir_graph, oldn);
return n;
}