Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Telescoping Languages: A Compiler Strategy for Implementation of High-Level Domain-Specific Programming Systems Ken Kennedy Rice University."— 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 Solution 1:Translate to Low-level DeRose/Padua, Int. Conf. Supercomputing,1996 Use global optimization on low-level code component library user library script intermediate code translator global optimizer code generator

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

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 Domain Library Language- Building Compiler Script Translator Enhanced- Language Compiler User Script Optimized Object Program Annotations could run for hours understands library calls as primitives Telescoping Languages

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

8 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 Optimization Strategies

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 ! X known > 0 inline(X-1) ! X known <= 0 inline(X) ! X unknown inline( (X>0 ? X-1 : X) ) 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

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 Discussion : Loss of portability? Supporting performance portability —Compute specialized implementations, along with jump functions for each public interface —Specialize the code for each target machine

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


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

Similar presentations


Ads by Google