Learning basic block scheduling heuristics from optimal data
Tyrel Russell, Abid Muslim Malik, Michael K. Chase, Peter van Beek · 2005
Instruction scheduling is an important step for improving the performance of object code produced by a compiler. The basic block instruction scheduling problem is to find a minimum length schedule for a basic block—a straightline sequence of code with a single entry point and a single exit point—subject to precedence, latency, and resource constraints. Solving the problem exactly is known to be difficult, and most compilers use a greedy list scheduling algorithm coupled with a heuristic. The heuristic is usually hand-crafted, a potentially timeconsuming process. In contrast, we present a study on automatically learning good heuristics using techniques from machine learning. In our study, a recently proposed optimal basic block scheduler was used to generate the machine learning training data. A decision tree learning algorithm was then used to induce a simple heuristic from the training data. The automatically constructed decision tree heuristic was compared against a popular criticalpath heuristic on the SPEC 2000 benchmarks. On this benchmark suite, the decision tree heuristic reduced the number of basic blocks that were not optimally scheduled by up to 55 % compared to the critical-path heuristic, Copyright c ○ 2005 Tyrel Russell, Abid M. Malik, Michael Chase, and Peter van Beek. Permission to copy is hereby granted provided the original copyright notice is reproduced in copies made. and gave improved performance guarantees in terms of the worst-case factor from optimality. 1