X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=ir%2Fopt%2Fopt_osr.c;h=27d34e95d57244985e5546f6f5fb318010d5fdd6;hb=75921a0e9db46ba1c32889bd830900aac298691d;hp=a9f6c42767ccd7444b2d09a7976723b4cf55ea4b;hpb=eb08138c6b80c169945568e4414f491a9bc20388;p=libfirm diff --git a/ir/opt/opt_osr.c b/ir/opt/opt_osr.c index a9f6c4276..27d34e95d 100644 --- a/ir/opt/opt_osr.c +++ b/ir/opt/opt_osr.c @@ -18,21 +18,20 @@ */ /** - * Project: libFIRM - * File name: ir/opt/opt_osr.c - * Purpose: Operator Strength Reduction, based on - * Keith D. Cooper, L. Taylor Simpson, Christopher A. Vick - * Author: Michael Beck - * Modified by: - * Created: 12.5.2006 - * CVS-ID: $Id$ - * Copyright: (c) 2006 Universität Karlsruhe + * @file + * @brief Operator Strength Reduction. + * @date 12.5.2006 + * @author Michael Beck + * @version $Id$ + * @summary + * Implementation of the Operator Strength Reduction algorithm + * by Keith D. Cooper, L. Taylor Simpson, Christopher A. Vick. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "opt_osr.h" +#include "iroptimize.h" #include "irgraph.h" #include "ircons.h" #include "irop_t.h" @@ -118,6 +117,7 @@ static ir_node *reduce(ir_node *orig, ir_node *iv, ir_node *rc, iv_env *env); static int LFTR_cmp(const void *e1, const void *e2, size_t size) { const LFTR_edge *l1 = e1; const LFTR_edge *l2 = e2; + (void) size; return l1->src != l2->src; } @@ -199,6 +199,7 @@ static int is_rc(ir_node *irn, ir_node *header_block) { static int quad_cmp(const void *e1, const void *e2, size_t size) { const quadruple_t *c1 = e1; const quadruple_t *c2 = e2; + (void) size; return c1->code != c2->code || c1->op1 != c2->op1 || c1->op2 != c2->op2; } @@ -354,8 +355,8 @@ static ir_node *reduce(ir_node *orig, ir_node *iv, ir_node *rc, iv_env *env) { result = exact_copy(iv); - /* Beware: we must always create a new nduction variable with the same mode - as the node we are replacing. Espicially this means the mode might be changed + /* Beware: we must always create a new induction variable with the same mode + as the node we are replacing. Especially this means the mode might be changed from P to I and back. This is always possible, because we have only Phi, Add and Sub nodes. */ set_irn_mode(result, mode); @@ -1016,11 +1017,12 @@ static void lftr(ir_graph *irg, iv_env *env) { */ static void clear_and_fix(ir_node *irn, void *env) { + (void) env; set_irn_link(irn, NULL); if (is_Proj(irn)) { ir_node *pred = get_Proj_pred(irn); - set_irn_n(irn, -1, get_irn_n(pred, -1)); + set_nodes_block(irn, get_nodes_block(pred)); } }