Abstract
An important issue in embedded systems design is the size of programs. As computing devices decrease in size, yet with more and more functions, better code size optimizations are in greater demand. For an embedded RISC processor, where the use of compact instructions (e.g., the ARM Thumb) restricts the number of accessible registers at the expense of a potential increase in spill code, a significant proportion of instructions load or store to memory.
In this paper we present a new technique which both identifies sequences of single load and store instructions for combining into multiple load and store instructions, and guides the layout of function stack frames, global storage and register allocation, previously only seemingly done by opportunistic optimization. We implement this in our SolveMMA algorithm, similar to Liao’s Simple Offset Assignment algorithm.
We implement our algorithm within the Value State Dependence Graph framework, describe how the algorithm is specialized for specific processors, and use the ARM Thumb as a concrete example for analysis.
Chapter PDF
Similar content being viewed by others
Keywords
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
i486 Processor Programmer’s Reference Manual. Intel Corp./Osborne McGraw- Hill, San Francisco (1990)
Aho, A., Hopcroft, J., Ullman, J.: The Design and Analysis of Computer Algorithms. Addison Wesley, Reading (1974)
Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques and Tools. Addison Wesley, Reading (1986)
Bartley, D.H.: Optimizing Stack Frame Accesses for Processors with Restricted Addressing Modes. Software—Practice and Experience 22(2), 101–110 (1992)
Cytron, R.K., Ferrante, J., Rosen, B.K., Wegman, M.N., Zadeck, F.K.: Efficiently Computing the Static Single Assignment Form and the Control Dependence Graph. ACM Trans. Programming Languages and Systems 12(4), 451–490 (1991)
Fisher, R.J., Dietz, H.G.: Compiling For SIMD Within A Register. In: Carter, L., Ferrante, J., Sehr, D., Chatterjee, S., Prins, J.F., Li, Z., Yew, P.-C. (eds.) LCPC 1998. LNCS, vol. 1656, pp. 290–304. Springer, Heidelberg (1999)
Fraser, C.W., Hanson, D.R.: A Retargetable C Compiler: Design and Implementation. Benjamin/Cummings (1995)
Johnson, N., Mycroft, A.: Combined Code Motion and Register Allocation using the Value State Dependence Graph. In: Hedin, G. (ed.) CC 2003. LNCS, vol. 2622, pp. 1–16. Springer, Heidelberg (2003)
Kissell, K.: MIPS16: High-density MIPS for the Embedded Market. In: Proc. Conf. Real Time Systems, RTS 1997 (1997)
Koseki, A., Komatsu, H., Nakatani, T.: Preference-Directed Graph Coloring. In: Proc. ACM SIGPLAN 2002 Conference on Prog. Lang. Design and Implementation, June 2002, pp. 33–44. ACM Press, New York (2002)
Lee, C., Potkonjak, M., Mangione-Smith, W.H.: Mediabench: A Tool for Evaluating and Synthesizing Multimedia and Communications Systems. In: Proc. 30th Intl. Symp. Microarchitectures (MICRO’30), December 1997, pp. 330–335. ACM/IEEE (1997)
Leupers, R., Marwedel, P.: Algorithms for Address Assignment in DSP Code Generation. In: Proceedings of the 1996 IEEE/ACM International Conference on Computer-Aided Design, pp. 109–112. IEEE Computer Society Press, Los Alamitos (1996)
Liao, S., Devadas, S., Keutzer, K., Tjiang, S., Wang, A.: Storage Assignment to Decrease Code Size. In: Proceedings of the ACM SIGPLAN 1995 conference on Programming Language Design and Implementation, June 1995, pp. 186–195. ACM Press, New York (1995)
Rao, A., Pande, S.: Storage Assignment Optimizations to Generate Compact and Efficient Code on Embedded DSPs. In: Proc. ACM SIGPLAN Conf. on Prog. Lang. Design and Implementation, pp. 128–138. ACM Press, New York (1999)
Seal, D.: ARM Architecture Reference Manual. Addison-Wesley, UK (2000)
Udayanarayanan, S., Chakrabarti, C.: Address Code Generation for Digital Signal Processors. In: Proceedings of the 38th Conference on Design Automation, pp. 353–358. ACM Press, New York (2001)
Weise, D., Crew, R.F., Ernst, M., Steensgaard, B.: Value Dependence Graphs: Representation Without Taxation. In: ACM SIGPLAN-SIGACT Symp. on Principles of Prog. Langs (POPL), January 1994. ACM, New York (1994)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2004 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Johnson, N., Mycroft, A. (2004). Using Multiple Memory Access Instructions for Reducing Code Size. In: Duesterwald, E. (eds) Compiler Construction. CC 2004. Lecture Notes in Computer Science, vol 2985. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-24723-4_18
Download citation
DOI: https://doi.org/10.1007/978-3-540-24723-4_18
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-21297-3
Online ISBN: 978-3-540-24723-4
eBook Packages: Springer Book Archive