120 likes | 233 Views
An Integer Programming Approach to Instruction Scheduling. Matt Streeter Carsten Schwicking. Objective. To use integer programming to obtain optimal instruction schedules Assume partioning has already been done (copies inserted, etc.). Optimization & Constraints. Optimize schedule length
E N D
An Integer Programming Approach to Instruction Scheduling Matt Streeter Carsten Schwicking
Objective • To use integer programming to obtain optimal instruction schedules • Assume partioning has already been done (copies inserted, etc.)
Optimization & Constraints • Optimize schedule length • Constraints • Single execution (of each instruction) • Resource • Data dependence • Not yet dealing with crossbar constraint
Formulation Source • Daniel Kaestner and Sebastian Winkel. “ILP-based Instruction Scheduling for IA-64,” in LCTES 2001. • Used a real multiple issue architecture • IA-64 has VLIW characteristics
Integer Programming Formulation • Define a variable for each possible instruction, start time, and function unit tuple • Xkm t {0,1} • m = instruction id • t = start time (cycle #) • k = execution unit #
Constraints:Resource • Rk = # of execution units of type k • R(n) = all possible execution units for n
Constraints:Data Dependence • where n must not execute until m finishes
Preliminary results • Generated random data dependency trees • Each node has degree chosen uniformly at random from {0, 1, 2, 3}; durations chosen from {1, 2, 3, 4}; function unit assigned at random • 4 function units, one of each type • Maximum height H (=6 here)
Preliminary results • Optimal scheduling only feasible for basic blocks of ~10 instructions • An alternative is to search for locally optimal schedules
Preliminary results • Use simple heuristic (list scheduling) to generate a “center” schedule • Until 10 seconds have elapsed: • For r from 1 to rmax do: • Generate optimal schedule subject to the constraint that the cycle assigned to each instruction is within a distance r of the cycle assigned by the center schedule