Skip to main content

Fast Optimal Instruction Scheduling for Single-Issue Processors with Arbitrary Latencies

  • Conference paper
  • First Online:
Principles and Practice of Constraint Programming — CP 2001 (CP 2001)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2239))

Abstract

Instruction scheduling is one of the most important steps for improving the performance of object code produced by a compiler. The local instruction scheduling problem is to find a minimum length instruction schedule for a basic block subject to precedence, latency, and resource constraints. In this paper we consider local instruction scheduling for single-issue processors with arbitrary latencies. The problem is considered intractable, and heuristic approaches are currently used in production compilers. In contrast, we present a relatively simple approach to instruction scheduling based on constraint programming which is fast and optimal. The proposed approach uses an improved constraint model which allows it to scale up to very large, real problems. We describe powerful redundant constraints that allow a standard constraint solver to solve these scheduling problems in an almost backtrack-free manner. The redundant constraints are lower bounds on selected sub-problems which take advantage of the structure inherent in the problems. Under specified conditions, these constraints are sometimes further improved by testing the consistency of a sub-problem using a fast test. We experimentally evaluated our approach by integrating it into the Gnu Compiler Collection (GCC) and then applying it to the SPEC95 floating point benchmarks. All 7402 of the benchmarks’ basic-blocks were optimally scheduled, including basic-blocks with up to 1000 instructions. Our results compare favorably to the best previous approach which is based on integer linear programming (Wilken et al., 2000): Across the same benchmarks, the total optimal scheduling time for their approach is 98 seconds while the total time for our approach is less than 5 seconds.

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 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.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. S. Arya. An optimal instruction-scheduling model for a class of vector processors. IEEE Transactions on Computers, C-34(11): 981–995, 1985.

    Article  Google Scholar 

  2. D. Bernstein and I. Gertner. Scheduling expressions on a pipelined processor with a maximal delay of one cycle. ACM Transactions on Programming Languages and Systems, 11(1): 57–66, 1989.

    Article  Google Scholar 

  3. D. Bernstein, M. Rodeh, and I. Gertner. On the complexity of scheduling problems for parallel/pipelined machines. IEEE Transactions on Computers, 38(9): 1308–1313, 1989.

    Article  MathSciNet  Google Scholar 

  4. J. Carlier and E. Pinson. Adjustment of heads and tails for the job-shop problem. European Journal of Operational Research, 78: 146–161, 1994.

    Article  Google Scholar 

  5. C.-M. Chang, C.-M. Chen, and C.-T. King. Using integer programming for instruction scheduling and register allocation in multi-issue processors. Computers and Mathematics with Applications, 34(9): 1–14, 1997.

    Article  MathSciNet  Google Scholar 

  6. R. Dechter. Enhancement schemes for constraint processing: Backjumping, learning, and cutset decomposition. Artificial Intelligence, 41: 273–312, 1990.

    Article  Google Scholar 

  7. M. A. Ertl and A. Krall. Optimal instruction scheduling using constraint logic programming. In Programming Language Implementation and Logic Programming (PLILP), 1991.

    Google Scholar 

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

    Article  Google Scholar 

  9. J. Hennessy and D. Patterson. Computer Architecture: A Quantitative Approach. Morgan Kaufmann, second edition, 1996.

    Google Scholar 

  10. C. W. Kessler. Scheduling expression DAGs for minimal register need. Computer Languages, 24(1): 33–53, 1998.

    Article  Google Scholar 

  11. C. Le Pape and P. Baptiste. Constraint-based scheduling: A theoretical comparison of resource constraint propagation rules. In Proceedings of the ECAI Workshop on Non-Binary Constraints, Brighton, UK, August 1998.

    Google Scholar 

  12. M. Leconte. A bounds-based reduction scheme for constraints of difference. In Proceedings of the Constraint-96 International Workshop on Constraint-Based Reasoning, pages 19–28, Key West, Florida, May 1996.

    Google Scholar 

  13. C. Lee, M. Potkonjak, and W. Manginoe-Smith. MediaBench: A tool for evaluating and synthesizing multimedia and communications. In Proceedings of International Symposium on Microarchitecture, pages 330–335, December 1997.

    Google Scholar 

  14. R. Leupers and P. Marwedel. Time-constrained code compaction for DSPs. IEEE Trans. VLSI Systems, 5(1): 112–122, 1997.

    Article  Google Scholar 

  15. K. Marriott and P. J. Stuckey. Programming with Constraints. The MIT Press, 1998.

    Google Scholar 

  16. K. Mehlhorn and S. Thiel. Faster algorithms for bound-consistency of the sortedness and alldifferent constraint. In Proceedings of the Sixth International Conference on Principles and Practice of Constraint Programming, pages 306–319, Singapore, September 2000.

    Google Scholar 

  17. S. Muchnick. Advanced Compiler Design and Implementation. Morgan Kaufmann, 1997.

    Google Scholar 

  18. K. Palem and B. Simons. Scheduling time-critical instructions on RISC machines. ACM Transactions on Programming Languages and Systems, 15(4): 632–658, 1993.

    Article  Google Scholar 

  19. P. Prosser, K. Stergiou, and T. Walsh. Singleton consistencies. In Proceedings of the Sixth International Conference on Principles and Practice of Constraint Programming, pages 353–368, Singapore, September 2000.

    Google Scholar 

  20. J.-F. Puget. A fast algorithm for the bound consistency of alldiffconstraints. In Proceedings of the Fifteenth National Conference on Artiffcial Intelligence, pages 359–366, Madison, WI, July 1998.

    Google Scholar 

  21. K. Wilken, J. Liu, and M. Heffernan. Optimal instruction scheduling using integer programming. In Proceedings of the SIGPLAN 2000 Conference on Programming Language Design and Implementation (PLDI), pages 121–133, Vancouver, BC, June 2000.

    Google Scholar 

  22. H. Wu, J. Jaffar, and R. Yap. Instruction scheduling with timing constraints on a single RISC processor with 0/1 latencies. In Proceedings of the Sixth International Conference on Principles and Practice of Constraint Programming, pages 457–469, Singapore, September 2000.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2001 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

van Beek, P., Wilken, K. (2001). Fast Optimal Instruction Scheduling for Single-Issue Processors with Arbitrary Latencies. In: Walsh, T. (eds) Principles and Practice of Constraint Programming — CP 2001. CP 2001. Lecture Notes in Computer Science, vol 2239. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45578-7_52

Download citation

  • DOI: https://doi.org/10.1007/3-540-45578-7_52

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-42863-3

  • Online ISBN: 978-3-540-45578-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics