On-Stack Replacement à la Carte

08/08/2017
by   Daniele Cono D'Elia, et al.
0

On-stack replacement (OSR) dynamically transfers execution between different code versions. This mechanism is used in mainstream runtime systems to support adaptive and speculative optimizations by running code tailored to provide the best expected performance for the actual workload. Current approaches either restrict the program points where OSR can be fired or require complex optimization-specific operations to realign the program's state during a transition. The engineering effort to implement OSR and the lack of abstractions make it rarely accessible to the research community, leaving fundamental question regarding its flexibility largely unexplored. In this article we make a first step towards a provably sound abstract framework for OSR. We show that compiler optimizations can be made OSR-aware in isolation, and then safely composed. We identify a class of transformations, which we call live-variable equivalent (LVE), that captures a natural property of fundamental compiler optimizations, and devise an algorithm to automatically generate the OSR machinery required for an LVE transition at arbitrary program locations. We present an implementation of our ideas in LLVM and evaluate it against prominent benchmarks, showing that bidirectional OSR transitions are possible almost everywhere in the code in the presence of common, unhindered global optimizations. We then discuss the end-to-end utility of our techniques in source-level debugging of optimized code, showing how our algorithms can provide novel building blocks for debuggers for both executables and managed runtimes.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
06/03/2021

Homeostasis: Design and Implementation of a Self-Stabilizing Compiler

Mainstream compilers perform a multitude of analyses and optimizations o...
research
03/04/2022

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

Just-in-time compilation provides significant performance improvements f...
research
09/19/2019

Supporting On-Stack Replacement in Unstructured Languages by Loop Reconstruction and Extraction

On-stack replacement (OSR) is a common technique employed by dynamic com...
research
08/24/2017

Towards Evaluating Size Reduction Techniques for Software Model Checking

Formal verification techniques are widely used for detecting design flaw...
research
11/17/2022

Where Did My Variable Go? Poking Holes in Incomplete Debug Information

The availability of debug information for optimized executables can larg...
research
05/02/2022

LoopStack: a Lightweight Tensor Algebra Compiler Stack

We present LoopStack, a domain specific compiler stack for tensor operat...
research
07/01/2022

HyperTensioN and Total-order Forward Decomposition optimizations

Hierarchical Task Networks (HTN) planners generate plans using a decompo...

Please sign up or login with your details

Forgot password? Click here to reset