Chauhan, ArunKennedy, KenMcCosh, Cheryl2017-08-022017-08-022003-01-17Chauhan, Arun, Kennedy, Ken and McCosh, Cheryl. "Type-Based Speculative Specialization in a Telescoping Compiler for MATLAB." (2003) https://hdl.handle.net/1911/96308.https://hdl.handle.net/1911/96308Telescoping languages is a strategy to automatically generate highly-optimized domain-specific libraries. The key idea is to create specialized variants of library procedures through extensive offline processing. This paper describes a telescoping system, called ARGen, which generates high-performance Fortran or C libraries from prototype Matlab code for the linear algebra library, ARPACK. ARGen uses variable types to guide procedure specializations on possible calling contexts. We show that type-based specializations of generated libraries can lead to more than 50% speedup. ARGen needs to infer Matlab types in order to speculate on the possible variants of library procedures, as well as to generate code. This paper develops an approach combining static and dynamic type inference that includes a graph-theoretic algorithm that is shown to be efficient under a set of conditions that are easily met for most practical cases. The ideas developed here provide a basis for building a more general telescoping system for Matlab.14 ppengYou are granted permission for the noncommercial reproduction, distribution, display, and performance of this technical report in any format, but this permission is only for a period of forty-five (45) days from the most recent time that you verified that this technical report is still available from the Computer Science Department of Rice University under terms that include this permission. All other rights are reserved by the author(s).Type-Based Speculative Specialization in a Telescoping Compiler for MATLABTechnical reportTR03-411