Daniele Cono D'Elia edited intro.tex  over 8 years ago

Commit id: 02948a0b9c900518f48a844253d6ec351a54ec9a

deletions | additions      

       

  In a 2013 paper Lameed and Hendren propose McOSR~\cite{lameed2013modular}, a technique for OSR that essentially stores the live values in a global buffer, recompiles the current function and then loads in it the saved state when the execution is resumed. Their approach shows a few limitations that we discuss later in this paper, and because of some relevant design choices it can work only with the legacy JIT which has been dropped from recent LLVM releases.  In this paper we present our novel, platform-independent framework for LLVM to enable switching between different versions of a function at run-time. Specific goals include: \begin{itemize}  \item The ability for a function reached via OSR to fire an OSR itself: this would allow switching from a base function $f_0$ to an optimized function $f_1$, and later on to a further optimized version $f_2$, etc.  \item Supporting deoptimization, i.e., transitions from an optimized function to a less optimized function from which it was derived.  \item Supporting transitions at arbitrary locations within a function.  \item Supporting OSR targets either generated at run-time (e.g., using profiling compilation) or already known at compilation time.  \item Hiding from the front-end that generates the different optimized versions of a function all the implementation details of how on-the-fly transitions between them are handled at specific OSR points.  \end{itemize}  Design goals of our implementation include:  \begin{itemize}  \item Supporting OSR transitions in terms of instrumentation of pure IR code only, avoiding manipulations at machine-code level.  \item Incurring a minimal level of intrusiveness in terms of both the instrumentation of the code generated by the front-end and the degree of optimization opportunities influenced by the presence of OSR points.  \item Relying on LLVM's compilation pipeline to generate the most efficient native code for an instrumented function.  \item Providing support for the redirection of future invocations of a function to the latest compiled version without recompiling the callers or performing linking again.  \end{itemize}