Learning Policies for Local Instruction Scheduling

Execution speed of programs on modern computer architectur es is sensitive, by a factor of two or more, to the order in which instructions are presented to t he processor. To realize potential execution efficiency, it is now customary for an optimizing compiler to employ a heuristic algorithm for instruction scheduling. These algorithms are currently hand-crafted. We show how to cast the local instruction scheduling problem as a machine learning task, so that one obtains a heur istic scheduling algorithm automatically. Our empirical results demonstrate that just a few features are a dequate for competence at this task for a real modern processor, and that any of several supervised learni ng methods perform nearly optimally with respect to the features used. The learning goal is to minimize the cyc les needed for each basic block, in isolation and assuming all memory accesses hit in the cache. We found th at competence at this task resulted in good measured execution times for entire scheduled programs. In the end, we essentially match the performance of commercial compilers for the same processor, and offer some evidence that our learned heuristics are nearly optimal.

[1]  William W. Cohen Fast Effective Rule Induction , 1995, ICML.

[2]  Carla E. Brodley,et al.  Learning to Schedule Straight-Line Code , 1997, NIPS.

[3]  Doina Precup,et al.  Constructive Function Approximation , 1998 .

[4]  Dirk Grunwald,et al.  A system level perspective on branch architecture performance , 1995, Proceedings of the 28th Annual International Symposium on Microarchitecture.

[5]  Dirk Grunwald,et al.  A system level perspective on branch architecture performance , 1995, Proceedings of the 28th Annual International Symposium on Microarchitecture.

[6]  Geoffrey E. Hinton,et al.  Learning internal representations by error propagation , 1986 .

[7]  Philip H. Sweany,et al.  Using Genetic Algorithms to Fine-Tune Instruction-Scheduling Heuristics , 1999 .