Added FuncCall op
[libfirm] / ir / ir / irflag.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/ir/irflag.h
4  * Purpose:     Flags to control optimizations.
5  * Author:      Christian Schaefer, Goetz Lindenmaier
6  * Modified by:
7  * Created:
8  * CVS-ID:      $Id$
9  * Copyright:   (c) 1999-2003 Universität Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12
13 /**
14  * @file irflag.h
15  *
16  * Optimization flags.
17  *
18  * @author Christian Schaefer
19  */
20
21 #ifndef _IRFLAG_H_
22 #define _IRFLAG_H_
23
24 /**
25  * This function enables/disables optimizations globally.
26  *
27  * If optimize == 0 no optimizations are performed at all.
28  * Default: optimize == 1.
29  */
30 void set_optimize (int value);
31 /** Returns global optimization setting */
32 int  get_optimize (void);
33
34 /** Enables/Disables constant folding optimization.
35  *
36  *  If opt_constant_folding == 1 perform
37  *  - constant expression evaluation (2 + 5 ==> 7, 3 < 2 ==> false)
38  *  - algebraic simplification  (a * 0 ==> 0, a or a ==> a)
39  *  - simplification of tests   ( !(a < b) ==> (a >= b))
40  *  - refining the memory representation
41  *  - remove store after load
42  * Default: opt_constant_folding == 1.
43  */
44 void set_opt_constant_folding (int value);
45 /** Returns constant folding optimization setting. */
46 int  get_opt_constant_folding (void);
47
48 /** Enables/Disables constant subexpression elimination.
49  *
50  * If opt_cse == 1 perform constant subexpression elimination.
51  * Default: opt_cse == 1.
52  */
53 void set_opt_cse (int value);
54 /** Returns constant subexpression elimination setting. */
55 int  get_opt_cse (void);
56
57 /** Enables/Disables global constant subexpression elimination.
58  *
59  * If opt_global_cse == 1 and opt_cse == 1 perform intra procedure
60  * constant subexpression elimination for floating nodes.  Intra
61  * procedure cse gets the graph into state "floating".  It is necessary
62  * to run pre/code motion to get the graph back into state "pinned".
63  * right after a call to local_optimize with global cse turned on.
64  * Default: opt_global_cse == 0.
65  */
66 void set_opt_global_cse (int value);
67 /** Returns global constant subexpression elimination setting. */
68 int  get_opt_global_cse (void);
69
70 /** Enables/Disables unreachble code elimination.
71  *
72  * If opt_unreachable_code == 1 replace nodes (except Block,
73  * Phi and Tuple) with a Bad predecessor by the Bad node.
74  * Default: opt_unreachable_code == 1.
75  */
76 void set_opt_unreachable_code(int value);
77 /** Returns unreachble code elimination setting. */
78 int  get_opt_unreachable_code(void);
79
80 /** Enables/Disables control flow optimizations.
81  *
82  * Performs Straightening, if simplifications and loop simplifications.
83  * Sets all separate control flow flags (control_flow_straightening,
84  * weak_simplification, strong_simplification and critical_edges).
85  */
86 void set_opt_control_flow(int value);
87
88 /** Enables/Disables Straightening. */
89 void set_opt_control_flow_straightening(int value);
90 /** Returns Straightening setting. */
91 int  get_opt_control_flow_straightening(void);
92
93 /** Enables/Disables if simplifications in local optimizations. */
94 void set_opt_control_flow_weak_simplification(int value);
95 /** Returns if simplifications in local optimizations setting. */
96 int  get_opt_control_flow_weak_simplification(void);
97
98 /** Enables/Disables strong if and loop simplification (in optimize_cf). */
99 void set_opt_control_flow_strong_simplification(int value);
100 /** Returns strong if and loop simplification setting */
101 int  get_opt_control_flow_strong_simplification(void);
102
103 /** Enables/Disables removal of critical control flow edges. */
104 void set_opt_critical_edges(int value);
105 /** Returns whether critical edges are removed */
106 int  get_opt_critical_edges(void);
107
108 /** Enables/Disables reassociation.
109  *
110  * If opt_reassociation == 1 reassociation is performed.
111  * Default: opt_reassociation == 1.
112  */
113 void set_opt_reassociation(int value);
114 /** Returns reassociation setting. */
115 int  get_opt_reassociation(void);
116
117 /** Enables/Disables dead node elimination.
118  *
119  * If opt_dead_node_elimination == 1 deallocate all dead nodes
120  * by copying the firm graph.
121  * Default: opt_dead_node_elimination == 1. */
122 void set_opt_dead_node_elimination (int value);
123 /** Returns dead node elimination setting. */
124 int  get_opt_dead_node_elimination (void);
125
126 /** Enable/Disables inlining.
127  *
128  * If opt_inline == 1 the inlining transformation is performed.
129  */
130 void set_opt_inline (int value);
131 /** Returns inlining setting. */
132 int  get_opt_inline (void);
133
134 /** Enable/Disable optimization of dynamic method dispatch
135  *
136  * This flag enables/disables the optimization of dynamic method dispatch.
137  * If the flag is turned on Sel nodes can be replaced by Const nodes representing
138  * the address of a function.
139  */
140 void set_opt_dyn_meth_dispatch (int value);
141 int  get_opt_dyn_meth_dispatch (void);
142
143 /** Enable/Disable normalizations of the firm representation.
144  *
145  *  This flag guards transformations that normalize the firm representation
146  *  as removing Ids and Tuples, useless Phis, replacing SymConst(id) by
147  *  Const(entity) and others.
148  *  The transformations guarded by this flag are not guarded by flag
149  *  "optimize".
150  *  Many algorithms operating on firm can not deal with constructs in
151  *  the non-normalized representation.
152  *  default: 1
153  *  @@@ ATTENTION: not all such transformations are guarded by a flag.
154  */
155 void set_opt_normalize (int value);
156 int  get_opt_normalize (void);
157
158
159 #endif