Code Instruction Selection Based on SSA-Graphs

  • Erik Eckstein
  • Oliver König
  • Bernhard Scholz
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2826)


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.


Digital Signal Processor Cost Matrix Graph Grammar Cost Vector Register Allocation 
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.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Biswas, S., Balachandran, A., Dhamdhere, D.M.: Efficient retargetable code generation using bottom-up tree pattern matching. Computer Languages 15(3), 127–140 (1990)CrossRefGoogle Scholar
  2. 2.
    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)CrossRefGoogle Scholar
  3. 3.
    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)Google Scholar
  4. 4.
    Anton Ertl, M.: Optimal code selection in DAGs. In: Principles of Programming Languages (POPL 1999) (1999)Google Scholar
  5. 5.
    Fraser, C., Henry, R., Proebsting, T.: BURG – fast optimal instruction selection and tree parsing. ACM SIGPLAN Notices 27(4), 68–76 (1992)CrossRefGoogle Scholar
  6. 6.
    Fraser, C.W., Hanson, D.R.: A code generation interface for ANSI c. Software - Practice and Experience 21(9), 963–988 (1991)CrossRefGoogle Scholar
  7. 7.
    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)CrossRefGoogle Scholar
  8. 8.
    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)Google Scholar
  9. 9.
    Leupers, R.: Code generation for embedded processors. In: ISSS, pp. 173–179 (2000)Google Scholar
  10. 10.
    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)Google Scholar
  11. 11.
    Proebsting, T.A.: Least-cost instruction selection in dags is np-complete,
  12. 12.
    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)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2003

Authors and Affiliations

  • Erik Eckstein
    • 1
  • Oliver König
    • 1
  • Bernhard Scholz
    • 2
  1. 1.ATAIR Software GmbHViennaAustria
  2. 2.Institute of Computer LanguagesVienna University of TechnologyAustria

Personalised recommendations