dcdelia  over 8 years ago

Commit id: 0605e4ee72cf3ffe93cd7d8983ad12ad73acf761

deletions | additions      

       

\subsubsection{Session 1: OSR instrumentation in \osrkit}  \tinyvm\ implements a code generator for open OSR points that can dynamically inline a method whose address cannot be determined when the calling function is compiled. In the example from \myfigure\ref{fi:isord-example}, a comparator function {\tt c} is passed as argument to function {\tt isord}, which checks whether an array {\tt v}of {\tt long}  is ordered according to the criterion encoded in {\tt c}. To interactively reproduce the experiment presented in \mysection\ref{se:osr-llvm}, we provide under the folder {\small\tt tinyvm/isord} a C driver {\small\tt inline.c} with an LLVM IR counterpart {\small\tt inline.ll} (generated with {\small\tt clang -S -emit-llvm -O1 inline.c}). 

\end{verbatim}  \end{small}  \noindent A $\phi$-node {\tt \%i.01} is used to represent the index of the C {\tt for} loop, and is set to {\tt \%10} when reached from the loop header (basic block {\tt \%2}) {\em after} a loop iteration. In fact, as a result of {\small \tt -O1} optimizations, with {\tt n>1} execution jumps from the function entrypoint {\tt \%0} directly into the loop body, initializing the $\phi$-node with {\tt 1}. Comparator {\tt c} is invoked with a tail call, storing its return value into virtual register {\tt \%8}.  %In a usage scenario in which input arrays are large, we might want to perform dynamic inlining as early as possible. We can thus insert