2 * Primitive list scheduling.
4 * @author Sebastian Hack
7 #ifndef _FIRM_LIST_SCHED
8 #define _FIRM_LIST_SCHED
14 #include "besched_t.h"
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.
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
27 * @param ready_list A set containing all ready nodes. Pick one of these
29 * @return The chosen node.
31 typedef ir_node *(list_sched_selector_t)(void *env, ir_node *block,
32 int curr_time, pset *already_scheduled, pset *ready_list);
34 ir_node *trivial_selector(void *env, ir_node *block, int curr_time,
35 pset *already_scheduled, pset *ready_list);
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
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.
48 void list_sched(ir_graph *irg, list_sched_selector_t *select_func, void *env);