Symbiotic Expressions

  • Robert Bernecky
  • Stephan Herhut
  • Sven-Bodo Scholz
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6041)


We introduce symbiotic expressions, a method for algebraic simplification within a compiler, in lieu of an SMT solver, such as Yices or the Omega Calculator. Symbiotic expressions are compiler-generated expressions, temporarily injected into a program’s abstract syntax tree (AST). The compiler’s normal optimizations interpret and simplify those expressions, making their results available for the compiler to use as a basis for decisions about further optimization of the source program. The expressions are symbiotic, in the sense that both parties benefit: an optimization benefits, by using the compiler itself to simplify expressions that have been attached, lamprey-like, to the AST by the optimization; the program being compiled benefits, from improved run-time in both serial and parallel environments.

We show the utility of symbiotic expressions by using them to extend the SAC compiler’s With-Loop-Folding optimization, currently limited to Arrays of Known Shape (AKS), to Arrays of Known Dimensionality (AKD). We show that, in conjunction with array-based constant-folding, injection and propagation of array extrema, and compiler-based expression simplification, symbiotic expressions are an effective tool for implementing advanced array optimizations. Symbiotic expressions are also simpler and more likely to be correct than hard-coded analysis, and are flexible and relatively easy to use. Finally, symbiotic expressions are synergistic: they take immediate advantage of new or improved optimizations in the compiler. Symbiotic expressions are a useful addition to a compiler writer’s toolkit, giving the compiler a restricted subset of the analysis power of an SMT solver.


Index Vector Primitive Function Abstract Syntax Tree Cache Performance Intermediate Language 
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.
    Cann, D.C.: Compilation Techniques for High Performance Applicative Computation. PhD thesis, Computer Science Department, Colorado State University (1989)Google Scholar
  2. 2.
    Bacon, D.F., Graham, S.L., Sharp, O.J.: Compiler transformations for high-performance computing. ACM Computing Surveys 26, 345–420 (1994)CrossRefGoogle Scholar
  3. 3.
    Padua, D., Wolfe, M.: Advanced Compiler Optimizations for Supercomputers. ACM Comm. 29, 1184–1201 (1986)CrossRefGoogle Scholar
  4. 4.
    Scholz, S.B.: Single Assignment C — efficient support for high-level array operations in a functional setting. Journal of Functional Programming 13, 1005–1059 (2003)MathSciNetCrossRefzbMATHGoogle Scholar
  5. 5.
    Scholz, S.B.: With-loop-folding in sac–Condensing Consecutive Array Operations. In: Clack, C., Hammond, K., Davie, T. (eds.) IFL 1997. LNCS, vol. 1467, pp. 72–92. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  6. 6.
    Rugina, R., Rinard, M.: Symbolic bounds analysis of pointers, array indices, and accessed memory regions. In: PLDI 2000 Conference Proceedings, pp. 182–195. ACM, New York (2000)Google Scholar
  7. 7.
    Dutertre, B., de Moura, L.: The yices smt solver. Technical report, SRI International (2006)Google Scholar
  8. 8.
    Pugh, W.: A practical algorithm for exact array dependence analysis. CACM 35, 102–115 (1992)CrossRefGoogle Scholar
  9. 9.
    Kelly, W., Maslov, V., Pugh, W., Rosser, E., Shpeisman, T., Wonnacott, D.: The OMEGA library, version 1.1.0 interface guide. Technical report, University of Maryland (1996)Google Scholar
  10. 10.
    Trojahner, K., Grelck, C., Scholz, S.B.: On Optimising Shape-Generic Array Language Programs using Symbolic Structural Information. In: Horváth, Z., Zsók, V., Butterfield, A. (eds.) IFL 2006. LNCS, vol. 4449, pp. 1–18. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  11. 11.
    Cytron, R., Ferrante, J., Rosen, B.K., Wegman, M.N., Zadeck, F.K.: An efficient method for computing static single assignment form. In: Conference Record of the Sixteenth Annual ACM Symposium on Principles of Programming Languages, pp. 23–35 (1989)Google Scholar
  12. 12.
    Herhut, S., Scholz, S.B., Bernecky, R., Grelck, C., Trojahner, K.: From contracts towards dependent types: Proofs by partial evaluation. In: Chitil, O., Horváth, Z., Zsók, V. (eds.) IFL 2007. LNCS, vol. 5083, pp. 254–273. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  13. 13.
    Browne, S., Deane, C., Ho, G., Mucci, P.: Papi: A portable interface to hardware performance counters. In: HPCMP Users Group Conference, U.S Department of Defense (1999)Google Scholar
  14. 14.
    Mucci, P.: Papiex - execute arbitrary application and measure hardware performance counters with papi (2009)Google Scholar
  15. 15.
    Bernecky, R.: APEX: The APL Parallel Executor. Master’s thesis, University of Toronto (1997)Google Scholar
  16. 16.
    Menon, V.S., Glew, N., Murphy, B.R., McCreight, A., Shpeisman, T., Tabatabai, A.-R., Petersen, L.: A verifiable SSA program representation for aggressive compiler optimization. In: POPL 2006 Conference Proceedings, pp. 397–408. ACM, New York (2006)Google Scholar
  17. 17.
    Freeman, T., Pfenning, F.: Refinement types for ml. SIGPLAN Not. 26, 268–277 (1991)CrossRefGoogle Scholar
  18. 18.
    Xi, H., Pfenning, F.: Dependent Types in Practical Programming. In: POPL 1999, pp. 214–227. ACM Press, New York (1999)Google Scholar
  19. 19.
    Rushby, J., Owre, S., Shankar, N.: Subtypes for specifications: Predicate subtyping in PVS. IEEE Transactions on Software Engineering 24, 709–720 (1998)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • Robert Bernecky
    • 1
  • Stephan Herhut
    • 2
  • Sven-Bodo Scholz
    • 2
  1. 1.Snake Island Research IncTorontoCanada
  2. 2.University of HertfordshireU.K.

Personalised recommendations