Instruction scheduling is typically done on a single basic block.
Input dependence does not constrain the execution order of two statements, but it is useful in scalar replacement of array elements.
Then, any topological sort of this graph is a valid instruction schedule.
This is the number of clock cycles that needs to elapse before the pipeline can proceed with the target instruction without stalling.
The simplest algorithm to find a topological sort is frequently used and is known as list scheduling.
A number of heuristics are in common use: Instruction scheduling may be done either before or after register allocation or both before and after it.