Abstract
Program specialization optimizes a program with respect to program invariants, including known, fixed inputs. These invariants can be used to enable optimizations that are otherwise unsound. In many applications, a program input induces predictable patterns of values across loop iterations, yet existing specializers cannot fully capitalize on this opportunity. To address this limitation, we present Invariant-induced Pattern based Loop Specialization (IPLS), the first fully-automatic specialization technique designed for everyday use on real applications. Using dynamic information-flow tracking, IPLS profiles the values of instructions that depend solely on invariants and recognizes repeating patterns across multiple iterations of hot loops. IPLS then specializes these loops, using those patterns to predict values across a large window of loop iterations. This enables aggressive optimization of the loop; conceptually, this optimization reconstructs recurring patterns induced by the input as concrete loops in the specialized binary. IPLS specializes real-world programs that prior techniques fail to specialize without requiring hints from the user. Experiments demonstrate a geomean speedup of 14.1% with a maximum speedup of 138% over the original codes when evaluated on three script interpreters and eleven scripts each.
- R. Allen and K. Kennedy. Optimizing compilers for modern architectures: a dependence-based approach. Morgan Kaufmann Publishers Inc., 2002. Google ScholarDigital Library
- L. O. Andersen. Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, University of Copenhagen, May 1994.Google Scholar
- V. Bala, E. Duesterwald, and S. Banerjia. Dynamo: A transparent dynamic optimization system. In Proceedings of the ACM SIGPLAN '00 Conference on Programming Language Design and Implementation, pages 1--12, June 2000. Google ScholarDigital Library
- A. Berlin. Partial evaluation applied to numerical computation. In Proceedings of the 1990 ACM conference on LISP and functional programming, pages 139--150, 1990. Google ScholarDigital Library
- A. Berlin and D. Weise. Compiling scientific code using partial evaluation. IEEE Computer, 23:25--37, December 1990. Google ScholarDigital Library
- C. F. Bolz, A. Cuni, M. Fijalkowski, and A. Rigo. Tracing the meta-level: PyPy's tracing JIT compiler. In Proceedings of the 4th workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems, pages 18--25, 2009. Google ScholarDigital Library
- Computer Language Benchmarks Game. http://shootout.alioth.debian.org/.Google Scholar
- C. Consel, L. Hornof, F. Noel, J. Noyé, and N. Volansche. A uniform approach for compile-time and run-time specialization. In Selected Papers from the International Seminar on Partial Evaluation, pages 54--72, 1996. Google ScholarDigital Library
- C. Consel, J. L. Lawall, and A.-F. Le Meur. A tour of Tempo: a program specializer for the C language. Science of Computer Programming, 52:341--370, August 2004. Google ScholarDigital Library
- C. Consel and F. Noel. A general approach for run-time specialization and its application to C. In Proceedings of the ACM Symposium on Principles of Programming Languages, pages 145--156, January 1996. Google ScholarDigital Library
- A. Gal, B. Eich, M. Shaver, D. Anderson, D. Mandelin, M. R. Haghighat, B. Kaplan, G. Hoare, B. Zbarsky, J. Orendorff, J. Ruderman, E. W. Smith, R. Reitmaier, M. Bebenita, M. Chang, and M. Franz. Trace-based just-in-time type specialization for dynamic languages. In Proceedings of the 2009 ACM SIGPLAN conference on Programming language design and implementation, pages 465--478, 2009. Google ScholarDigital Library
- B. Grant, M. Mock, M. Philipose, C. Chambers, and S. Eggers. Annotation-directed run-time specialization in C. In Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation\ (PEPM), pages 163--178, June 1997. Google ScholarDigital Library
- B. Grant, M. Philipose, M. Mock, C. Chambers, and S. Eggers. An evaluation of staged run-time optimizations in DyC. In Proceedings of the ACM SIGPLAN Symposium on Programming Language Design and Implementation, pages 293--304, May 1999. Google ScholarDigital Library
- N. D. Jones, P. Sestoft, and H. Søndergaard. An experiment in partial evaluation: the generation of a compiler generator. ACM SIGPLAN Notices, 20:82--87, August 1985. Google ScholarDigital Library
- P. Kleinrubatscher, A. Kriegshaber, R. Zöchling, and R. Glück. FORTRAN program specialization. ACM SIGPLAN Notices, 30:61--70, April 1995. Google ScholarDigital Library
- C. Lattner and V. Adve. LLVM: A compilation framework for lifelong program analysis & transformation. In CGO '04: Proceedings of the International Symposium on Code Generation and Optimization, page 75, 2004. Google ScholarDigital Library
- Lua. http://www.lua.org/.Google Scholar
- H. Makholm. Specializing C -- an introduction to the principles behind C-Mix/II. Technical report, University of Copenhagen, Department of Computer Science, 1999.Google Scholar
- H. Masuhara and A. Yonezawa. Run-time bytecode specialization. In Proceedings of the Second Symposium on Programs as Data Objects, pages 138--154, 2001. Google ScholarDigital Library
- M. Mock, M. Berryman, C. Chambers, and S. Eggers. Calpa: A tool for automating dynamic compilation. In Proceedings of the Second Workshop on Feedback-Directed Optimization, pages 100--109, November 1999. Google ScholarDigital Library
- F. Noel, L. Hornof, C. Consel, and J. L. Lawall. Automatic, template-based run-time specialization: Implementation and experimental study. In Proceedings of the 1998 International Conference on Computer Languages, 1998. Google ScholarDigital Library
- Perl. http://www.perl.org/.Google Scholar
- Python. http://www.python.org/.Google Scholar
- U. P. Schultz, J. L. Lawall, and C. Consel. Automatic program specialization for Java. ACM Transactions on Programming Languages and Systems, 25:452--499, July 2003. Google ScholarDigital Library
- A. Shankar, S. S. Sastry, R. Bodık, and J. E. Smith. Runtime specialization with optimistic heap analysis. In Proceedings of the 20th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pages 327--343, 2005. Google ScholarDigital Library
- G. E. Suh, J. W. Lee, D. Zhang, and S. Devadas. Secure program execution via dynamic information flow tracking. In Proceedings of the 11th international conference on Architectural support for programming languages and operating systems, pages 85--96, 2004. Google ScholarDigital Library
- Q. Wu, A. Pyatakov, A. N. Spiridonov, E. Raman, D. W. Clark, and D. I. August. Exposing memory access regularities using object-relative memory profiling. In Proceedings of the International Symposium on Code Generation and Optimization, 2004. Google ScholarDigital Library
- A. Yermolovich, C. Wimmer, and M. Franz. Optimization of dynamic languages using hierarchical layering of virtual machines. In Proceedings of the 5th symposium on Dynamic languages, pages 79--88, 2009. Google ScholarDigital Library
- M. Zaleski, A. D. Brown, and K. Stoodley. YETI: a graduallY extensible trace interpreter. In Proceedings of the 3rd international conference on Virtual execution environments, pages 83--93, 2007. Google ScholarDigital Library
Index Terms
- Practical automatic loop specialization
Recommendations
Practical automatic loop specialization
ASPLOS '13: Proceedings of the eighteenth international conference on Architectural support for programming languages and operating systemsProgram specialization optimizes a program with respect to program invariants, including known, fixed inputs. These invariants can be used to enable optimizations that are otherwise unsound. In many applications, a program input induces predictable ...
Practical automatic loop specialization
ASPLOS '13Program specialization optimizes a program with respect to program invariants, including known, fixed inputs. These invariants can be used to enable optimizations that are otherwise unsound. In many applications, a program input induces predictable ...
Abstract specialization and its applications
Proceedings of the ACM SIGPLAN symposium on principles and practice of parallel programming (PPoPP 2003) and workshop on partial evaluation and semantics-based program manipulation (PEPM 2003)The aim of program specialization is to optimize programs by exploiting certain knowledge about the context in which the program will execute. There exist many program manipulation techniques which allow specializing the program in different ways. Among ...
Comments