Implemented cf optimizations.
[libfirm] / ir / ir / irflag.c
index af5fb4f..18619b2 100644 (file)
@@ -6,6 +6,8 @@
 ** irflag --- optimization flags
 */
 
+/* $Id$ */
+
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
 
 /* 0 - don't do this optimization
    1 - lets see, if there is a better graph */
-int opt_cse = 0;                    /* Hash the nodes */
-int opt_constant_folding = 0;       /* Evaluate operations */
-int opt_unreachable_code = 0;       /* Bad node propagation */
-int opt_dead_node_elimination = 0;  /* Reclaim memory */
-int optimized = 0;
-int opt_inline = 0;
+int optimized = 1;                  /* Turn off all optimizations */
+
+int opt_cse = 1;                    /* Hash the nodes */
+int opt_global_cse = 0;             /* Don't use block predecessor for comparison */
+/* @@@ 0 solage code placement fehlt */
+int opt_constant_folding = 1;       /* Evaluate operations */
+int opt_unreachable_code = 1;       /* Bad node propagation */
+int opt_control_flow = 1;           /* control flow optimizations. */
+int opt_dead_node_elimination = 1;  /* Reclaim memory */
+int opt_reassociation = 1;          /* Reassociate nodes */
+int opt_inline = 1;                 /* Do inlining transformation */
 
 /* set the flags with set_flagname, get the flag with get_flagname */
-
 inline void
 set_opt_cse (int value)
 {
@@ -34,6 +40,16 @@ get_opt_cse (void)
   return opt_cse;
 }
 
+void set_opt_global_cse (int value)
+{
+  opt_global_cse = value;
+}
+
+int  get_opt_global_cse (void)
+{
+  return opt_global_cse;
+}
+
 inline void
 set_opt_constant_folding (int value)
 {
@@ -58,6 +74,25 @@ get_opt_unreachable_code(void)
   return opt_unreachable_code;
 }
 
+inline void set_opt_control_flow(int value) {
+  opt_control_flow = value;
+}
+
+inline int  get_opt_control_flow(void) {
+  return opt_control_flow;
+}
+
+inline void
+set_opt_reassociation(int value)
+{
+  opt_reassociation = value;
+}
+
+inline int
+get_opt_reassociation(void)
+{
+  return opt_reassociation;
+}
 
 inline void
 set_opt_dead_node_elimination (int value)