X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Freassoc.c;h=c27125e76d00b85198ddc37311a57dd886b6ff45;hb=eb7ac83b870791219e7a50cc262f2f1ee9c01b39;hp=ca67034d85e3002551617102f62abe039f0204d6;hpb=ce6161a7e42a48f7422b7babcc64d8ace18e2687;p=libfirm diff --git a/ir/opt/reassoc.c b/ir/opt/reassoc.c index ca67034d8..c27125e76 100644 --- a/ir/opt/reassoc.c +++ b/ir/opt/reassoc.c @@ -597,14 +597,6 @@ static void wq_walker(ir_node *n, void *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); } @@ -616,21 +608,12 @@ static void wq_walker(ir_node *n, void *env) static void do_reassociation(walker_t *wenv) { int i, res, changed; - ir_node *n, *blk; + ir_node *n; while (! waitq_empty(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); /* reassociation must run until a fixpoint is reached. */ @@ -958,7 +941,7 @@ int optimize_reassociation(ir_graph *irg) /* * Calculate loop info, so we could identify loop-invariant - * code and threat it like a constant. + * code and treat it like a constant. * We only need control flow loops here but can handle generic * INTRA info as well. */ @@ -983,12 +966,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 +981,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 @@ -1017,7 +994,7 @@ ir_op_ops *firm_set_default_reassoc(ir_opcode code, ir_op_ops *ops) CASE(Eor); CASE(Shl); default: - /* leave NULL */; + break; } return ops;