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 * Default: opt_global_cse == 1.
59 void set_opt_global_cse (int value);
60 /** Returns global constant subexpression elimination setting. */
61 int get_opt_global_cse (void);
63 /** Enables/Disables unreachble code elimination.
65 * If opt_unreachable_code == 1 replace nodes (except Block,
66 * Phi and Tuple) with a Bad predecessor by the Bad node.
67 * Default: opt_unreachable_code == 1.
69 void set_opt_unreachable_code(int value);
70 /** Returns unreachble code elimination setting. */
71 int get_opt_unreachable_code(void);
73 /** Enables/Disables control flow optimizations.
75 * Performs Straightening, if simplifications and loop simplifications.
76 * Sets all separate control flow flags (control_flow_straightening,
77 * weak_simplification and strong_simplification).
79 void set_opt_control_flow(int value);
81 /** Enables/Disables Straightening. */
82 void set_opt_control_flow_straightening(int value);
83 /** Returns Straightening setting. */
84 int get_opt_control_flow_straightening(void);
86 /** Enables/Disables if simplifications in local optimizations. */
87 void set_opt_control_flow_weak_simplification(int value);
88 /** Returns if simplifications in local optimizations setting. */
89 int get_opt_control_flow_weak_simplification(void);
91 /** Enables/Disables strong if and loop simplification (in optimize_cf). */
92 void set_opt_control_flow_strong_simplification(int value);
93 /** Returns strong if and loop simplification setting */
94 int get_opt_control_flow_strong_simplification(void);
96 /** Enables/Disables reassociation.
98 * If opt_reassociation == 1 reassociation is performed.
99 * Default: opt_reassociation == 1.
101 void set_opt_reassociation(int value);
102 /** Returns reassociation setting. */
103 int get_opt_reassociation(void);
105 /** Enables/Disables dead node elimination.
107 * If opt_dead_node_elimination == 1 deallocate all dead nodes
108 * by copying the firm graph.
109 * Default: opt_dead_node_elimination == 1. */
110 void set_opt_dead_node_elimination (int value);
111 /** Returns dead node elimination setting. */
112 int get_opt_dead_node_elimination (void);
114 /** Enable/Disables inlining.
116 * If opt_inline == 1 the inlining transformation is performed.
118 void set_opt_inline (int value);
119 /** Returns inlining setting. */
120 int get_opt_inline (void);