ENABLE(OPT_OPTIMIZED) |
ENABLE(OPT_CSE) |
DISABLE(OPT_GLOBAL_CSE) |
+ ENABLE(OPT_STRENGTH_RED) |
ENABLE(OPT_CONSTANT_FOLDING) |
+ ENABLE(OPT_REDUNDANT_LOADSTORE) |
ENABLE(OPT_UNREACHABLE_CODE) |
ENABLE(OPT_CONTROL_FLOW_STRAIGHTENING) |
ENABLE(OPT_CONTROL_FLOW_WEAK_SIMPLIFICATION) |
ENABLE(OPT_CONTROL_FLOW_STRONG_SIMPLIFICATION) |
ENABLE(OPT_CRITICAL_EDGES) |
ENABLE(OPT_DEAD_NODE_ELIMINATION) |
+ ENABLE(OPT_DEAD_METHOD_ELIMINATION) |
ENABLE(OPT_REASSOCIATION) |
ENABLE(OPT_INLINE) |
ENABLE(OPT_DYN_METH_DISPATCH) |
- ENABLE(OPT_NORMALIZE);
+ ENABLE(OPT_NORMALIZE) |
+ ENABLE(OPT_TAIL_RECURSION) |
+ ENABLE(OPT_PRECISE_EXC_CONTEXT) |
+ 0;
/* set the flags with set_flagname, get the flag with get_flagname */
void set_opt_cse (int value)
libFIRM_opt &= ~OPT_GLOBAL_CSE;
}
+void set_opt_strength_red (int value)
+{
+ if (value)
+ libFIRM_opt |= OPT_STRENGTH_RED;
+ else
+ libFIRM_opt &= ~OPT_STRENGTH_RED;
+}
+
void
set_opt_constant_folding(int value)
{
libFIRM_opt &= ~OPT_CONSTANT_FOLDING;
}
+void
+set_opt_redundant_LoadStore(int value) {
+ if (value)
+ libFIRM_opt |= OPT_REDUNDANT_LOADSTORE;
+ else
+ libFIRM_opt &= ~OPT_REDUNDANT_LOADSTORE;
+}
+
void
set_opt_unreachable_code(int value)
{
libFIRM_opt &= ~OPT_DEAD_NODE_ELIMINATION;
}
+void set_opt_dead_method_elimination (int value) {
+ if (value)
+ libFIRM_opt |= OPT_DEAD_METHOD_ELIMINATION;
+ else
+ libFIRM_opt &= ~OPT_DEAD_METHOD_ELIMINATION;
+}
+
+void set_opt_dead_method_elimination_verbose (int value) {
+ if (value)
+ libFIRM_opt |= OPT_DEAD_METHOD_ELIMINATION_VERBOSE;
+ else
+ libFIRM_opt &= ~OPT_DEAD_METHOD_ELIMINATION_VERBOSE;
+}
+
void set_optimize(int value)
{
if (value)
return get_opt_optimize();
}
+/* Enable/Disables inlining. */
void set_opt_inline(int value)
{
if (value)
libFIRM_opt &= ~OPT_INLINE;
}
-/** Enable/Disable optimization of dynamic method dispatch
- *
- * This flag enables/disables the optimization of dynamic method dispatch.
- * If the flag is turned on Sel nodes can be replaced by Const nodes representing
- * the address of a function.
- */
+/* Enable/Disable optimization of dynamic method dispatch */
void set_opt_dyn_meth_dispatch (int value)
{
if (value)
libFIRM_opt &= ~OPT_DYN_METH_DISPATCH;
}
+/* Enable/Disable normalizations of the firm representation. */
void set_opt_normalize(int value)
{
if (value)
libFIRM_opt &= ~OPT_NORMALIZE;
}
+/* Enable/Disable optimization of tail-recursion calls. */
+void set_opt_tail_recursion(int value)
+{
+ if (value)
+ libFIRM_opt |= OPT_TAIL_RECURSION;
+ else
+ libFIRM_opt &= ~OPT_TAIL_RECURSION;
+}
+
+/* Enable/Disable precise exception context. */
+void set_opt_precise_exc_context(int value)
+{
+#if PRECISE_EXC_CONTEXT
+ if (value)
+ libFIRM_opt |= OPT_PRECISE_EXC_CONTEXT;
+ else
+ libFIRM_opt &= ~OPT_PRECISE_EXC_CONTEXT;
+#endif
+}
+
/* Save the current optimization state. */
void save_optimization_state(optimization_state_t *state)
{