1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
10 * @author Christian Schaefer
19 * This function enables/disables optimizations globally.
21 * If optimize == 0 no optimizations are performed at all.
22 * Default: optimize == 1.
24 void set_optimize (int value);
25 /** Returns global optimization setting */
26 int get_optimize (void);
28 /** Enables/Disables constant folding optimization.
30 * If opt_constant_folding == 1 perform
31 * - constant expression evaluation (2 + 5 ==> 7, 3 < 2 ==> false)
32 * - algebraic simplification (a * 0 ==> 0, a or a ==> a)
33 * - simplification of tests ( !(a < b) ==> (a >= b))
34 * - refining the memory representation
35 * - remove store after load
36 * Default: opt_constant_folding == 1.
38 void set_opt_constant_folding (int value);
39 /** Returns constant folding optimization setting. */
40 int get_opt_constant_folding (void);
42 /** Enables/Disables constant subexpression elimination.
44 * If opt_cse == 1 perform constant subexpression elimination.
45 * Default: opt_cse == 1.
47 void set_opt_cse (int value);
48 /** Returns constant subexpression elimination setting. */
49 int get_opt_cse (void);
51 /** Enables/Disables global constant subexpression elimination.
53 * If opt_global_cse == 1 and opt_cse == 1 perform intra procedure
54 * constant subexpression elimination for floating nodes. Intra
55 * procedure cse gets the graph into state "floating". It is necessary
56 * to run pre/code motion to get the graph back into state "pinned".
57 * right after a call to local_optimize with global cse turned on.
58 * Default: opt_global_cse == 0.
60 void set_opt_global_cse (int value);
61 /** Returns global constant subexpression elimination setting. */
62 int get_opt_global_cse (void);
64 /** Enables/Disables unreachble code elimination.
66 * If opt_unreachable_code == 1 replace nodes (except Block,
67 * Phi and Tuple) with a Bad predecessor by the Bad node.
68 * Default: opt_unreachable_code == 1.
70 void set_opt_unreachable_code(int value);
71 /** Returns unreachble code elimination setting. */
72 int get_opt_unreachable_code(void);
74 /** Enables/Disables control flow optimizations.
76 * Performs Straightening, if simplifications and loop simplifications.
77 * Sets all separate control flow flags (control_flow_straightening,
78 * weak_simplification, strong_simplification and critical_edges).
80 void set_opt_control_flow(int value);
82 /** Enables/Disables Straightening. */
83 void set_opt_control_flow_straightening(int value);
84 /** Returns Straightening setting. */
85 int get_opt_control_flow_straightening(void);
87 /** Enables/Disables if simplifications in local optimizations. */
88 void set_opt_control_flow_weak_simplification(int value);
89 /** Returns if simplifications in local optimizations setting. */
90 int get_opt_control_flow_weak_simplification(void);
92 /** Enables/Disables strong if and loop simplification (in optimize_cf). */
93 void set_opt_control_flow_strong_simplification(int value);
94 /** Returns strong if and loop simplification setting */
95 int get_opt_control_flow_strong_simplification(void);
97 /** Enables/Disables removal of critical control flow edges. */
98 void set_opt_critical_edges(int value);
99 /** Returns whether critical edges are removed */
100 int get_opt_critical_edges(void);
102 /** Enables/Disables reassociation.
104 * If opt_reassociation == 1 reassociation is performed.
105 * Default: opt_reassociation == 1.
107 void set_opt_reassociation(int value);
108 /** Returns reassociation setting. */
109 int get_opt_reassociation(void);
111 /** Enables/Disables dead node elimination.
113 * If opt_dead_node_elimination == 1 deallocate all dead nodes
114 * by copying the firm graph.
115 * Default: opt_dead_node_elimination == 1. */
116 void set_opt_dead_node_elimination (int value);
117 /** Returns dead node elimination setting. */
118 int get_opt_dead_node_elimination (void);
120 /** Enable/Disables inlining.
122 * If opt_inline == 1 the inlining transformation is performed.
124 void set_opt_inline (int value);
125 /** Returns inlining setting. */
126 int get_opt_inline (void);
128 /** Enable/Disable optimization of dynamic method dispatch
130 * This flag enables/disables the optimization of dynamic method dispatch.
131 * If the flag is turned on Sel nodes can be replaced by Const nodes representing
132 * the address of a function.
134 void set_opt_dyn_meth_dispatch (int value);
135 int get_opt_dyn_meth_dispatch (void);
137 /** Enable/Disable normalizations of the firm representation.
139 * This flag guards transformations that normalize the firm representation
140 * as removing Ids and Tuples, useless Phis, replacing SymConst(id) by
141 * Const(entity) and others.
142 * The transformations guarded by this flag are not guarded by flag
144 * Many algorithms operating on firm can not deal with constructs in
145 * the non-normalized representation.
147 * @@@ ATTENTION: not all such transformations are guarded by a flag.
149 void set_opt_normalize (int value);
150 int get_opt_normalize (void);