Fixed doxygen commnets, converted parameterless functions to (void)
[libfirm] / ir / ir / irflag.h
1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
2 * All rights reserved.
3 *
4 * Authors: Christian Schaefer
5 *
6 * irflag --- optimization flags
7 */
8
9 /* $Id$ */
10
11 #ifndef _IRFLAG_H_
12 #define _IRFLAG_H_
13
14 /**
15  * This function enables/disables optimizations globally.
16  *
17  * If optimize == 0 no optimizations are performed at all.
18  * Default: optimize == 1.
19  */
20 void set_optimize (int value);
21 /** Returns global optimization setting */
22 int  get_optimize (void);
23
24 /** Enables/Disables constant folding optimization.
25  *
26  *  If opt_constant_folding == 1 perform
27  *  - constant expression evaluation (2 + 5 ==> 7, 3 < 2 ==> false)
28  *  - algebraic simplification  (a * 0 ==> 0, a or a ==> a)
29  *  - simplification of tests   ( !(a < b) ==> (a >= b))
30  *  - refining the memory representation
31  *  - remove store after load
32  * Default: opt_constant_folding == 1.
33  */
34 void set_opt_constant_folding (int value);
35 /** Returns constant folding optimization setting. */
36 int  get_opt_constant_folding (void);
37
38 /** Enables/Disables constant subexpression elimination.
39  *
40  * If opt_cse == 1 perform constant subexpression elimination.
41  * Default: opt_cse == 1.
42  */
43 void set_opt_cse (int value);
44 /** Returns constant subexpression elimination setting. */
45 int  get_opt_cse (void);
46
47 /** Enables/Disables global constant subexpression elimination.
48  *
49  * If opt_global_cse == 1 and opt_cse == 1 perform intra procedure
50  * constant subexpression elimination for floating nodes.  Intra
51  * procedure cse gets the graph into state "floating".  It is necessary
52  * to run pre/code motion to get the graph back into state "pinned".
53  * Default: opt_global_cse == 1.
54  */
55 void set_opt_global_cse (int value);
56 /** Returns global constant subexpression elimination setting. */
57 int  get_opt_global_cse (void);
58
59 /** Enables/Disables unreachble code elimination.
60  *
61  * If opt_unreachable_code == 1 replace nodes (except Block,
62  * Phi and Tuple) with a Bad predecessor by the Bad node.
63  * Default: opt_unreachable_code == 1.
64  */
65 void set_opt_unreachable_code(int value);
66 /** Returns unreachble code elimination setting. */
67 int  get_opt_unreachable_code(void);
68
69 /** Enables/Disables control flow optimizations.
70  *
71  * Performs Straightening, if simplifications and loop simplifications.
72  * Sets all separate control flow flags (control_flow_straightening,
73  * weak_simplification and strong_simplification).
74  */
75 void set_opt_control_flow(int value);
76
77 /** Enables/Disables Straightening. */
78 void set_opt_control_flow_straightening(int value);
79 /** Returns Straightening setting. */
80 int  get_opt_control_flow_straightening(void);
81
82 /** Enables/Disables if simplifications in local optimizations. */
83 void set_opt_control_flow_weak_simplification(int value);
84 /** Returns if simplifications in local optimizations setting. */
85 int  get_opt_control_flow_weak_simplification(void);
86
87 /** Enables/Disables strong if and loop simplification (in optimize_cf). */
88 void set_opt_control_flow_strong_simplification(int value);
89 /** Returns strong if and loop simplification setting */
90 int  get_opt_control_flow_strong_simplification(void);
91
92 /** Enables/Disables reassociation.
93  *
94  * If opt_reassociation == 1 reassociation is performed.
95  * Default: opt_reassociation == 1.
96  */
97 void set_opt_reassociation(int value);
98 /** Returns reassociation setting. */
99 int  get_opt_reassociation(void);
100
101 /** Enables/Disables dead node elimination.
102  *
103  * If opt_dead_node_elimination == 1 deallocate all dead nodes
104  * by copying the firm graph.
105  * Default: opt_dead_node_elimination == 1. */
106 void set_opt_dead_node_elimination (int value);
107 /** Returns dead node elimination setting. */
108 int  get_opt_dead_node_elimination (void);
109
110 /** Enable/Disables inlining.
111  *
112  * If opt_inline == 1 the inlining transformation is performed.
113  */
114 void set_opt_inline (int value);
115 /** Returns inlining setting. */
116 int  get_opt_inline (void);
117
118 #endif