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