A Theory of Speculative Computation

We propose a formal definition for (valid) speculative computations, which is independent of any implementation technique. By speculative computations we mean optimization mechanisms that rely on relaxing the flow of execution in a given program, and on guessing the values read from pointers in the memory. Our framework for formalizing these computations is the standard operational one that is used to describe the semantics of programming languages. In particular, we introduce speculation contexts, that generalize classical evaluation contexts, and allow us to deal with out of order computations. Regarding concurrent programs, we show that the standard DRF guarantee, asserting that data race free programs are correctly implemented in a relaxed semantics, fails with speculative computations, but that a similar guarantee holds for programs that are free of data races in the speculative semantics.

[1]  David Aspinall Java Memory Model Examples: Good, Bad and Ugly , 2007 .

[2]  F. Warren Burton,et al.  Speculative computation, parallelism, and functional programming , 1985, IEEE Transactions on Computers.

[3]  James E. Smith,et al.  A study of branch prediction strategies , 1981, ISCA '98.

[4]  Robert H. Halstead,et al.  MULTILISP: a language for concurrent symbolic computation , 1985, TOPL.

[5]  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.

[6]  Suresh Jagannathan,et al.  Safe futures for Java , 2005, OOPSLA '05.

[7]  David Aspinall,et al.  On Validity of Program Transformations in the Java Memory Model , 2008, ECOOP.

[8]  Gérard Boudol,et al.  Relaxed memory models: an operational approach , 2009, POPL '09.

[9]  BoudolGérard,et al.  Relaxed memory models , 2009 .

[10]  Tom Ridge,et al.  The semantics of x86-CC multiprocessor machine code , 2009, POPL '09.

[11]  Jeremy Manson,et al.  The Java memory model , 2005, POPL '05.

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

[13]  SewellPeter,et al.  The semantics of x86-CC multiprocessor machine code , 2009 .

[14]  Thomas F. Knight An architecture for mostly functional languages , 1986, LFP '86.

[15]  Luc Moreau,et al.  The semantics of Scheme with future , 1996, ICFP '96.

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

[17]  Matthias Felleisen,et al.  Control operators, the SECD-machine, and the λ-calculus , 1987, Formal Description of Programming Concepts.

[18]  Avi Mendelson,et al.  Using value prediction to increase the power of speculative execution hardware , 1998, TOCS.

[19]  Mark D. Hill,et al.  Weak ordering—a new definition , 1998, ISCA '98.

[20]  Jan Vitek,et al.  ECOOP 2008 - Object-Oriented Programming, 22nd European Conference, Paphos, Cyprus, July 7-11, 2008, Proceedings , 2008, ECOOP.

[21]  Farhad Arbab,et al.  Coordination Models and Languages , 1998, Adv. Comput..

[22]  Armand Navabi,et al.  Exceptionally Safe Futures , 2009, COORDINATION.

[23]  Daniel Weise,et al.  Continuing Into the Future: On the Interaction of Futures and First-Class Continuations , 1989, Workshop on Parallel Lisp.

[24]  James Gosling,et al.  The Java Language Specification, 3rd Edition , 2005 .

[25]  Guy L. Steele,et al.  Java(TM) Language Specification, The (3rd Edition) (Java (Addison-Wesley)) , 2005 .

[26]  Matthias Felleisen,et al.  The semantics of future and its use in program optimization , 1995, POPL '95.

[27]  G Boudol Computational semantics of term rewriting systems , 1986 .

[28]  HennessyJohn,et al.  Memory consistency and event ordering in scalable shared-memory multiprocessors , 1990 .

[29]  J. Roger Hindley,et al.  To H.B. Curry: Essays on Combinatory Logic, Lambda Calculus, and Formalism , 1980 .

[30]  Jean-Jacques Lévy,et al.  Minimal and Optimal Computations of Recursive Programs , 1979, J. ACM.

[31]  Mikko H. Lipasti,et al.  Correctly implementing value prediction in microprocessors that support multithreading or multiprocessing , 2001, MICRO.

[32]  Radha Jagadeesan,et al.  A theory of memory models , 2007, PPOPP.

[33]  Mikko H. Lipasti,et al.  Value locality and load value prediction , 1996, ASPLOS VII.

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

[35]  Erich J. Neuhold,et al.  Formal description of programming concepts , 1991 .

[36]  Hans-Juergen Boehm,et al.  Foundations of the C++ concurrency memory model , 2008, PLDI '08.

[37]  V AdveSarita,et al.  Weak orderinga new definition , 1990 .

[38]  Anoop Gupta,et al.  Memory consistency and event ordering in scalable shared-memory multiprocessors , 1990, ISCA '90.