Linear Scan Register Allocation in a High-Performance Erlang Compiler
In the context of an optimizing native code compiler for the concurrent functional programming language Erlang, we experiment with various register allocation schemes focusing on the recently proposed linear scan register allocator. We describe its implementation and extensively report on its behaviour both on register-rich and on register-poor architectures. We also investigate how different options to the basic algorithm and to the compilation process as a whole affect compilation time and quality of the produced code. Overall, the linear scan register allocator is a good choice on register-rich architectures; when compilation time is a concern, it can also be a viable option on register-poor architectures.
KeywordsVirtual Machine Basic Block Graph Coloring Physical Register Compilation Time
Unable to display preview. Download preview PDF.
- 1.A. V. Aho, R. Sethi, and J. D. Ullman. Compilers: Principles, Techniques and Tools. Addison-Wesley, Reading, MA, 1986.Google Scholar
- 2.J. Armstrong, R. Virding, C. Wikström, and M. Williams. Concurrent Programming in Erlang. Prentice-Hall, second edition, 1996.Google Scholar
- 4.G. J. Chaitin. Register allocation & spilling via graph coloring. In Proceedings of the SIGPLAN Symposium on Compiler Construction, pages 98–105. ACM Press, June 1982.Google Scholar
- 7.E. Johansson, M. Pettersson, and K. Sagonas. HiPE: A High Performance Erlang system. In Proceedings of the ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming, pages 32–43. ACM Press, Sept. 2000.Google Scholar
- 8.S. S. Muchnick. Advanced Compiler Design & Implementation. Morgan Kaufman Publishers, San Fransisco, CA, 1997.Google Scholar
- 9.J. Park and S.-M. Moon. Optimistic register coalescing. In Proceedings of the 1998 International Conference on Parallel Architecture and Compilation Techniques, pages 196–204. IEEE Press, Oct. 1998.Google Scholar
- 12.O. Traub, G. Holloway, and M. D. Smith. Quality and speed in linear-scan register allocation. In Proceedings of SIGPLAN Conference on Programming Language Design and Implementation, pages 142–151. ACM Press, June 1998.Google Scholar