*** empty log message ***
[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 /**
15  * The selection function.
16  * It picks one node out of the ready list to be scheduled next.
17  * The function does not have to delete the node from the ready set.
18  *
19  * @param env Some private information as passed to list_schedule().
20  * @param block The block which is currentliy scheduled.
21  * @param curr_time The current time step which the picked node
22  * will be assigned to.
23  * @param already_scheduled A set containing all nodes already
24  * scheduled.
25  * @param ready_list A set containing all ready nodes. Pick one of these
26  * nodes.
27  * @return The chosen node.
28  */
29 typedef ir_node *(list_sched_selector_t)(void *env, ir_node *block,
30                 int curr_time, pset *already_scheduled, pset *ready_list);
31
32 ir_node *trivial_selector(void *env, ir_node *block, int curr_time,
33                 pset *already_scheduled, pset *ready_list);
34
35 /**
36  * List schedule a graph.
37  * Each block in the graph gets a list head to its link field being the
38  * head of the schedule. You can walk this list using the functions in
39  * list.h.
40  * @param irg The graph to schedule.
41  * @param sched_obst An obstack to allocate the lists on.
42  * @param map Maps each block to a list head giving the schedule.
43  * @param select_func A selection function.
44  * @param env Some private data to give to the select function.
45  */
46 void list_sched(ir_graph *irg, list_sched_selector_t *select_func, void *env);
47
48
49
50 #endif