/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer, Goetz Lindenmaier
-**
-** iropt --- optimizations intertwined with IR construction.
+* All rights reserved.
+*
+* Authors: Christian Schaefer, Goetz Lindenmaier
+*
+* iropt --- optimizations intertwined with IR construction.
*/
/* $Id$ */
} /* compute node */
-
+#if 0
/* returns 1 if the a and b are pointers to different locations. */
-bool
+static bool
different_identity (ir_node *a, ir_node *b)
{
assert (get_irn_mode (a) == mode_P
}
return 0;
}
-
+#endif
/* equivalent_node returns a node equivalent to N. It skips all nodes that
perform no actual computation, as, e.g., the Id nodes. It does not create
Remaining Phi nodes are just Ids. */
if ((get_Block_n_cfgpreds(n) == 1) &&
(get_irn_op(get_Block_cfgpred(n, 0)) == op_Jmp) &&
- (get_opt_control_flow())) {
+ (get_opt_control_flow_straightening())) {
n = get_nodes_Block(get_Block_cfgpred(n, 0)); DBG_OPT_STG;
} else if ((get_Block_n_cfgpreds(n) == 2) &&
- (get_opt_control_flow())) {
+ (get_opt_control_flow_weak_simplification())) {
/* Test whether Cond jumps twice to this block
@@@ we could do this also with two loops finding two preds from several ones. */
a = get_Block_cfgpred(n, 0);
case iro_Minus: /* --x == x */ /* ??? Is this possible or can --x raise an
out of bounds exception if min =! max? */
if (get_irn_op(get_unop_op(n)) == get_irn_op(n)) {
- n = get_unop_op(get_unop_op(n)); DBG_OPT_ALGSIM2
+ n = get_unop_op(get_unop_op(n)); DBG_OPT_ALGSIM2;
}
break;
case iro_Mul:
/* Mul is commutative and has again an other neutral element. */
if (tarval_classify (computed_value (a)) == 1) {
- n = b; DBG_OPT_ALGSIM1
+ n = b; DBG_OPT_ALGSIM1;
} else if (tarval_classify (computed_value (b)) == 1) {
- n = a; DBG_OPT_ALGSIM1
+ n = a; DBG_OPT_ALGSIM1;
}
break;
case iro_Div:
It can only be called if it is guaranteed that no other nodes
reference this one, i.e., right after construction of a node. */
ir_node *
-optimize (ir_node *n)
+optimize_node (ir_node *n)
{
tarval *tv;
ir_node *old_n = n;