Commit 1eea702a authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Remove an unnecessary layer of indirection from the scheduler selectors.

[r15565]
parent 2e2c4df2
......@@ -635,7 +635,7 @@ static const list_sched_selector_t *TEMPLATE_get_list_sched_selector(
(void) self;
(void) selector;
memcpy(&TEMPLATE_sched_selector, trivial_selector, sizeof(list_sched_selector_t));
TEMPLATE_sched_selector = trivial_selector;
TEMPLATE_sched_selector.to_appear_in_schedule = TEMPLATE_to_appear_in_schedule;
return &TEMPLATE_sched_selector;
}
......
......@@ -1120,7 +1120,7 @@ list_sched_selector_t arm_sched_selector;
static const list_sched_selector_t *arm_get_list_sched_selector(const void *self, list_sched_selector_t *selector) {
(void) self;
(void) selector;
memcpy(&arm_sched_selector, reg_pressure_selector, sizeof(list_sched_selector_t));
arm_sched_selector = reg_pressure_selector;
arm_sched_selector.to_appear_in_schedule = arm_to_appear_in_schedule;
return &arm_sched_selector;
}
......
......@@ -550,14 +550,14 @@ void list_sched(be_irg_t *birg, be_options_t *be_opts)
/* Select a scheduler based on backend options */
switch (list_sched_options.select) {
case BE_SCHED_SELECT_TRIVIAL: sel = *trivial_selector; break;
case BE_SCHED_SELECT_RANDOM: sel = *random_selector; break;
case BE_SCHED_SELECT_REGPRESS: sel = *reg_pressure_selector; break;
case BE_SCHED_SELECT_MUCHNIK: sel = *muchnik_selector; break;
case BE_SCHED_SELECT_HEUR: sel = *heuristic_selector; break;
case BE_SCHED_SELECT_NORMAL: sel = *normal_selector; break;
case BE_SCHED_SELECT_TRIVIAL: sel = trivial_selector; break;
case BE_SCHED_SELECT_RANDOM: sel = random_selector; break;
case BE_SCHED_SELECT_REGPRESS: sel = reg_pressure_selector; break;
case BE_SCHED_SELECT_MUCHNIK: sel = muchnik_selector; break;
case BE_SCHED_SELECT_HEUR: sel = heuristic_selector; break;
case BE_SCHED_SELECT_NORMAL: sel = normal_selector; break;
default:
case BE_SCHED_SELECT_HMUCHNIK: sel = *trivial_selector; break;
case BE_SCHED_SELECT_HMUCHNIK: sel = trivial_selector; break;
}
#if 1
......@@ -623,14 +623,14 @@ void list_sched_single_block(const be_irg_t *birg, ir_node *block,
/* Select a scheduler based on backend options */
switch (list_sched_options.select) {
case BE_SCHED_SELECT_TRIVIAL: sel = *trivial_selector; break;
case BE_SCHED_SELECT_RANDOM: sel = *random_selector; break;
case BE_SCHED_SELECT_REGPRESS: sel = *reg_pressure_selector; break;
case BE_SCHED_SELECT_MUCHNIK: sel = *muchnik_selector; break;
case BE_SCHED_SELECT_HEUR: sel = *heuristic_selector; break;
case BE_SCHED_SELECT_NORMAL: sel = *normal_selector; break;
case BE_SCHED_SELECT_TRIVIAL: sel = trivial_selector; break;
case BE_SCHED_SELECT_RANDOM: sel = random_selector; break;
case BE_SCHED_SELECT_REGPRESS: sel = reg_pressure_selector; break;
case BE_SCHED_SELECT_MUCHNIK: sel = muchnik_selector; break;
case BE_SCHED_SELECT_HEUR: sel = heuristic_selector; break;
case BE_SCHED_SELECT_NORMAL: sel = normal_selector; break;
default:
case BE_SCHED_SELECT_HMUCHNIK: sel = *trivial_selector; break;
case BE_SCHED_SELECT_HMUCHNIK: sel = trivial_selector; break;
}
/* Assure, that the out edges are computed */
......
......@@ -132,31 +132,31 @@ struct _list_sched_selector_t {
/**
* A trivial selector, that just selects the first ready node.
*/
extern const list_sched_selector_t *trivial_selector;
extern const list_sched_selector_t trivial_selector;
extern const list_sched_selector_t *random_selector;
extern const list_sched_selector_t random_selector;
/**
* A selector that tries to minimize the register pressure.
* @note Not really operational yet.
*/
extern const list_sched_selector_t *reg_pressure_selector;
extern const list_sched_selector_t reg_pressure_selector;
/**
* A selector based on trace scheduling as introduced by Muchnik[TM]
*/
extern const list_sched_selector_t *muchnik_selector;
extern const list_sched_selector_t muchnik_selector;
/**
* A selector based on trace scheduling as introduced by Muchnik[TM]
* but using the mueller heuristic selector.
*/
extern const list_sched_selector_t *heuristic_selector;
extern const list_sched_selector_t heuristic_selector;
/**
* A selector based on the strng normal form theorem
* A selector based on the strong normal form theorem
*/
extern const list_sched_selector_t *normal_selector;
extern const list_sched_selector_t normal_selector;
/**
* List schedule a graph.
......
......@@ -356,7 +356,7 @@ static void *normal_init_block(void *graph_env, ir_node *block)
}
static const list_sched_selector_t normal_selector_struct = {
const list_sched_selector_t normal_selector = {
normal_init_graph,
normal_init_block,
normal_select,
......@@ -368,5 +368,3 @@ static const list_sched_selector_t normal_selector_struct = {
NULL, /* finish_block */
NULL /* finish_graph */
};
const list_sched_selector_t *normal_selector = &normal_selector_struct;
......@@ -93,7 +93,7 @@ static void *random_init_block(void *graph_env, ir_node *block)
return graph_env;
}
static const list_sched_selector_t random_selector_struct = {
const list_sched_selector_t random_selector = {
random_init_graph,
random_init_block,
random_select,
......@@ -105,5 +105,3 @@ static const list_sched_selector_t random_selector_struct = {
NULL, /* finish_block */
NULL /* finish_graph */
};
const list_sched_selector_t *random_selector = &random_selector_struct;
......@@ -319,7 +319,7 @@ static ir_node *reg_pressure_select(void *block_env, ir_nodeset_t *ready_set,
return res;
}
static const list_sched_selector_t reg_pressure_selector_struct = {
const list_sched_selector_t reg_pressure_selector = {
reg_pressure_graph_init,
reg_pressure_block_init,
reg_pressure_select,
......@@ -331,5 +331,3 @@ static const list_sched_selector_t reg_pressure_selector_struct = {
reg_pressure_block_free,
free
};
const list_sched_selector_t *reg_pressure_selector = &reg_pressure_selector_struct;
......@@ -607,7 +607,7 @@ static void *muchnik_init_block(void *graph_env, ir_node *bl)
return graph_env;
}
static const list_sched_selector_t muchnik_selector_struct = {
const list_sched_selector_t muchnik_selector = {
muchnik_init_graph,
muchnik_init_block,
muchnik_select,
......@@ -620,8 +620,6 @@ static const list_sched_selector_t muchnik_selector_struct = {
trace_free /* finish_graph */
};
const list_sched_selector_t *muchnik_selector = &muchnik_selector_struct;
/**
* Execute the heuristic function.
*/
......@@ -697,7 +695,7 @@ static ir_node *heuristic_select(void *block_env, ir_nodeset_t *ns, ir_nodeset_t
return cand;
}
static const list_sched_selector_t heuristic_selector_struct = {
const list_sched_selector_t heuristic_selector = {
muchnik_init_graph,
muchnik_init_block,
heuristic_select,
......@@ -709,5 +707,3 @@ static const list_sched_selector_t heuristic_selector_struct = {
NULL, /* finish_block */
trace_free /* finish_graph */
};
const list_sched_selector_t *heuristic_selector = &heuristic_selector_struct;
......@@ -76,7 +76,7 @@ static void *trivial_init_block(void *graph_env, ir_node *block)
return graph_env;
}
static const list_sched_selector_t trivial_selector_struct = {
const list_sched_selector_t trivial_selector = {
trivial_init_graph,
trivial_init_block,
trivial_select,
......@@ -88,5 +88,3 @@ static const list_sched_selector_t trivial_selector_struct = {
NULL, /* finish_block */
NULL /* finish_graph */
};
const list_sched_selector_t *trivial_selector = &trivial_selector_struct;
......@@ -885,7 +885,7 @@ list_sched_selector_t ppc32_sched_selector;
static const list_sched_selector_t *ppc32_get_list_sched_selector(const void *self, list_sched_selector_t *selector) {
(void) self;
(void) selector;
memcpy(&ppc32_sched_selector, trivial_selector, sizeof(list_sched_selector_t));
ppc32_sched_selector = trivial_selector;
ppc32_sched_selector.to_appear_in_schedule = ppc32_to_appear_in_schedule;
return &ppc32_sched_selector;
}
......
Markdown is supported
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