1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
4 * Authors: Christian Schaefer
6 * irflag --- optimization flags
15 * This function enables/disables optimizations globally.
17 * If optimize == 0 no optimizations are performed at all.
18 * Default: optimize == 1.
20 void set_optimize (int value);
21 /** Returns global optimization setting */
22 int get_optimize (void);
24 /** Enables/Disables constant folding optimization.
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.
34 void set_opt_constant_folding (int value);
35 /** Returns constant folding optimization setting. */
36 int get_opt_constant_folding (void);
38 /** Enables/Disables constant subexpression elimination.
40 * If opt_cse == 1 perform constant subexpression elimination.
41 * Default: opt_cse == 1.
43 void set_opt_cse (int value);
44 /** Returns constant subexpression elimination setting. */
45 int get_opt_cse (void);
47 /** Enables/Disables global constant subexpression elimination.
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.
55 void set_opt_global_cse (int value);
56 /** Returns global constant subexpression elimination setting. */
57 int get_opt_global_cse (void);
59 /** Enables/Disables unreachble code elimination.
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.
65 void set_opt_unreachable_code(int value);
66 /** Returns unreachble code elimination setting. */
67 int get_opt_unreachable_code(void);
69 /** Enables/Disables control flow optimizations.
71 * Performs Straightening, if simplifications and loop simplifications.
72 * Sets all separate control flow flags (control_flow_straightening,
73 * weak_simplification and strong_simplification).
75 void set_opt_control_flow(int value);
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);
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);
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);
92 /** Enables/Disables reassociation.
94 * If opt_reassociation == 1 reassociation is performed.
95 * Default: opt_reassociation == 1.
97 void set_opt_reassociation(int value);
98 /** Returns reassociation setting. */
99 int get_opt_reassociation(void);
101 /** Enables/Disables dead node elimination.
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);
110 /** Enable/Disables inlining.
112 * If opt_inline == 1 the inlining transformation is performed.
114 void set_opt_inline (int value);
115 /** Returns inlining setting. */
116 int get_opt_inline (void);