Camil Demetrescu edited osr-llvm.tex  over 8 years ago

Commit id: fa3571046c3359f53284da7576674408105374c1

deletions | additions      

       

\fi  %\subsection{Example}  In this section we discuss how to implement the OSR approach of \mysection\ref{se:overview} in LLVM. Our discussion is based on a simple example that illustrates a profile-driven optimization scenario. The IR code shown in this section has been generated with \osrkit, We start from a simple base function ({\tt isord}) that checks whether  an LLVM-based library we prototyped array of numbers is ordered according  to support VM builders with some criterion specified by  a set comparator, as shown in \myfigure\ref{fi:isord-example}. Our goal is to instrument {\tt isort} so that, whenever the number  of abstractions for OSR instrumentation iterations  of IR code. {\tt isord} exceeds a certain threshold, control is dynamically diverted to a faster version generated on the fly by inlining the comparator.  The example we consider is a simple base function {\tt isord} that checks whether an array of numbers is ordered according to some criterion specified by a comparator, as IR code  shown in \myfigure\ref{fi:isord-example}. Our goal is this section has been generated with \osrkit, an LLVM-based library we designed  to instrument {\tt isort} so that, whenever the number support VM builders with a set  of iterations abstractions for OSR instrumentation  of {\tt isord} exceeds a certain threshold, control IR code\ifnoauthorea{\footnote{\osrkit\  is dynamically diverted to a faster version generated on the fly by inlining included in  the comparator. accompanying artifact.}}.  %To explain how the OSR approach of \mysection\ref{se:overview} can be implemented in LLVM, we consider the simple example of \myfigure\ref{fi:isord-example}. Function {\tt isord} checks whether an array of numbers is ordered according to some criterion specified by a comparator.