2bdd3198ff636e6af1e2da6723b0430499b7bc4b
[libfirm] / ir / ir / irflag.c
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 #ifdef HAVE_CONFIG_H
12 # include <config.h>
13 #endif
14
15
16 /* 0 - don't do this optimization
17    1 - lets see, if there is a better graph */
18 int optimized = 1;                  /* Turn off all optimizations */
19
20 int opt_cse = 1;                    /* Hash the nodes */
21 int opt_global_cse = 0;             /* Don't use block predecessor for comparison */
22 /* @@@ 0 solage code placement fehlt */
23 int opt_constant_folding = 1;       /* Evaluate operations */
24 int opt_unreachable_code = 1;       /* Bad node propagation */
25 int opt_dead_node_elimination = 1;  /* Reclaim memory */
26 int opt_reassociation = 1;          /* Reassociate nodes */
27 int opt_inline = 1;                 /* Do inlining transformation */
28
29 /* set the flags with set_flagname, get the flag with get_flagname */
30 inline void
31 set_opt_cse (int value)
32 {
33   opt_cse = value;
34 }
35
36 inline int
37 get_opt_cse (void)
38 {
39   return opt_cse;
40 }
41
42 void set_opt_global_cse (int value)
43 {
44   opt_global_cse = value;
45 }
46
47 int  get_opt_global_cse (void)
48 {
49   return opt_global_cse;
50 }
51
52 inline void
53 set_opt_constant_folding (int value)
54 {
55   opt_constant_folding=value;
56 }
57
58 inline int
59 get_opt_constant_folding (void)
60 {
61   return opt_constant_folding;
62 }
63
64 inline void
65 set_opt_unreachable_code(int value)
66 {
67   opt_unreachable_code = value;
68 }
69
70 inline int
71 get_opt_unreachable_code(void)
72 {
73   return opt_unreachable_code;
74 }
75
76 inline void
77 set_opt_reassociation(int value)
78 {
79   opt_reassociation = value;
80 }
81
82 inline int
83 get_opt_reassociation(void)
84 {
85   return opt_reassociation;
86 }
87
88 inline void
89 set_opt_dead_node_elimination (int value)
90 {
91   opt_dead_node_elimination = value;
92 }
93
94 inline int
95 get_opt_dead_node_elimination (void)
96 {
97   return opt_dead_node_elimination;
98 }
99
100 inline void
101 set_optimize (int value)
102 {
103   optimized = value;
104 }
105
106 inline int
107 get_optimize (void)
108 {
109   return optimized;
110 }
111
112
113 void set_opt_inline (int value) {
114   opt_inline = value;
115 }
116
117 int  get_opt_inline (void) {
118   return opt_inline;
119 }