1 / 14

Telescoping Languages: A Compiler Strategy for Implementation of High-Level Domain-Specific

Telescoping Languages: A Compiler Strategy for Implementation of High-Level Domain-Specific Programming Systems Ken Kennedy Rice University. Motivation. Background Increasing Complexity of Computer Architectures and Application Structures Difficulty of high-performance programming

cecile
Download Presentation

Telescoping Languages: A Compiler Strategy for Implementation of High-Level Domain-Specific

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Telescoping Languages: A Compiler Strategy for Implementation of High-Level Domain-Specific Programming Systems Ken Kennedy Rice University

  2. Motivation • Background • Increasing Complexity of Computer Architectures and Application Structures • Difficulty of high-performance programming • Need to allow end-user to develop applications • Use scripting languages like MATLAB, VisualBasic • Problems • Performance limited : Interpreted • Treats Libraries as black boxes • Rewrite in C/C++/FORTRAN for “production” work

  3. component library global optimizer code generator translator intermediate code user library script Solution 1:Translate to Low-level • DeRose/Padua, Int. Conf. Supercomputing,1996 • Use global optimization on low-level code

  4. component library global optimizer code generator translator intermediate code user library script Solution 1:Translate to Low-level • Problems: • Potentially high compilation times, even for simple scripts • Expert knowledge about libraries lost

  5. Telescoping Languages • The Goals • Perform fast local optimization within scripts • Generate efficient code from script quickly • The Solution • Extensively pre-compile and optimize library implementations • Maintain database of precompiled libraries • Use language building compiler to produce enhanced script compiler that supports library calls as language primitives • Can be done in iterations

  6. Enhanced-Language Compiler Optimized Object Program Script Translator User Script Annotations understands library calls as primitives Language-BuildingCompiler Domain Library could run for hours Telescoping Languages

  7. Language-BuildingCompiler Annotations Enhanced-Language Compiler Optimized Object Program Script Translator User Script Annotations Domain Library Language-BuildingCompiler Telescoping Languages

  8. Optimization Strategies • Construction of Jump Functions • Summarize the value of output parameters for a particular procedure in terms of its inputs • Allows instant propagation of parameter properties (type and value) through procedure calls at script compilation time • Library compilation computes Jump Functions for every public interface • Helps inter-procedural analysis • Compositions of JFs need to account for special versions of procedures

  9. Construction of Jump Functions: Example PROGRAM MAIN V =1 N =0 DO WHILE(V>0) V = FUNC(V) N =N +1 ENDDO PRINT N END MAIN REAL FUNCTION FUNC(X) ! Part of library IF (X>0) THEN RETURN (X-1) ELSE RETURN X ENDIF END FUNC PROGRAM MAIN V =1 N =0 ! DO eliminated V =V -1 N =N +1 ! ENDDO eliminated PRINT N END MAIN PROGRAM MAIN PRINT 1 END MAIN ! X known > 0 inline(X-1) ! X known <= 0 inline(X) ! X unknown inline( (X>0 ? X-1 : X) )

  10. Optimization Strategies • Reverse Program Analysis • Identify points of profitable optimization within procedure • Propagate information backward to procedure interface • Can work across inter-library interfaces • Recognition and exploitation of identities • Specify when it is safe to replace composite library calls with efficient specialized code at script compilation time • Example: Replacing a PUSH followed immediately by a POP for calls to a stack library

  11. Implementation • Steps in Script Compilation • Calculate Jump Functions • Analyze propagation of variable properties (value and type) • At each invocation point for libraries, select most specialized code given the variable properties • Substitute the selected code inline • Supporting performance portability • Compute specialized implementations, along with jump functions for each public interface • Specialize the code for each target machine • Discussion : Loss of portability?

  12. Advantages • Reliability • Script compiler can validate parameters • Libraries can specify correctness conditions • Client-Server communications • Optimize application along with interface specific part of code • Perform strength reductions for remote calls • Protection of Source Code • Allows library developer to prohibit inlining of specific portions of code

  13. Discussions • Dealing with variation in application data structures • Solution: Trade code space for configurability? • Select from alternative implementations at run time • Scope for more optimizations • Further work : Chauhan & Kennedy, “Optimizing Strategies for Telescoping Languages: Procedure Strength Reduction and Procedure Vectorization”, Proceedings of the 15th ACM International Conference on Supercomputing, June 16-21, 2001 • Comparison with alternative approaches

  14. Thank You

More Related