Typed Intermediate Languages for Shape Analysis

نویسندگان

  • Gianna Bellè
  • Eugenio Moggi
چکیده

We introduce S2, a typed intermediate language for vectors, based on a 2level type-theory, which distinguishes between compile-time and run-time. The paper shows how S2 can be used to extract useful information from programs written in the Nested Sequence Calculus NSC, an idealized high-level parallel calculus for nested sequences. We study two translations from NSC to S2. The most interesting shows that shape analysis (in the sense of Jay) can be handled at compile-time. Good intermediate languages are an important prerequisite for program analysis and optimization, the main purpose of such languages is to make as explicit as possible the information that is only implicit in source programs (see [18]). A common features of such intermediate languages is an aggressive use of types to incorporate additional information, e.g.: binding times (see [18]), boxed/unboxed values (see [20]), effects (see [23]). In particular, among the ML community the use of types in intermediate languages has been advocated for the TIL compiler (see [9]) and for region inference (see [24, 1]). In areas like parallel programming, where efficiency is a paramount issue, good intermediate languages are even more critical to bridge the gap between high-level languages (e.g. NESL) and efficient implementations on a variety of architectures (see [2, 3, 22]). However, in this area of computing intermediate languages (e.g. VCODE) have not made significant use of types, yet. This paper proposes a typed intermediate language S2 for vector languages, and shows how it may be used to extract useful information from programs written in the Nested Sequence Calculus NSC (see [22]), an idealized vector language very closed to NESL. For an efficient compilation of NSC (and similar languages) on parallel machines it is very important to know in advance the size of vectors (more generally the shape of data structures). We study two translations from the NSC to S2. The most interesting one separates what can be computed at compile-time from what must be computed at run-time, in particular array bound-checking can be done at compile-time (provided the while-loop of NSC is replaced by a for-loop). Section 1 introduces the two-level calculus S2 and outlines its categorical semantics. Section 2 summarizes the high-level language NSC, outlines two translations from NSC in S2 and the main results about them. Sections 3 and 4 give the syntactic details of the translations. Appendix A gives a formal description of S2 and defines auxiliary notation and notational conventions used in the paper.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Type-Directed Flow Analysis for Typed Intermediate Languages

Flow analysis is especially valuable for optimizing functional languages because control-ow information is not syntactically apparent in higher-order programs. Flow analyses typically operate on untyped languages. However, recent compilers for typed functional languages such as ML and Haskell use a typed intermediate language to expose data representations for optimization. This paper presents ...

متن کامل

Typed Intermediate Languages

Programs written in a typed language are guaranteed to satisfy the safety properties of the type system without runtime checks. A type system for an intermediate language allows static verification of safety properties independent of source languages, and opens up opportunities for advanced compiler optimizations. This paper surveys three major intermediate languages: Java bytecode, typed assem...

متن کامل

A Typed Intermediate Language for Supporting Multiple Inheritance via Interfaces

Some object-oriented languages, such as Java and C#, provide interfaces as a feature for supporting a restricted form of multiple inheritance. Most typed intermediate languages for compiling object-oriented languages do not support interfaces or multiple inheritance. This paper describes a typed intermediate language that supports interface implementation strategies based on interface tables (i...

متن کامل

A Typed Intermediate Language for Flow-Directed Compilation

We present a typed intermediate language λ for optimizing compilers for function-oriented and polymorphically typed programming languages (e.g., ML). The language λ is a typed lambda calculus with product, sum, intersection, and union types as well as function types annotated with flow labels. A novel formulation of intersection and union types supports encoding flow information in the typed pr...

متن کامل

Henk: a typed intermediate language

There is growing interest in the use of richly-typed intermediate languages in sophisticated compilers for higher-order, typed source languages. These intermediate languages are typically stratiied, involving terms, types, and kinds. As the sophistication of the type system increases, these three levels begin to look more and more similar, so an attractive approach is to use a single syntax, an...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1997