X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fopt_osr.c;h=79cd9a31aa0e87da1e0e06e654cfdafb0753835a;hb=6b124543aff56817fcfe6d5b5ff181ac5c790e73;hp=8569b9943d9e3d46cd39397eee2f583c3279ea15;hpb=4b363c6a4e0584ce755b5f82fc3d7a9dc38658b2;p=libfirm diff --git a/ir/opt/opt_osr.c b/ir/opt/opt_osr.c index 8569b9943..79cd9a31a 100644 --- a/ir/opt/opt_osr.c +++ b/ir/opt/opt_osr.c @@ -23,7 +23,7 @@ * @date 12.5.2006 * @author Michael Beck * @version $Id$ - * @summary + * @brief * Implementation of the Operator Strength Reduction algorithm * by Keith D. Cooper, L. Taylor Simpson, Christopher A. Vick. * Extended version. @@ -175,8 +175,7 @@ static node_entry *get_irn_ne(ir_node *irn, iv_env *env) { node_entry *e = get_irn_link(irn); if (e == NULL) { - e = obstack_alloc(&env->obst, sizeof(*e)); - memset(e, 0, sizeof(*e)); + e = OALLOCZ(&env->obst, node_entry); set_irn_link(irn, e); } return e; @@ -480,8 +479,7 @@ static int replace(ir_node *irn, ir_node *iv, ir_node *rc, iv_env *env) { exchange(irn, result); e = get_irn_ne(result, env); if (e->pscc == NULL) { - e->pscc = obstack_alloc(&env->obst, sizeof(*e->pscc)); - memset(e->pscc, 0, sizeof(*e->pscc)); + e->pscc = OALLOCZ(&env->obst, scc); update_scc(result, e, env); } ++env->replaced; @@ -997,10 +995,9 @@ static void dfs(ir_node *irn, iv_env *env) { node->low = MIN(o->DFSnum, node->low); } if (node->low == node->DFSnum) { - scc *pscc = obstack_alloc(&env->obst, sizeof(*pscc)); + scc *pscc = OALLOCZ(&env->obst, scc); ir_node *x; - memset(pscc, 0, sizeof(*pscc)); do { node_entry *e; @@ -1291,8 +1288,8 @@ void remove_phi_cycles(ir_graph *irg) { env.process_scc = process_phi_only_scc; /* Clear all links and move Proj nodes into the - the same block as it's predecessors. - This can improve the placement of new nodes. + * the same block as their predecessors. + * This can improve the placement of new nodes. */ projs_moved = 0; irg_walk_graph(irg, NULL, clear_and_fix, &projs_moved); @@ -1387,12 +1384,6 @@ void opt_osr(ir_graph *irg, unsigned flags) { int edges; int projs_moved; - if (! get_opt_strength_red()) { - /* only kill Phi cycles */ - remove_phi_cycles(irg); - return; - } - rem = current_ir_graph; current_ir_graph = irg;