Compiler Transformation of Pointers to Explicit Array Accesses in DSP Applications
Efficient implementation of DSP applications is critical for embedded systems. However, current applications written in C, make extensive use of pointer arithmetic making compiler analysis and optimisation difficult. This paper presents a method for conversion of a restricted class of pointer-based memory accesses typically found in DSP codes into array accesses with explicit index functions. C programs with pointer accesses to array elements, data independent pointer arithmetic and structured loops can be converted into semantically equivalent representations with explicit array accesses. This technique has been applied to several DSPstone benchmarks on three different processors where initial results show that this technique can give on average a 11.95 % reduction in execution time after transforming pointer-based array accesses into explicit array accesses.
KeywordsDigital Signal Processing Loop Nest Pointer Arithmetic Control Flow Graph Loop Body
- 1.Allen R. and Johnson S., Compiling C for Vectorization, Parallelization, and Inline Expansion, Proceedings of the SIGPLAN’ 88 Conference of Programming Languages Design and Implementation, pp. 241–249, Atlanta, Georgia, June 22-24, 1988Google Scholar
- 2.de Araujo, Guido C.S., Code Generation Algorithms for Digital Signal Processors, Dissertation, Princeton University, Department of Electrical Engineering, June 1997.Google Scholar
- 3.Duesterwald E., Gupta R. and Soffa M., A Practical Data Flow Framework for Array Reference Analysis and its Use in Optimizations, Proceedings of the SIGPLAN Conference on Programming Languages Design and Implementation, 28(6), pp. 67–77, Albuquerque, New Mexico, 1993.Google Scholar
- 4.Kernighan, Brian W. and Ritchie, The C Programming Language, Second Edition, Prentice Hall, Englewood Cliffs, New Jersey, 1988.Google Scholar
- 5.Leupers R., Novel Code Optimzation Techniques for DSPs, 2nd European DSP Education and Research Conference, Paris, France, 1998.Google Scholar
- 6.Liem C., Paulin P., Jerraya A., Address Calculation for Retargetable Compilation and Exploration of Instruction-Set Architectures Proceedings of the 33rd Design Automation Conference, Las Vegas, Nevada 1996.Google Scholar
- 7.Lu, J., Interprocedural Pointer Analysis for C, Ph.D. thesis, Department of Computer Science, Rice University, Houston, Texas, 1998. SASIMI, Osaka, 1997.Google Scholar
- 9.Muchnick, Steven. S., Advanced Compiler Design and Implementation, Morgan Kaufmann Publishers, San Francisco, California, 1997.Google Scholar
- 10.Numerix-DSP Digital Signal Processing Web Site, http://www.numerix-dsp.com/c_coding.pdf, 2000.
- 11.O’Boyle M.F.P and Knijnenberg P.M.W., Integrating Loop and Data Transformat ions for Global Optimisation, PACT’ 98, Parallel Architectures and Compiler Technology, IEEE Press, October 1998.Google Scholar
- 12.Wilson, R.P., Efficient Context-Sensitive Pointer Analysis for C Programs, Ph.D. thesis, Stanford University, Computer Systems Laboratory, December 1997.Google Scholar
- 13.Zivojnovic, V., Velarde J.M., Schlager C. and Meyr H., DSPstone: A DSP-Oriented Benchmarking Methodology, Proceedings of Signal Processing Applications & Technology, Dallas 1994.Google Scholar
- 14.Zima H., Supercompilers for Parallel and Vector Computers, ACM Press, 1991.Google Scholar