A compiler for multiple memory models

The design of consistency models for both hardware and software is a difficult task. For a programming language, it is particularly difficult because the target audience for a high‐level programming language is much wider than the target audience for a machine language, making usability a more important criterion. Exacerbating this problem is the reality that the programming language community has little experience designing programming language consistency models, and therefore each new attempt is very much a voyage into uncharted territory. A concrete example of the difficulties of the task is the current Java Memory Model. Although designed to be easy to use by Java programmers, it is poorly understood and at least one common idiom (the ‘double check idiom’) to exploit the model is unsafe. In this paper, we describe the design of an optimizing Java compiler that will accept either as input or as an interface implementation a consistency model for the code to be compiled. The compiler will use Shasha and Snir's delay set analysis, and our CSSA program representation to provide a canonical representation for the effects of different consistency models on optimizations and analysis. The compiler will serve as a testbed to prototype new memory models, and to measure the effects of different memory models on program performance. Copyright © 2004 John Wiley & Sons, Ltd.

[1]  David A. Padua,et al.  Concurrent Static Single Assignment Form and Constant Propagation for Explicitly Parallel Programs , 1997, LCPC.

[2]  Katherine A. Yelick,et al.  Analyses and Optimizations for Shared Address Space Programs , 1996, J. Parallel Distributed Comput..

[3]  CallahanDavid,et al.  Static analysis of low-level synchronization , 1988 .

[4]  Keith D. Cooper,et al.  Value-driven redundancy elimination , 1996 .

[5]  Dirk Grunwald,et al.  An Efficient Construction of Parallel Static Single Assignment Form for Structured Parallel Programs , 1991 .

[6]  Sarita V. Adve,et al.  Shared Memory Consistency Models: A Tutorial , 1996, Computer.

[7]  Katherine A. Yelick,et al.  Optimizing Parallel SPMD Programs , 1994, LCPC.

[8]  Mark D. Hill,et al.  Multiprocessors Should Support Simple Memory-Consistency Models , 1998, Computer.

[9]  Mark D. Hill,et al.  Retrospective: weak ordering—a new definition , 1998, ISCA '98.

[10]  Samuel P. Midkiff,et al.  Dependence Analysis in Parallel Loops with i±k Subscripts , 1995, LCPC.

[11]  Martin C. Rinard,et al.  Pointer analysis for multithreaded programs , 1999, PLDI '99.

[12]  David A. Padua,et al.  A Constant Propagation Algorithm for Explicitly Parallel Programs , 2004, International Journal of Parallel Programming.

[13]  Jaejin Lee,et al.  Compilation techniques for explicitly parallel programs , 1999 .

[14]  Jong-Deok Choi,et al.  Escape analysis for Java , 1999, OOPSLA '99.

[15]  Keith D. Cooper,et al.  SCC-Based Value Numbering , 1995 .

[16]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[17]  Stephen J. Fink,et al.  The Jalapeño virtual machine , 2000, IBM Syst. J..

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

[19]  Alan L. Cox,et al.  TreadMarks: shared memory computing on networks of workstations , 1996 .

[20]  James Hook,et al.  Static single assignment for explicitly parallel programs , 1993, POPL '93.

[21]  Steven S. Muchnick,et al.  Advanced Compiler Design and Implementation , 1997 .

[22]  Bowen Alpern,et al.  Detecting equality of variables in programs , 1988, POPL '88.

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

[24]  Katherine A. Yelick,et al.  Optimizing parallel programs with explicit synchronization , 1995, PLDI '95.

[25]  Liwu Li,et al.  The Java Language , 1998 .

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

[27]  Mark N. Wegman,et al.  Efficiently computing static single assignment form and the control dependence graph , 1991, TOPL.

[28]  ShashaDennis,et al.  Efficient and correct execution of parallel programs that share memory , 1988 .

[29]  David A. Padua,et al.  Basic compiler algorithms for parallel programs , 1999, PPoPP '99.

[30]  George S. Avrunin,et al.  An efficient algorithm for computing MHP information for concurrent Java programs , 1999, ESEC/FSE-7.

[31]  William Pugh Fixing the Java memory model , 1999, JAVA '99.

[32]  Bernhard Steffen,et al.  Code motion for explicitly parallel programs , 1999, PPoPP '99.