Compile-Time Analysis of Explicitly Parallel Programs

Explicit parallelism not only complicates the semantics of a programming language, but also invalidates most current compiler techniques for program analyses and optimizations. The problem stems from the inadequacy of control flow graphs to describe information flows in a parallel program, and the insufficiency of data dependences and control dependences to describe the constraints for a correct execution. Because of the difficulties in analyzing explicitly parallel programs, most compilers simply side-step the problems either by restricting data sharing among concurrent activities or not optimizing parallel codes. Some even produce wrong codes that violate the program semantics. This work proposes a general framework for analyzing parallel programs where concurrent activities interact through shared variables and presents the analyses of side effects, data dependences, object lifetimes, and concurrent expressions for a language with dynamic allocations, pointers, first-class functions, and cobegin parallelism. This framework is based on abstract interpretation, a semantics-based analysis technique. We present a formal semantics of the language, based on a labeled transition system. Because every possible interaction between concurrent activities has to be considered, the state space of the analysis must be reduced. We approach this problem in two ways: eliminating redundant interleavings, which do not contribute to final results, and abstract interpretation, which provides systematic methods for combing related states. An iterative algorithm is presented for state space reduction in the presence of pointers and closures. Then, we present the abstract domains and the analyses under these abstract domains. We prove the correctness and termination of this abstract analysis. The results of the analyses can facilitate many applications, such as program optimization, memory management, and race detection. A graph representation of parallel programs useful for general compiler transformation is presented. Finally, implementation of this framework and its preliminary results are described.

[1]  David A. Padua,et al.  Issues in the Optimization of Parallel Programs , 1990, ICPP.

[2]  Patrice Godefroid Using Partial Orders to Improve Automatic Verification Methods , 1990, CAV.

[3]  Charles E. McDowell,et al.  Debugging concurrent programs , 1989, ACM Comput. Surv..

[4]  Jyh-Herng Chow,et al.  A General Framework for Analyzing Shared-Memory Parallel Programs , 1992, ICPP.

[5]  Barbara M. Chapman,et al.  Supercompilers for parallel and vector computers , 1990, ACM Press frontier series.

[6]  Geoffrey Livingston Burn,et al.  Abstract interpretation and the parallel evaluation of functional languages , 1987 .

[7]  Chris Hankin,et al.  Abstract Interpretation of Declarative Languages , 1987 .

[8]  Patrick Cousot,et al.  Abstract Interpretation Frameworks , 1992, J. Log. Comput..

[9]  K. Hofmann,et al.  A Compendium of Continuous Lattices , 1980 .

[10]  Stephen D. Crocker,et al.  Verification of Concurrent Systems: Function and Timing , 1982, PSTV.

[11]  Rance Cleaveland,et al.  A Semantics Based Verification Tool for Finite State Systems , 1989, PSTV.

[12]  Joseph E. Stoy,et al.  Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory , 1981 .

[13]  Anoop Gupta,et al.  Memory consistency and event ordering in scalable shared-memory multiprocessors , 1990, [1990] Proceedings. The 17th Annual International Symposium on Computer Architecture.

[14]  Edsger W. Dijkstra,et al.  A Discipline of Programming , 1976 .

[15]  David A. Padua,et al.  Event synchronization analysis for debugging parallel programs , 1989, Proceedings of the 1989 ACM/IEEE Conference on Supercomputing (Supercomputing '89).

[16]  Leslie Lamport,et al.  How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs , 2016, IEEE Transactions on Computers.

[17]  Nicolas Mercouroff,et al.  An Algorithm for Analyzing Communicating Processes , 1991, MFPS.

[18]  Flemming Nielson,et al.  Bounded fixed point iteration , 1991, POPL '92.

[19]  Patrick Cousot,et al.  Systematic design of program analysis frameworks , 1979, POPL.

[20]  François Bourdoncle,et al.  Interprocedural Abstract Interpretation of Block Structured Languages with Nested Procedures, Aliasing and Recursivity , 1990, PLILP.

[21]  Jaspal Subhlok,et al.  Static analysis of low-level synchronization , 1988, PADD '88.

[22]  Gilles Kahn,et al.  Natural Semantics , 1987, STACS.

[23]  Dennis Shasha,et al.  Efficient and correct execution of parallel programs that share memory , 1988, TOPL.

[24]  Alexandru Nicolau,et al.  Parallelizing Programs with Recursive Data Structures , 1989, IEEE Trans. Parallel Distributed Syst..

[25]  Phil Pfeiffer,et al.  Dependence analysis for pointer variables , 1989, PLDI '89.

[26]  Kwangkeun Yi,et al.  Efficient computation of fixpoints that arise in complex program analysis , 1995, J. Program. Lang..

[27]  Jayadev Misra Axioms for Memory Access in Asynchronous Hardware Systems , 1984, Seminar on Concurrency.

[28]  James R. Larus,et al.  Restructuring Lisp programs for concurrent execution , 1988, PPEALS '88.

[29]  Jong-Deok Choi,et al.  Automatic construction of sparse data flow evaluation graphs , 1991, POPL '91.

[30]  David A. Padua,et al.  Dependence graphs and compiler optimizations , 1981, POPL '81.

[31]  Alain Deutsch,et al.  On determining lifetime and aliasing of dynamically allocated data in higher-order functional specifications , 1989, POPL '90.

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

[33]  Anoop Gupta,et al.  Programming for Different Memory Consistency Models , 1992, J. Parallel Distributed Comput..

[34]  Glynn Winskel,et al.  An Introduction to Event Structures , 1989 .

[35]  Lori A. Clarke,et al.  Task interaction graphs for concurrency analysis , 1989, ICSE '89.

[36]  Carl A. Gunter,et al.  Semantic Domains and Denotational Semantics , 1989 .

[37]  Williams Ludwell Harrison,et al.  Automatic recognition of induction variables and recurrence relations by abstract interpretation , 1990, PLDI '90.

[38]  David A. Padua,et al.  Advanced compiler optimizations for supercomputers , 1986, CACM.

[39]  David A. Schmidt Denotational Semantics: A Methodology for Language Development by Phil , 1987 .

[40]  Geoffrey L. Burn,et al.  Lazy functional languages - abstract interpretation and compilation , 1991, Research monographs in parallel and distributed computing.

[41]  Antoni W. Mazurkiewicz,et al.  Trace Theory , 1986, Advances in Petri Nets.

[42]  Sanjoy Ghosh Automatic Detection of Nondeterminancy, and Scalar Optimizations in Parallel Programs , 1992 .

[43]  Dirk Grunwald,et al.  Data flow equations for explicitly parallel programs , 1993, PPOPP '93.

[44]  Williams Ludwell Harrison,et al.  A Program's Eye View of Miprac , 1992, LCPC.

[45]  Amir Pnueli The Temporal Semantics of Concurrent Programs , 1981, Theor. Comput. Sci..

[46]  Gordon Plotkin,et al.  An Operational Semantics for CSP. , 1982 .

[47]  Constantine D. Polychronopoulos,et al.  The structure of parafrase-2: an advanced parallelizing compiler for C and FORTRAN , 1990 .

[48]  Anoop Gupta,et al.  The Stanford Dash multiprocessor , 1992, Computer.

[49]  Flemming Nielson,et al.  Strictness analysis and denotational abstract interpretation , 1987, POPL '87.

[50]  Pierre America,et al.  Operational semantics of a parallel object-oriented language , 1986, POPL '86.

[51]  Susan J. Eggers,et al.  Computing Per-Process Summary Side-Effect Information , 1992, LCPC.

[52]  Ernst-Rüdiger Olderog,et al.  Contrasting Themes in the Semantics of Imperative Concurrency , 1986, Current Trends in Concurrency.

[53]  Leslie Lamport An Axiomatic Semantics of Concurrent Programming Languages , 1984, Logics and Models of Concurrent Systems.

[54]  Patrick Cousot,et al.  Semantic Analysis of Communicating Sequential Processes (Shortened Version) , 1980, ICALP.

[55]  C. A. R. Hoare,et al.  Communicating Sequential Processes (Reprint) , 1983, Commun. ACM.

[56]  Michal Young,et al.  Compositional reachability analysis using process algebra , 1991, TAV4.

[57]  Mary Lou Soffa,et al.  Concurrency analysis in the presence of procedures using a data-flow framework , 1991, TAV4.

[58]  Patrick Cousot,et al.  Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints , 1977, POPL.

[59]  Constantine D. Polychronopoulos,et al.  Symbolic Program Analysis and Optimization for Parallelizing Compilers , 1992, LCPC.

[60]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[61]  Williams Ludwell Harrison,et al.  The Design of Automatic Parallelizers for Symbolic and Numeric Programs , 1989, Workshop on Parallel Lisp.

[62]  Matthew Hennessy,et al.  Algebraic theory of processes , 1988, MIT Press series in the foundations of computing.

[63]  Ming T. Liu,et al.  Protocol validation for large-scale applications , 1992, IEEE Software.

[64]  Stephen J. Garland,et al.  Verification of VLSI Circuits Using LP , 1988 .

[65]  Ken Kennedy,et al.  Conversion of control dependence to data dependence , 1983, POPL '83.

[66]  Ron Cytron,et al.  An Overview of the PTRAN Analysis System for Multiprocessing , 1988, J. Parallel Distributed Comput..

[67]  Paul Hudak A semantic model of reference counting and its abstraction (detailed summary) , 1986, LFP '86.

[68]  Jayadev Misra,et al.  A Perspective on Parallel Program Design , 1991, Research Directions in High-Level Parallel Programming Languages.

[69]  Steve Johnson,et al.  Compiling C for vectorization, parallelization, and inline expansion , 1988, PLDI '88.

[70]  Vivek Sarkar,et al.  A Concurrent Execution Semantics for Parallel Program Graphs and Program Dependence Graphs , 1992, LCPC.

[71]  Bernhard Steffen,et al.  Compositional Minimization of Finite State Systems , 1990, CAV.

[72]  Ken Kennedy,et al.  Compile-time detection of race conditions in a parallel program , 1989, ICS '89.

[73]  Ken Kennedy,et al.  Analysis of event synchronization in a parallel programming tool , 1990, PPOPP '90.

[74]  Antti Valmari,et al.  Stubborn sets for reduced state space generation , 1991, Applications and Theory of Petri Nets.

[75]  Dana S. Scott,et al.  Some Domain Theory and Denotational Semantics in Coq , 2009, TPHOLs.

[76]  Flemming Nielson,et al.  Finiteness conditions for fixed point iteration , 1992, LFP '92.

[77]  Richard J. Lipton,et al.  Reduction: a method of proving properties of parallel programs , 1975, CACM.

[78]  Gul A. Agha,et al.  ACTORS - a model of concurrent computation in distributed systems , 1985, MIT Press series in artificial intelligence.

[79]  K. Mani Chandy,et al.  Parallel program design - a foundation , 1988 .

[80]  Mads Rosendahl,et al.  Automatic complexity analysis , 1989, FPCA.

[81]  Richard N. Taylor,et al.  Anomaly Detection in Concurrent Software by Static Data Flow Analysis , 1980, IEEE Transactions on Software Engineering.

[82]  Williams Ludwell Harrison,et al.  The interprocedural analysis and automatic parallelization of Scheme programs , 1990, LISP Symb. Comput..

[83]  Daniel Le Métayer,et al.  Computer-Time Garbage Collection by Sharing Analysis , 1989, FPCA.

[84]  STEPHEN RICHARDSON,et al.  Interprocedural optimization: Experimental results , 1989, Softw. Pract. Exp..

[85]  Vincent A. Guarna,et al.  A Technique for Analyzing Pointer and Structure References In Parallel Restructuring Compilers , 1988, ICPP.

[86]  Gordon D. Plotkin,et al.  A Powerdomain Construction , 1976, SIAM J. Comput..

[87]  J. W. de Bakker,et al.  Processes and the Denotational Semantics of Concurrency , 1982, Inf. Control..

[88]  Glynn Winskel,et al.  Models for Concurrency , 1994 .

[89]  Jyh-Herng Chow,et al.  Compile-time analysis of parallel programs that share memory , 1992, POPL '92.

[90]  Chris Hankin,et al.  The theory and practice of strictness analysis for higher order functions , 1985 .

[91]  Guy L. Steele,et al.  Making asynchronous parallelism safe for the world , 1989, POPL '90.

[92]  Jayadev Misra Loosely-Coupled Processes , 1991, PARLE.

[93]  Samuel P. Midkiff,et al.  Compiling programs with user parallelism , 1990 .

[94]  Patrick Cousot,et al.  Invariance proof methods and analysis techniques for parallel programs , 1984 .

[95]  Leslie Lamport,et al.  Proving the Correctness of Multiprocess Programs , 1977, IEEE Transactions on Software Engineering.

[96]  Glynn Winskel,et al.  An introduction to event structures , 1988, REX Workshop.

[97]  Peter D. Mosses,et al.  Denotational semantics , 1995, LICS 1995.

[98]  Ken Kennedy,et al.  Automatic translation of FORTRAN programs to vector form , 1987, TOPL.

[99]  Barton P. Miller,et al.  What are race conditions?: Some issues and formalizations , 1992, LOPL.

[100]  Charles E. McDowell,et al.  A Practical Algorithm for Static Analysis of Parallel Programs , 1989, J. Parallel Distributed Comput..

[101]  Michael Wolfe,et al.  Analyzing Programs with Explicit Parallelism , 1991, LCPC.

[102]  Amir Pnueli,et al.  Applications of Temporal Logic to the Specification and Verification of Reactive Systems: A Survey of Current Trends , 1986, Current Trends in Concurrency.

[103]  Richard N. Taylor,et al.  A general-purpose algorithm for analyzing concurrent programs , 1983, CACM.