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.
KeywordsIndex Vector Primitive Function Abstract Syntax Tree Cache Performance Intermediate Language
Unable to display preview. Download preview PDF.
- 1.Cann, D.C.: Compilation Techniques for High Performance Applicative Computation. PhD thesis, Computer Science Department, Colorado State University (1989)Google Scholar
- 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.Dutertre, B., de Moura, L.: The yices smt solver. Technical report, SRI International (2006)Google Scholar
- 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
- 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
- 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.Mucci, P.: Papiex - execute arbitrary application and measure hardware performance counters with papi (2009)Google Scholar
- 15.Bernecky, R.: APEX: The APL Parallel Executor. Master’s thesis, University of Toronto (1997)Google Scholar
- 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
- 18.Xi, H., Pfenning, F.: Dependent Types in Practical Programming. In: POPL 1999, pp. 214–227. ACM Press, New York (1999)Google Scholar