/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer
-**
-** irflag --- optimization flags
+* All rights reserved.
+*
+* Authors: Christian Schaefer
+*
+* irflag --- optimization flags
*/
+/* $Id$ */
+
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
+#include "irflag.h"
+#include "firm_common.h"
+
/* 0 - don't do this optimization
1 - lets see, if there is a better graph */
+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_straightening = 1; /* */
+int opt_control_flow_weak_simplification = 1; /* */
+int opt_control_flow_strong_simplification = 1; /* */
int opt_dead_node_elimination = 1; /* Reclaim memory */
-int optimized = 1;
-int opt_inline = 1;
+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
+INLINE void
set_opt_cse (int value)
{
opt_cse = value;
}
-inline int
+INLINE int
get_opt_cse (void)
{
return opt_cse;
}
-inline void
+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)
{
opt_constant_folding=value;
}
-inline int
+INLINE int
get_opt_constant_folding (void)
{
return opt_constant_folding;
}
-inline void
+INLINE void
set_opt_unreachable_code(int value)
{
opt_unreachable_code = value;
}
-inline int
+INLINE int
get_opt_unreachable_code(void)
{
return opt_unreachable_code;
}
+INLINE void set_opt_control_flow(int value) {
+ set_opt_control_flow_straightening(value);
+ set_opt_control_flow_weak_simplification(value);
+ set_opt_control_flow_strong_simplification(value);
+}
+
+/* Performs Straightening */
+void set_opt_control_flow_straightening(int value) {
+ opt_control_flow_straightening = value;
+}
+int get_opt_control_flow_straightening(void) {
+ return opt_control_flow_straightening;
+}
+/* Performs if simplifications in local optimizations. */
+void set_opt_control_flow_weak_simplification(int value) {
+ opt_control_flow_weak_simplification = value;
+}
+int get_opt_control_flow_weak_simplification(void) {
+ return opt_control_flow_weak_simplification;
+}
+/* Performs strong if and loop simplification (in optimize_cf). */
+void set_opt_control_flow_strong_simplification(int value) {
+ opt_control_flow_strong_simplification = value;
+}
+int get_opt_control_flow_strong_simplification(void) {
+ return opt_control_flow_strong_simplification;
+}
+
+
+INLINE void
+set_opt_reassociation(int value)
+{
+ opt_reassociation = value;
+}
+
+INLINE int
+get_opt_reassociation(void)
+{
+ return opt_reassociation;
+}
-inline void
+INLINE void
set_opt_dead_node_elimination (int value)
{
opt_dead_node_elimination = value;
}
-inline int
+INLINE int
get_opt_dead_node_elimination (void)
{
return opt_dead_node_elimination;
}
-inline void
+INLINE void
set_optimize (int value)
{
optimized = value;
}
-inline int
+INLINE int
get_optimize (void)
{
return optimized;
}
-void set_opt_inline (int value) {
+INLINE void set_opt_inline (int value) {
opt_inline = value;
}
-int get_opt_inline (void) {
+INLINE int get_opt_inline (void) {
return opt_inline;
}