10.1145/1064979.1064998acmconferencesArticle/Chapter ViewAbstractPublication PagesveeConference Proceedings
Article

Optimized interval splitting in a linear scan register allocator

ABSTRACT

We present an optimized implementation of the linear scan register allocation algorithm for Sun Microsystems' Java HotSpot™ client compiler. Linear scan register allocation is especially suitable for just-in-time compilers because it is faster than the common graph-coloring approach and yields results of nearly the same quality.Our allocator improves the basic linear scan algorithm by adding more advanced optimizations: It makes use of lifetime holes, splits intervals if the register pressure is too high, and models register constraints of the target architecture with fixed intervals. Three additional optimizations move split positions out of loops, remove register-to-register moves and eliminate unnecessary spill stores. Interval splitting is based on use positions, which also capture the kind of use and whether an operand is needed in a register or not. This avoids the reservation of a scratch register.Benchmark results prove the efficiency of the linear scan algorithm: While the compilation speed is equal to the old local register allocator that is part of the Sun JDK 5.0, integer benchmarks execute about 15% faster. Floating-point benchmarks show the high impact of the Intel SSE2 extensions on the speed of numeric Java applications: With the new SSE2 support enabled, SPECjvm98 executes 25% faster compared with the current Sun JDK 5.0.

References

  1. P. Briggs, K. D. Cooper, and L. Torczon. Improvements to graph coloring register allocation. ACM Transactions on Programming Languages and Systems, 16(3):428--455, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. G. J. Chaitin, M. A. Auslander, A. K. Chandra, J. Cocke, M. E. Hopkins, and P. W. Markstein. Register allocation via coloring. Computer Languages, 6:47--57, 1981.Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. R. Cytron, J. Ferrante, B. K. Rosen, M. N. Wegman, and F. K. Zadeck. Efficiently computing static single assignment form and the control dependence graph. ACM Transactions on Programming Languages and Systems, 13(4):451--490, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. R. Griesemer and S. Mitrovic. A compiler for the Java HotSpot™ virtual machine. In L. Böszörményi, J. Gutknecht, and G. Pomberger, editors, The School of Niklaus Wirth: The Art of Simplicity, pages 133--152. dpunkt.verlag, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Institute of Electrical and Electronics Engineers. IEEE Standard for Binary Floating-Point Arithmetic. ANSI/IEEE Standard 754-1985.Google ScholarGoogle Scholar
  6. Intel Corporation. IA-32 Intel Architecture Software Developer's Manual, Volume 1: Basic Architecture, 2004. Order Number 253665.Google ScholarGoogle Scholar
  7. T. Kotzmann and H. Mössenböck. Escape analysis in the context of dynamic compilation and deoptimization. In Proceedings of the First Conference on Virtual Execution Environments, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. H. Mössenböck. Adding static single assignment form and a graph coloring register allocator to the Java HotSpot™ client compiler. Technical Report 15, Institute for Practical Computer Science, Johannes Kepler University Linz, 2000.Google ScholarGoogle Scholar
  9. H. Mössenböck and M. Pfeiffer. Linear scan register allocation in the context of SSA form and register constraints. In Proceedings of the 11th International Conference on Compiler Construction, pages 229--246, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. M. Paleczny, C. Vick, and C. Click. The Java HotSpot™ server compiler. In Proceedings of the Java Virtual Machine Research and Technology Symposium, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. J. Park and S.-M. Moon. Optimistic register coalescing. ACM Transactions on Programming Languages and Systems, 26(4):735--765, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. M. Poletto, D. R. Engler, and M. F. Kaashoek. tcc: A system for fast, flexible, and high-level dynamic code generation. In Proceedings of the ACM SIGPLAN 1997 conference on Programming language design and implementation, pages 109--121. ACM Press, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. M. Poletto and V. Sarkar. Linear scan register allocation. ACM Transactions on Programming Languages and Systems, 21(5):895--913, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. R. Pozo and B. Miller. SciMark 2.0. http://math.nist.gov/scimark2/.Google ScholarGoogle Scholar
  15. Standard Performance Evaluation Corporation. SPECjvm98. http://www.spec.org/jvm98/.Google ScholarGoogle Scholar
  16. Sun Microsystems, Inc. The Java HotSpot™ Virtual Machine, v1.4.1, 2002. http://java.sun.com/products/hotspot.Google ScholarGoogle Scholar
  17. O. Traub, G. Holloway, and M. D. Smith. Quality and speed in linear-scan register allocation. In Proceedings of the ACM SIGPLAN 1998 conference on Programming language design and implementation, pages 142--151. ACM Press, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. C. Wimmer. Linear scan register allocation for the Java HotSpot™ client compiler. Master's thesis, Johannes Kepler University Linz, 2004.Google ScholarGoogle Scholar

Index Terms

  1. Optimized interval splitting in a linear scan register allocator

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!