Correctness of Speculative Optimizations with Dynamic Deoptimization

11/08/2017
by   Olivier Flückiger, et al.
0

High-performance dynamic language implementations make heavy use of speculative optimizations to achieve speeds close to statically compiled languages. These optimizations are typically performed by a just-in-time compiler that generates code under a set of assumptions about the state of the program and its environment. In certain cases, a program may execute code compiled under assumptions that are no longer valid. The implementation must then deoptimize the program on-the-fly; this entails finding semantically equivalent code that does not rely on invalid assumptions, translating program state to that expected by the target code, and transferring control. This paper looks at the interaction between optimization and deoptimization, and shows that reasoning about speculation is surprisingly easy when assumptions are made explicit in the program representation. This insight is demonstrated on a compiler intermediate representation, named , modeled after the high-level representation for a dynamic language. Traditional compiler optimizations such constant folding, dead code elimination, and function inlining are shown to be correct in the presence of assumptions. Furthermore, the paper establishes the correctness of compiler transformations specific to deoptimization: namely unrestricted deoptimization, predicate hoisting, and assume composition.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/12/2021

AI Powered Compiler Techniques for DL Code Optimization

Creating high performance implementations of deep learning primitives on...
research
09/04/2019

SATURN – Software Deobfuscation Framework Based on LLVM

The strength of obfuscated software has increased over the recent years....
research
03/04/2022

Deoptless: Speculation with Dispatched On-Stack Replacement and Specialized Continuations

Just-in-time compilation provides significant performance improvements f...
research
07/11/2019

R Melts Brains -- An IR for First-Class Environments and Lazy Effectful Arguments

The R programming language combines a number of features considered hard...
research
06/18/2023

Optimizing Stateful Dataflow with Local Rewrites

Optimizing a stateful dataflow language is a challenging task. There are...
research
02/22/2020

Modeling the Invariance of Virtual Pointers in LLVM

Devirtualization is a compiler optimization that replaces indirect (virt...
research
03/23/2021

Row-Polymorphic Types for Strategic Rewriting

We present a type system for strategy languages that express program tra...

Please sign up or login with your details

Forgot password? Click here to reset