Added some backend stuff. nothing big, just a basis.
[libfirm] / ir / be / belistsched.h
1 /**
2  * Primitive list scheduling.
3  * @date 20.10.2004
4  * @author Sebastian Hack
5  */
6
7 #ifndef _FIRM_LIST_SCHED
8 #define _FIRM_LIST_SCHED
9
10 #include "pset.h"
11 #include "pmap.h"
12 #include "list.h"
13
14 #include "besched_t.h"
15
16 /**
17  * The selection function.
18  * It picks one node out of the ready list to be scheduled next.
19  * The function does not have to delete the node from the ready set.
20  *
21  * @param env Some private information as passed to list_schedule().
22  * @param block The block which is currentliy scheduled.
23  * @param curr_time The current time step which the picked node
24  * will be assigned to.
25  * @param already_scheduled A set containing all nodes already
26  * scheduled.
27  * @param ready_list A set containing all ready nodes. Pick one of these
28  * nodes.
29  * @return The chosen node.
30  */
31 typedef ir_node *(list_sched_selector_t)(void *env, ir_node *block,
32                 int curr_time, pset *already_scheduled, pset *ready_list);
33
34 ir_node *trivial_selector(void *env, ir_node *block, int curr_time,
35                 pset *already_scheduled, pset *ready_list);
36
37 /**
38  * List schedule a graph.
39  * Each block in the graph gets a list head to its link field being the
40  * head of the schedule. You can walk this list using the functions in
41  * list.h.
42  * @param irg The graph to schedule.
43  * @param sched_obst An obstack to allocate the lists on.
44  * @param map Maps each block to a list head giving the schedule.
45  * @param select_func A selection function.
46  * @param env Some private data to give to the select function.
47  */
48 void list_sched(ir_graph *irg, list_sched_selector_t *select_func, void *env);
49
50
51
52 #endif