Abstract
Instruction selection for embedded processors is a challenging problem. Embedded system architectures feature highly irregular instruction sets and complex data paths. Traditional code generation techniques have difficulties to fully utilize the features of such architectures and typically result in inefficient code.
In this paper we describe an instruction selection technique that uses static single assignment graphs (SSA-graphs) as underlying data structure for selection. Patterns defined as graph grammar guide the instruction selection to find (nearly) optimal results. We present an approach which maps the pattern matching problem to a partitioned boolean quadratic optimization problem (PBQP). A linear PBQP solver computes optimal solutions for almost all nodes of a SSA-graph.
We have implemented our approach in a production DSP compiler. Our experiments show that our approach achieves significant better results compared to classical tree matching.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Biswas, S., Balachandran, A., Dhamdhere, D.M.: Efficient retargetable code generation using bottom-up tree pattern matching. Computer Languages 15(3), 127–140 (1990)
Cytron, R., Ferrante, J., Rosen, B.K., Wegman, M.N., Zadeck, F.K.: An efficient method of computing static single assignment form. In: ACM (ed.) POPL1989. Proceedings of the 16th annual ACM symposium on Principles of programming languages, Austin, TX, pp. 25–35. ACM Press, New York (1989)
Eckstein, E., Scholz, B.: Address mode selection. In: Proceedings of the International Symposium of Code Generation and Optimization (CGO 2003), San Francisco, March 2003. IEEE/ACM (2003)
Anton Ertl, M.: Optimal code selection in DAGs. In: Principles of Programming Languages (POPL 1999) (1999)
Fraser, C., Henry, R., Proebsting, T.: BURG – fast optimal instruction selection and tree parsing. ACM SIGPLAN Notices 27(4), 68–76 (1992)
Fraser, C.W., Hanson, D.R.: A code generation interface for ANSI c. Software - Practice and Experience 21(9), 963–988 (1991)
Gerlek, M.P., Stoltz, E., Wolfe, M.: Beyond induction variables: Detecting and classifying sequences using a demand-driven SSA form. ACM Transactions on Programming Languages and Systems 17(1), 85–122 (1995)
Emmelmann, R.L.H., Schröer, F.-W.: Beg - a generator for efficient back ends. In: SIGPLAN 1999 Conference on Programming Language Design and Implementation, pp. 227–237 (1989)
Leupers, R.: Code generation for embedded processors. In: ISSS, pp. 173–179 (2000)
Liao, S., Devadas, S., Keutzer, K., Tjiang, S.: Instruction selection using binate covering for code size optimization. In: International Conference on Computer Aided Design, pp. 393–401. IEEE Computer Society Press, Los Alamitos (1995)
Proebsting, T.A.: Least-cost instruction selection in dags is np-complete, http://research.microsoft.com/~toddpro/papers/proof.htm
Scholz, B., Eckstein, E.: Register allocation for irregular architecture. In: Proceedings of Languages, Compilers, and Tools for Embedded Systems (LCTES 2002) and Software and Compilers for Embedded Systems (SCOPES 2002), Berlin. ACM, New York (2002)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2003 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Eckstein, E., König, O., Scholz, B. (2003). Code Instruction Selection Based on SSA-Graphs. In: Krall, A. (eds) Software and Compilers for Embedded Systems. SCOPES 2003. Lecture Notes in Computer Science, vol 2826. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-39920-9_5
Download citation
DOI: https://doi.org/10.1007/978-3-540-39920-9_5
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-20145-8
Online ISBN: 978-3-540-39920-9
eBook Packages: Springer Book Archive