Instruction Scheduling - Algorithms

Algorithms

The simplest algorithm to find a topological sort is frequently used and is known as list scheduling. Conceptually, it repeatedly selects a source of the dependency graph, appends it to the current instruction schedule and removes it from the graph. This may cause other vertices to be sources, which will then also be considered for scheduling. The algorithm terminates if the graph is empty.

To arrive at a good schedule, stalls should be prevented. This is determined by the choice of the next instruction to be scheduled. A number of heuristics are in common use:

  • The processor resources used by the already scheduled instructions are recorded. If a candidate uses a resource that is occupied, its priority will drop.
  • If a candidate is scheduled closer to its predecessors than the associated latency its priority will drop.
  • If a candidate lies on the critical path of the graph, its priority will rise. This heuristic provides some form of look-ahead in an otherwise local decision process.
  • If choosing a candidate will create many new sources, its priority will rise. This heuristic tends to generate more freedom for the scheduler.

Read more about this topic:  Instruction Scheduling