even more warning fixes
[libfirm] / ir / opt / strength_red.h
1 /**
2  *
3  * @file strength_red.h
4  *
5  * Project:     libFIRM
6  * File name:   ir/opt/strenth_red.h
7  * Purpose:     Strength reduction.
8  * Author:      Beyhan Veliev
9  * Modified by:
10  * Created:     22.8.2004
11  * CVS-ID:      $Id$
12  * Copyright:   (c) 2004 Universität Karlsruhe
13  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
14  *
15  *
16  *
17  *
18  */
19
20
21 # ifndef _STRENGTH_RED_H_
22 # define _STRENGTH_RED_H_
23
24 #include "irnode.h"
25 #include "irgraph.h"
26 #include "irloop.h"
27
28 /** Performs strength reduction for the passed graph. */
29 void reduce_strength(ir_graph *irg);
30
31 /* The information needed for an induction variable */
32 # ifndef _STRENGTH_RED_TYP_
33 # define _STRENGTH_RED_TYP_
34 typedef struct _induct_var_info {
35   ir_op   *operation_code;  /**< The opcode of "op" */
36   ir_node *increment;       /**< The value which increase or decrease the iteration variable. */
37   ir_node *init;            /**< The start value of the iteration variable. */
38   ir_node *op;              /**< The operation which increase or decrease the iteration variable. */
39   ir_node *itervar_phi;     /**< The iteration variable. */
40   ir_node *new_phi;         /**< The new iteration variable. */
41   ir_node *new_increment;   /**< The new increment which replace the old one. */
42   ir_node *new_init;        /**< The new init value of the iteration variable. */
43   ir_node *new_op;          /**< The new operation that we need after replace. */
44   ir_node *new_cmp;         /**< The new Cmp which replaces the old one. */
45   ir_node *cmp;             /**< The Cmp which breaks the loop and compares the iteration variable with a constant. */
46   ir_node *cmp_const;       /**< The other operand of Cmp. */
47   ir_node *cmp_init_block;  /**< The initial block of the Cmp. */
48   ir_node *reducible_node;  /**< The reducible nodes are save here. */
49   int     is_reducible;     /**< To save information if anything is reducible. */
50   int     phi_pred;         /**< To save the value of iteration variable predecessors. */
51   int     init_pred_pos;    /**< To save the position of iteration variable start value. */
52   int     op_pred_pos;      /**< To save the backedge of iteration variable. */
53   ir_loop *l_itervar_phi;   /**< The loop of the induction variable */
54 } induct_var_info;
55 #endif
56
57 /** If an ir_node is an induction variable return info else return NULL. */
58 induct_var_info *is_induction_variable(induct_var_info *info);
59
60 #endif /* _STRENGTH_RED_H_ */