Abstract
Modern computer architectures have complex features that can only be fully taken advantage of if the compiler schedules the compiled code. A standard region of code for scheduling in an optimizing compiler is called a superblock. Scheduling superblocks optimally is known to be NP-complete, and production compilers use non-optimal heuristic algorithms. In this paper, we present an application of constraint programming to the superblock instruction scheduling problem. The resulting system is both optimal and fast enough to be incorporated into production compilers, and is the first optimal superblock scheduler for realistic architectures. In developing our optimal scheduler, the keys to scaling up to large, real problems were in applying and adapting several techniques from the literature including: implied and dominance constraints, impact-based variable ordering heuristics, singleton bounds consistency, portfolios, and structure-based decomposition techniques. We experimentally evaluated our optimal scheduler on the SPEC 2000 benchmarks, a standard benchmark suite. Depending on the architectural model, between 98.29% to 99.98% of all superblocks were solved to optimality. The scheduler was able to routinely solve the largest superblocks, including superblocks with up to 2,600 instructions, and gave noteworthy improvements over previous heuristic approaches.
Access provided by Autonomous University of Puebla. Download to read the full chapter text
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Govindarajan, R.: Instruction scheduling. In: Srikant, Y.N., Shankar, P. (eds.) The Compiler Design Handbook, pp. 631–687. CRC Press, Boca Raton (2003)
Hennessy, J., Patterson, D.: Computer Architecture: A Quantitative Approach, 3rd edn. Morgan Kaufmann, San Francisco (2003)
Muchnick, S.: Advanced Compiler Design and Implementation. Morgan Kaufmann, San Francisco (1997)
Hoxey, S., Karim, F., Hay, B., Warren, H.: The PowerPC Compiler Writer’s Guide. Warthman Associates (1996)
Intel: Intel Itanium Architecture Software Developer’s Manual, Volume 2: System Architecture (2002)
Hwu, W.W., Mahlke, S.A., Chen, W.Y., Chang, P.P., Warter, N.J., Bringmann, R.A., Ouellette, R.G., Hank, R.E., Kiyohara, T., Haab, G.E., Holm, J.G., Lavery, D.M.: The superblock: An effective technique for VLIW and superscalar compilation. The Journal of Supercomputing 7(1), 229–248 (1993)
Hennessy, J., Gross, T.: Postpass code optimization of pipeline constraints. ACM Transactions on Programming Languages and Systems 5(3), 422–448 (1983)
Bringmann, R.A.: Enhancing Instruction Level Parallelism through Compiler-Controlled Speculation. PhD thesis, U. of Illinois at Urbana-Champaign (1995)
Chekuri, C., Johnson, R., Motwani, R., Natarajan, B., Rau, B.R., Schlansker, M.: Profile-driven instruction level parallel scheduling with application to superblocks. In: Proc. of the 29th Annual IEEE/ACM International Symposium on Microarchitecture (Micro-29), Paris, pp. 58–67 (1996)
Deitrich, B., Hwu, W.: Speculative hedge: Regulating compile-time speculation against profile variations. In: Proc. of the 29th Annual IEEE/ACM International Symposium on Microarchitecture (Micro-29), Paris (1996)
Eichenberger, A.E., Meleis, W.M.: Balance scheduling: Weighting branch tradeoffs in superblocks. In: Proc. of the 32nd Annual IEEE/ACM International Symposium on Microarchitecture (Micro-32), Haifa, Israel (1999)
Wilken, K., Liu, J., Heffernan, M.: Optimal instruction scheduling using integer programming. In: Proc. of the SIGPLAN 2000 Conference on Programming Language Design and Implementation, Vancouver, pp. 121–133 (2000)
van Beek, P., Wilken, K.: Fast optimal instruction scheduling for single-issue processors with arbitrary latencies. In: Proc. of the 7th Int’l Conf. on Principles and Practice of Constraint Programming, Paphos, Cyprus, pp. 625–639 (2001)
Heffernan, M., Wilken, K.: Data-dependency graph transformations for instruction scheduling. Journal of Scheduling 8, 427–451 (2005)
Malik, A.M., McInnes, J., van Beek, P.: Optimal basic block instruction scheduling for multiple-issue processors using constraint programming. In: Proc. of the 18th IEEE Int’l Conf. on Tools with AI, Washington, DC, pp. 279–287 (2006)
Ertl, M.A., Krall, A.: Optimal instruction scheduling using constraint logic programming. In: Proc. of 3rd International Symposium on Programming Language Implementation and Logic Programming, Passau, Germany, pp. 75–86 (1991)
Kästner, D., Winkel, S.: ILP-based instruction scheduling for IA-64. In: Proc. of the SIGPLAN 2001 Workshop on Languages Compilers, and Tools for Embedded Systems, Snowbird, Utah, pp. 145–154 (2001)
Liu, J., Chow, F.: A near-optimal instruction scheduler for a tightly constrained, variable instruction set embedded processor. In: Proc. of the Int’l Conf. on Compilers, Architectures, and Synthesis for Embedded Systems, Grenoble, pp. 9–18 (2002)
Winkel, S.: Exploring the performance potential of Itanium processors with ILP-based scheduling. In: 2nd IEEE/ACM International Symposium on Code Generation and Optimization, pp. 189–200 (2004)
Shobaki, G., Wilken, K.: Optimal superblock scheduling using enumeration. In: Proc. of the 37th Annual IEEE/ACM International Symposium on Microarchitecture (Micro-37), Portland, Oregon, pp. 283–293 (2004)
Shobaki, G.: Optimal Global Instruction Scheduling Using Enumeration. PhD thesis, University of California, Davis (2006)
Malik, A.M.: Constraint Programming Techniques for Optimal Instruction Scheduling. PhD thesis, University of Waterloo (2008)
Régin, J.C.: Generalized arc consistency for global cardinality constraint. In: Proc. of the 13th National Conference on AI, Portland, Oregon, pp. 209–215 (1996)
Smith, B.M.: Modelling. In: Rossi, F., van Beek, P., Walsh, T. (eds.) Handbook of Constraint Programming. Elsevier, Amsterdam (2006)
Trick, M.: A dynamic programming approach for consistency and propagation of knapsack constraints. In: Proc. of Third International Workshop on Integration of AI and OR Techniques in Constraint Programming for Combinatorial Optimization Problems (2001)
Gomes, C., Selman, B., Crato, N.: Heavy-tailed distributions in combinatorial search. In: Proc. of the 3rd Int’l Conf. on Principles and Practice of Constraint Programming, Linz, Austria, pp. 121–135 (1997)
Bessiere, C.: Constraint propagation. In: Rossi, F., van Beek, P., Walsh, T. (eds.) Handbook of Constraint Programming. Elsevier, Amsterdam (2006)
Refalo, P.: Impact-based search strategies for constraint programming. In: Proc. of the 10th Int’l Conf. on Principles and Practice of Constraint Programming, Toronto, pp. 557–571 (2004)
Freuder, E.C.: Exploiting structure in constraint satisfaction problems. In: Mayoh, B., Tyugo, E., Penjam, J. (eds.) Constraint Programming. Springer, Heidelberg (1994)
Blainey, R.J.: Instruction scheduling in the TOBEY compiler. IBM J. Res. Develop. 38(5), 577–593 (1994)
Chakrapani, L.N., Gyllenhaal, J., Hwu, W.W., Mahlke, S.A., Palem, K.V., Rabbah, R.M.: Trimaran: An infrastructure for research in instruction-level parallelism. In: Proc. of the 17th International Workshop on Languages and Compilers for High Performance Computing, West Lafayette, Indiana, USA, pp. 32–41 (2005)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2008 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Malik, A.M., Chase, M., Russell, T., van Beek, P. (2008). An Application of Constraint Programming to Superblock Instruction Scheduling. In: Stuckey, P.J. (eds) Principles and Practice of Constraint Programming. CP 2008. Lecture Notes in Computer Science, vol 5202. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-85958-1_7
Download citation
DOI: https://doi.org/10.1007/978-3-540-85958-1_7
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-85957-4
Online ISBN: 978-3-540-85958-1
eBook Packages: Computer ScienceComputer Science (R0)