Abstract
Commonly-used memory units enable a processor to load and store multiple registers in one instruction. We showed in 2003 how to extend gcc with a stack-location-allocation (SLA) phase that reduces memory traffic by rearranging the stack and replacing some load/store instructions with load/store-multiple instructions. While speeding up the target code, our technique leaves room for improvement because of the phase ordering of register allocation before SLA. In this paper we present SARA which combines SLA and register allocation into a single phase. SARA creates a synergy among register assignment, spill-code generation, and SLA that makes the combined phase generate faster code than a sequence of the individual phases. We specify SARA by an integer linear program generated from the program text. We have implemented SARA in gcc, replacing gcc’s own implementation of register allocation. For our benchmarks, our results show that the target code is up to 16% faster than gcc with a separate SLA phase.
Chapter PDF
Similar content being viewed by others
Keywords
- Integer Linear Program
- Basic Block
- Integer Linear Program Formulation
- Register Allocation
- Memory Instruction
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
Intel(r) IXP2400, network processor, http://www.intel.com/design/network/products/npfamily/ixp2400.htm
Allis, V.: A knowledge-based approach of connect-four–the game is solved: White wins. Technical Report IR–163, Vrije Universiteit Amsterdam (1988)
Appel, A.W., George, L.: Optimal spilling for CISC machines with few registers. In: PLDI 2001, pp. 243–253 (2001)
Austin, T.M., Breach, S.E., Sohi, G.S.: Efficient detection of all pointer and array access errors. In: PLDI 1994, pp. 290–301 (1994)
Bradlee, D., Eggers, S., Henry, R.: Integrating register allocation and instruction scheduling for riscs. In: ASPLOS 1991, pp. 122–131 (1991)
Briggs, P., Cooper, K.D., Torczon, L.: Improvements to graph coloring register allocation. ACM TOPLAS 16(3), 428–455 (1994)
Callahan, D., Koblenz, B.: Register allocation via hierarchical graph coloring. In: PLDI 1991, pp. 192–203 (1991)
Chaitin, G.J.: Register allocation and spilling via graph coloring. SIGPLAN Notices 17(6), 98–105 (1982)
Fourer, R., Gay, D.M., Kernighan, B.W.: AMPL A modeling language for mathematical programming. Scientific Press (1993)
Fredman, M.L., Tarjan, R.E.: Fibonacci heaps and their uses in improved network optimization algorithms. J. ACM 34(3), 596–615 (1987)
Fu, C., Wilken, K.: A faster optimal register allocator. In: Proceedings of ACM/IEEE MICRO 2002, pp. 245–256 (2002)
Garey, M.R., Johnson, D.S.: Computers and Intractability: A Guide to the Theory of NPCompleteness. Freeman, New York (1979)
Goodwin, D.W., Wilken, K.D.: Optimal and near-optimal global register allocations using 0-1 integer programming. Software–Practice & Experience 26(8), 929–968 (1996)
Kong, T., Wilken, K.D.: Precise register allocation for irregular architectures. In: Proceedings of ACM/IEEE MICRO 1998, pp. 297–307 (1998)
Lerner, S., Grove, D., Chambers, C.: Composing dataflow analyses and transformations. In: POPL 2002, pp. 270–282 (2002)
Liberatore, V., Farach-Colton, M., Kremer, U.: Evaluation of algorithms for local register allocation. In: Jähnichen, S. (ed.) CC 1999 and ETAPS 1999. LNCS, vol. 1575, pp. 137–152. Springer, Heidelberg (1999)
Memik, G., Mangione-Smith, B., Hu, W.: Netbench: A benchmarking suite for network processors. In: IEEE ICCAD 2001 (2001)
Motwani, R., Palem, K.V., Sarkar, V., Reyen, S.: Combining register allocation and instruction scheduling. Tech.Report CS-TN-95-22 (1995)
Naik, M., Palsberg, J.: Compiling with code-size constraints. ACM Transactions on Embedded Computing Systems 3(1), 163–181 (2004)
Krishna Nandivada, V., Palsberg, J.: Efficient spill code for SDRAM. In: CASES 2003, pp. 24–31 (2003)
Rivest, R.: The md5 message-digest algorithm. Request for Comment: 1321 (1992)
Sethi, R.: Complete register allocation problems. In: ACM STOC 1973, pp. 182–195 (1973)
Spalink, T., Karlin, S., Peterson, L.: Evaluating network processors in ip forwarding. Technical Report TR–626–00, Princeton University (2000)
Tremblay, M., Chan, J., Chaudhry, S., Conigliaro, A.W., Tse, S.S.: The majc architecture: A synthesis of parallelism and scalability. IEEE Micro. 20(6), 12–25 (2000)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Nandivada, V.K., Palsberg, J. (2006). SARA: Combining Stack Allocation and Register Allocation. In: Mycroft, A., Zeller, A. (eds) Compiler Construction. CC 2006. Lecture Notes in Computer Science, vol 3923. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11688839_19
Download citation
DOI: https://doi.org/10.1007/11688839_19
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-33050-9
Online ISBN: 978-3-540-33051-6
eBook Packages: Computer ScienceComputer Science (R0)