Optimal Instruction Scheduling Using Integer Programming Kent Wilken Jack Liu Mark He ernan Department of Electrical and Computer Engineering UniversityofCalifornia,Davis, CA 95616 fwilken,jjliu,
[email protected] Abstract { This paper presents a new approach to 1.1 Lo cal Instruction Scheduling local instruction scheduling based on integer programming The lo cal instruction scheduling problem is to nd a min- that produces optimal instruction schedules in a reasonable imum length instruction schedule for a basic blo ck. This time, even for very large basic blocks. The new approach instruction scheduling problem b ecomes complicated (inter- rst uses a set of graph transformations to simplify the data- esting) for pip elined pro cessors b ecause of data hazards and dependency graph while preserving the optimality of the nal structural hazards [11 ]. A data hazard o ccurs when an in- schedule. The simpli edgraph results in a simpli ed integer struction i pro duces a result that is used bya following in- program which can be solved much faster. A new integer- struction j, and it is necessary to delay j's execution until programming formulation is then applied to the simpli ed i's result is available. A structural hazard o ccurs when a graph. Various techniques are used to simplify the formu- resource limitation causes an instruction's execution to b e lation, resulting in fewer integer-program variables, fewer delayed. integer-program constraints and fewer terms in some of the The complexity of lo cal instruction scheduling can de- remaining constraints, thus reducing integer-program solu- p end on the maximum data-hazard latency which occurs tion time.