implemented loop unrolling optimization
[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;
36   ir_node *increment, *init, *op, *itervar_phi, *c, *new_phi, *new_increment, *new_init;
37   ir_node *new_op, *new_add, *reducible_node;
38   ir_node *old_ind, *symconst, *new_cmp, *cmp_const, *cmp_init_block, *cmp;
39   int      be_pos, strong_reduced;
40   int      init_pred_pos, op_pred_pos, out_loop_res, phi_pred, reducible;
41   ir_loop *l_itervar_phi;
42 }induct_var_info;
43 #endif
44
45 /** If an ir_node is induction variable return info else return NULL. */
46 induct_var_info *is_induction_variable ( induct_var_info *info);
47
48 #endif /* _STRENGTH_RED_H_ */