Commit 17137c93 authored by Matthias Braun's avatar Matthias Braun
Browse files

remove R_FLAG and reassoc_running flag

The reassoc running flag wasn't necessary in new reassoc versions
anyway.
parent 6d535f33
......@@ -24,7 +24,6 @@
#define FLAG(name, value, def) (irf_##name & def) |
#define E_FLAG(name, value, def) FLAG(name, value, def)
#define I_FLAG(name, value, def) FLAG(name, value, def)
#define R_FLAG(name, value)
optimization_state_t libFIRM_opt =
#include "irflag_t.def"
......@@ -33,7 +32,6 @@ optimization_state_t libFIRM_opt =
#undef FLAG
#undef E_FLAG
#undef I_FLAG
#undef R_FLAG
optimization_state_t libFIRM_running = 0;
......@@ -58,14 +56,11 @@ void set_opt_##name(int flag) { \
else libFIRM_opt &= ~irf_##name; \
} \
#define R_FLAG(name, value)
/* generate them */
#include "irflag_t.def"
#undef I_FLAG
#undef E_FLAG
#undef R_FLAG
void set_optimize(int value)
{
......@@ -95,11 +90,9 @@ void all_optimizations_off(void)
static const lc_opt_table_entry_t firm_flags[] = {
#define I_FLAG(name, val, def) LC_OPT_ENT_BIT(#name, #name, &libFIRM_opt, (1 << val)),
#define E_FLAG(name, val, def) LC_OPT_ENT_BIT(#name, #name, &libFIRM_opt, (1 << val)),
#define R_FLAG(name, val)
#include "irflag_t.def"
#undef I_FLAG
#undef E_FLAG
#undef R_FLAG
LC_OPT_LAST
};
......
......@@ -13,7 +13,6 @@
* We have 3 kinds of flags:
* I_FLAGS are INTERNAL flags: There is only a public set_opt_<flag> function
* E_FLAGS are EXTERNAL flags: Public get_opt_<flag> and set_opt_<flag> fucntions exists
* R_FLAGS are RUNNING flags: Use only internally in libfirm to indicate running states
*/
/** Turn off all optimizations. */
......@@ -45,8 +44,3 @@ I_FLAG(alias_analysis , 11, ON)
/** Closed world assumption. */
I_FLAG(closed_world , 12, OFF)
/* -------------------- RUNNING flags ------------------- */
/** This flag is set while the reassociation optimizations are running */
R_FLAG(reassoc , 0)
......@@ -19,13 +19,11 @@
typedef enum {
#define E_FLAG(name, value, def) irf_##name = (1 << value),
#define I_FLAG(name, value, def) irf_##name = (1 << value),
#define R_FLAG(name, value)
#include "irflag_t.def"
irf_last
#undef I_FLAG
#undef E_FLAG
#undef R_FLAG
} libfirm_opts_t;
/**
......@@ -34,13 +32,11 @@ typedef enum {
typedef enum {
#define E_FLAG(name, value, def)
#define I_FLAG(name, value, def)
#define R_FLAG(name, value) ir_rf_##name = (1 << value),
#include "irflag_t.def"
ir_rf_last
#undef I_FLAG
#undef E_FLAG
#undef R_FLAG
} libfirm_running_t;
extern optimization_state_t libFIRM_opt, libFIRM_running, libFIRM_verb;
......@@ -60,21 +56,10 @@ static inline int get_opt_##name(void) { \
return libFIRM_opt & irf_##name; \
}
/* generate getter and setter functions for running flags */
#define R_FLAG(name, value) \
static inline int is_##name##_running(void) { \
return libFIRM_running & ir_rf_##name; \
} \
static inline void set_##name##_running(int flag) {\
if (flag) libFIRM_running |= ir_rf_##name; \
else libFIRM_running &= ~ir_rf_##name; \
}
#include "irflag_t.def"
#undef I_FLAG
#undef E_FLAG
#undef R_FLAG
static inline int get_optimize_(void)
{
......
......@@ -3161,7 +3161,7 @@ restart:
}
}
/* do NOT execute this code if reassociation is enabled, it does the inverse! */
if (!is_reassoc_running() && is_Mul(a)) {
if (is_Mul(a)) {
ir_node *const x = b;
ir_node *const y = get_commutative_other_op(a, x);
if (y) {
......
......@@ -602,10 +602,6 @@ void optimize_reassociation(ir_graph *irg)
waitq *const wq = new_waitq();
/* disable some optimizations while reassoc is running to prevent endless
* loops */
set_reassoc_running(1);
/* now we have collected enough information, optimize */
irg_walk_graph(irg, NULL, wq_walker, wq);
do_reassociation(wq);
......@@ -613,8 +609,6 @@ void optimize_reassociation(ir_graph *irg)
/* reverse those rules that do not result in collapsed constants */
irg_walk_graph(irg, NULL, reverse_rules, NULL);
set_reassoc_running(0);
del_waitq(wq);
confirm_irg_properties(irg, IR_GRAPH_PROPERTIES_CONTROL_FLOW);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment