Skip to main content

An Application of Constraint Programming to Superblock Instruction Scheduling

  • Conference paper
Book cover Principles and Practice of Constraint Programming (CP 2008)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 5202))

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 99.00
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 129.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Govindarajan, R.: Instruction scheduling. In: Srikant, Y.N., Shankar, P. (eds.) The Compiler Design Handbook, pp. 631–687. CRC Press, Boca Raton (2003)

    Google Scholar 

  2. Hennessy, J., Patterson, D.: Computer Architecture: A Quantitative Approach, 3rd edn. Morgan Kaufmann, San Francisco (2003)

    Google Scholar 

  3. Muchnick, S.: Advanced Compiler Design and Implementation. Morgan Kaufmann, San Francisco (1997)

    Google Scholar 

  4. Hoxey, S., Karim, F., Hay, B., Warren, H.: The PowerPC Compiler Writer’s Guide. Warthman Associates (1996)

    Google Scholar 

  5. Intel: Intel Itanium Architecture Software Developer’s Manual, Volume 2: System Architecture (2002)

    Google Scholar 

  6. 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)

    Article  Google Scholar 

  7. Hennessy, J., Gross, T.: Postpass code optimization of pipeline constraints. ACM Transactions on Programming Languages and Systems 5(3), 422–448 (1983)

    Article  MATH  Google Scholar 

  8. Bringmann, R.A.: Enhancing Instruction Level Parallelism through Compiler-Controlled Speculation. PhD thesis, U. of Illinois at Urbana-Champaign (1995)

    Google Scholar 

  9. 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)

    Google Scholar 

  10. 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)

    Google Scholar 

  11. 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)

    Google Scholar 

  12. 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)

    Google Scholar 

  13. 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)

    Google Scholar 

  14. Heffernan, M., Wilken, K.: Data-dependency graph transformations for instruction scheduling. Journal of Scheduling 8, 427–451 (2005)

    Article  MATH  MathSciNet  Google Scholar 

  15. 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)

    Google Scholar 

  16. 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)

    Google Scholar 

  17. 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)

    Google Scholar 

  18. 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)

    Google Scholar 

  19. 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)

    Google Scholar 

  20. 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)

    Google Scholar 

  21. Shobaki, G.: Optimal Global Instruction Scheduling Using Enumeration. PhD thesis, University of California, Davis (2006)

    Google Scholar 

  22. Malik, A.M.: Constraint Programming Techniques for Optimal Instruction Scheduling. PhD thesis, University of Waterloo (2008)

    Google Scholar 

  23. 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)

    Google Scholar 

  24. Smith, B.M.: Modelling. In: Rossi, F., van Beek, P., Walsh, T. (eds.) Handbook of Constraint Programming. Elsevier, Amsterdam (2006)

    Google Scholar 

  25. 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)

    Google Scholar 

  26. 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)

    Google Scholar 

  27. Bessiere, C.: Constraint propagation. In: Rossi, F., van Beek, P., Walsh, T. (eds.) Handbook of Constraint Programming. Elsevier, Amsterdam (2006)

    Google Scholar 

  28. 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)

    Google Scholar 

  29. Freuder, E.C.: Exploiting structure in constraint satisfaction problems. In: Mayoh, B., Tyugo, E., Penjam, J. (eds.) Constraint Programming. Springer, Heidelberg (1994)

    Google Scholar 

  30. Blainey, R.J.: Instruction scheduling in the TOBEY compiler. IBM J. Res. Develop. 38(5), 577–593 (1994)

    Article  Google Scholar 

  31. 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)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Peter J. Stuckey

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics