X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Freassoc.c;h=db538d12cd55acff60da78a01345966feb47fd0e;hb=b27ae245166bb695bc4e418ff416d91bc37d0f28;hp=267e24c8f7f81c704ec2b4433f0985c430fc816a;hpb=5dbb8aeef07706701e796467d82ce31f730470e2;p=libfirm diff --git a/ir/opt/reassoc.c b/ir/opt/reassoc.c index 267e24c8f..db538d12c 100644 --- a/ir/opt/reassoc.c +++ b/ir/opt/reassoc.c @@ -556,12 +556,12 @@ static int reassoc_Mul(ir_node **node) */ static int reassoc_Shl(ir_node **node) { - ir_node *n = *node; - ir_node *c = get_Shl_right(n); - ir_node *x, *blk, *irn; - ir_graph *irg; - ir_mode *mode; - tarval *tv; + ir_node *n = *node; + ir_node *c = get_Shl_right(n); + ir_node *x, *blk, *irn; + ir_graph *irg; + ir_mode *mode; + ir_tarval *tv; if (! is_Const(c)) return 0; @@ -593,18 +593,10 @@ static int reassoc_Shl(ir_node **node) */ static void wq_walker(ir_node *n, void *env) { - walker_t *wenv = env; + walker_t *wenv = (walker_t*)env; set_irn_link(n, NULL); if (!is_Block(n)) { - ir_node *blk = get_nodes_block(n); - - if (is_Block_dead(blk) || get_Block_dom_depth(blk) < 0) { - /* We are in a dead block, do not optimize or we may fall into an endless - loop. We check this here instead of requiring that all dead blocks are removed - which or cf_opt do not guarantee yet. */ - return; - } waitq_put(wenv->wq, n); set_irn_link(n, wenv->wq); } @@ -619,17 +611,10 @@ static void do_reassociation(walker_t *wenv) ir_node *n, *blk; while (! waitq_empty(wenv->wq)) { - n = waitq_get(wenv->wq); + n = (ir_node*)waitq_get(wenv->wq); set_irn_link(n, NULL); blk = get_nodes_block(n); - if (is_Block_dead(blk) || get_Block_dom_depth(blk) < 0) { - /* We are in a dead block, do not optimize or we may fall into an endless - loop. We check this here instead of requiring that all dead blocks are removed - which or cf_opt do not guarantee yet. */ - continue; - } - hook_reassociate(1); @@ -913,9 +898,9 @@ transform: */ static void reverse_rules(ir_node *node, void *env) { - walker_t *wenv = env; - ir_mode *mode = get_irn_mode(node); - ir_graph *irg = get_irn_irg(node); + walker_t *wenv = (walker_t*)env; + ir_graph *irg = get_irn_irg(node); + ir_mode *mode = get_irn_mode(node); int res; /* for FP these optimizations are only allowed if fp_strict_algebraic is disabled */ @@ -983,12 +968,6 @@ int optimize_reassociation(ir_graph *irg) } set_reassoc_running(0); - /* Handle graph state */ - if (env.changes) { - set_irg_outs_inconsistent(irg); - set_irg_loopinfo_inconsistent(irg); - } - #ifdef NEW_REASSOC obstack_free(&commutative_args, NULL); #endif @@ -1004,7 +983,7 @@ ir_graph_pass_t *optimize_reassociation_pass(const char *name) } /* optimize_reassociation_pass */ /* Sets the default reassociation operation for an ir_op_ops. */ -ir_op_ops *firm_set_default_reassoc(ir_opcode code, ir_op_ops *ops) +ir_op_ops *firm_set_default_reassoc(unsigned code, ir_op_ops *ops) { #define CASE(a) case iro_##a: ops->reassociate = reassoc_##a; break