2 * Trivial node selector.
3 * @author Christian Wuerdig
13 #include "besched_t.h"
14 #include "belistsched.h"
17 * The trivial selector:
18 * Just assure that branches are executed last, otherwise select
19 * the first node ready.
21 static ir_node *trivial_select(void *block_env, ir_nodeset_t *ready_set, ir_nodeset_t *live_set)
23 const arch_env_t *arch_env = block_env;
25 ir_nodeset_iterator_t iter;
27 /* assure that branches and constants are executed last */
28 foreach_ir_nodeset(ready_set, irn, iter) {
29 if (! arch_irn_class_is(arch_env, irn, branch)) {
34 /* at last: schedule branches */
35 ir_nodeset_iterator_init(&iter, ready_set);
36 irn = ir_nodeset_iterator_next(&iter);
41 static void *trivial_init_graph(const list_sched_selector_t *vtab, const arch_env_t *arch_env, ir_graph *irg)
43 return (void *)arch_env;
46 static void *trivial_init_block(void *graph_env, ir_node *bl)
51 static const list_sched_selector_t trivial_selector_struct = {
55 NULL, /* to_appear_in_schedule */
56 NULL, /* node_ready */
57 NULL, /* node_selected */
60 NULL, /* finish_block */
61 NULL /* finish_graph */
64 const list_sched_selector_t *trivial_selector = &trivial_selector_struct;