forgto to add that
[libfirm] / ir / opt / strength_red_t.h
1 /*
2  * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  *
22  * @file strength_red.h
23  *
24  * Project:     libFIRM
25  * File name:   ir/opt/strenth_red.h
26  * Purpose:     Strength reduction.
27  * Author:      Beyhan Veliev
28  * Modified by:
29  * Created:     22.8.2004
30  * CVS-ID:      $Id: strength_red.h 13510 2007-04-27 09:22:22Z chriswue $
31  * Copyright:   (c) 2004 Universität Karlsruhe
32  */
33 #ifndef STRENGTH_RED_T_H
34 #define STRENGTH_RED_T_H
35
36 #include "irnode.h"
37 #include "irgraph.h"
38 #include "irloop.h"
39
40 /* The information needed for an induction variable */
41 typedef struct _induct_var_info {
42   ir_op   *operation_code;  /**< The opcode of "op" */
43   ir_node *increment;       /**< The value which increase or decrease the iteration variable. */
44   ir_node *init;            /**< The start value of the iteration variable. */
45   ir_node *op;              /**< The operation which increase or decrease the iteration variable. */
46   ir_node *itervar_phi;     /**< The iteration variable. */
47   ir_node *new_phi;         /**< The new iteration variable. */
48   ir_node *new_increment;   /**< The new increment which replace the old one. */
49   ir_node *new_init;        /**< The new init value of the iteration variable. */
50   ir_node *new_op;          /**< The new operation that we need after replace. */
51   ir_node *new_cmp;         /**< The new Cmp which replaces the old one. */
52   ir_node *cmp;             /**< The Cmp which breaks the loop and compares the iteration variable with a constant. */
53   ir_node *cmp_const;       /**< The other operand of Cmp. */
54   ir_node *cmp_init_block;  /**< The initial block of the Cmp. */
55   ir_node *reducible_node;  /**< The reducible nodes are save here. */
56   int     is_reducible;     /**< To save information if anything is reducible. */
57   int     phi_pred;         /**< To save the value of iteration variable predecessors. */
58   int     init_pred_pos;    /**< To save the position of iteration variable start value. */
59   int     op_pred_pos;      /**< To save the backedge of iteration variable. */
60   ir_loop *l_itervar_phi;   /**< The loop of the induction variable */
61 } induct_var_info;
62
63 /** If an ir_node is an induction variable return info else return NULL. */
64 induct_var_info *is_induction_variable(induct_var_info *info);
65
66 #endif