Global analysis for partitioning non-strict programs into sequential threads

In this paper we present a new solution to the problem ofcompiling aneager, non-strict language into multiple se-quential threads. The solution is described using an in-termediate program form developed for the programminglanguage Id [Nik90], a functional language extended withI-structures [ANP86] and M-structures [BNA91]. A similarintermediate form has also been suggested for imperativelanguages [BP89], as a way of exposing parallelism in thoselanguages. With suitable restrictions, we believe our methodis also appropriate for lazy, purely functional languages suchas Haskell [HWe90].Throughout this paper, a thread will mean a subset ofthe instructions comprising a procedure body, such that:1. A compile-time instruction ordering can be determinedfor the thread which is valid for all contexts in whichthe containing procedure can be invoked.2. Once the first instruction in a thread is executed, itis always possible to execute each of the remaining in-structions, in the compile-time ordering, without pause,interruption, or execution of instructions from otherthreads. [Tra91b]Threads of this form are required to implement a languageon parallel multithreaded hardware (e.g., Monsoon [PT91,PC90] and *T [N PA92]), and they yield efficient implemen-tations on conventional architectures when combined with asuit able abstract machine such as TAM [CSS+ 91],Our algorithms are greedy, and the following commentsfrom [SCVE91] apply:Partitioning decisions imply trade-offs betweenpa~allelism, synchronization cost, and sequentialefficiency. However, given the limits on threadsize imposed by the language model, the use ofsplit-phase accesses, and the control paradigm,we simply attempt to make partitions as large aspossible . . .]

[1]  Kenneth R. Traub Implementation of non-strict functional programming languages , 1991, Research monographs in parallel and distributed computing.

[2]  Keshav Pingali,et al.  I-structures: data structures for parallel computing , 1986, Graph Reduction.

[3]  Kenneth R. Traub,et al.  Compilation as partitioning: a new approach to compiling non-strict functional languages , 1989, FPCA.

[4]  Chris Hankin,et al.  The theory of strictness analysis for higher order functions , 1985, Programs as Data Objects.

[5]  Arvind,et al.  T: a multithreaded massively parallel architecture , 1992, ISCA '92.

[6]  Robert A. Iannucci,et al.  Parallel Machines: Parallel Machine Languages , 1990 .

[7]  Kenneth R. Traub,et al.  Multi-thread Code Generation for Dataflow Architectures from Non-Strict Programs , 1991, FPCA.

[8]  Keshav Pingali,et al.  From Control Flow to Dataflow , 1991, J. Parallel Distributed Comput..

[9]  Arvind,et al.  M-Structures: Extending a Parallel, Non-strict, Functional Language with State , 1991, FPCA.

[10]  Arvind,et al.  Executing a Program on the MIT Tagged-Token Dataflow Architecture , 1987, IEEE Trans. Computers.

[11]  Simon L. Peyton Jones,et al.  Report on the programming language Haskell: a non-strict, purely functional language version 1.2 , 1992, SIGP.

[12]  Kenneth R. Traub,et al.  Multithreading: a revisionist view of dataflow architectures , 1991, ISCA '91.

[13]  K. R. Traub,et al.  A COMPILER FOR THE MIT TAGGED-TOKEN DATAFLOW ARCHITECTURE , 1986 .

[14]  Paul Hudak,et al.  Code optimizations for lazy evaluation , 1988, LISP Symb. Comput..

[15]  Thomas Johnsson,et al.  Target code generation from G-machine code , 1987, Graph Reduction.

[16]  David E. Culler,et al.  Compiler-Controlled Multithreading for Lenient Parallel Languages , 1991, FPCA.

[17]  David E. Culler,et al.  Fine-grain parallelism with minimal hardware support: a compiler-controlled threaded abstract machine , 1991, ASPLOS IV.

[18]  Joe D. Warren,et al.  The program dependence graph and its use in optimization , 1987, TOPL.

[19]  V. Gerald Grafe,et al.  Compile-time partitioning of a non-strict language into sequential threads , 1991, Proceedings of the Third IEEE Symposium on Parallel and Distributed Processing.

[20]  Zena M. Ariola,et al.  P-TAC: a parallel intermediate language , 1989, FPCA.

[21]  Alan Mycroft,et al.  The Theory and Practice of Transforming Call-by-need into Call-by-value , 1980, Symposium on Programming.