Skip to Main content Skip to Navigation
New interface
Reports (Research report)

A Static-Dynamic Collaborative Framework for Nested Loops Instrumentation and Profiling

Alexandra Jimborean 1, 2, * Matthieu Herrmann 1, 2 Vincent Loechner 1, 2 Philippe Clauss 1, 2 
* Corresponding author
1 CAMUS - Compilation pour les Architectures MUlti-coeurS
LSIIT - Laboratoire des Sciences de l'Image, de l'Informatique et de la Télédétection, Inria Nancy - Grand Est
Abstract : Runtime information extraction is usually achieved using some code instrumentations, where additional instructions are inserted in order to collect relevant values as accessed memory locations, reached variable values or taken branches. In order to minimize the time overhead, a usual strategy is to run instrumented code exclusively during some execution time samples. Hence an intended dynamic mechanism has to provide a way to alternate quickly between instrumented and non-instrumented code, without altering the code semantics. Since loop nests usually represent a major part of the whole execution time of programs, they are important optimization targets. Obviously, since their statements are run many times, the time overhead induced from instrumentation is even more difficult to minimize. In this paper, we present a static-dynamic collaborative framework dedicated to nested loops. Its goal is to catch some linearity of the performed memory accesses and of the loop trip counts, serving as a launching point for further optimizations as data prefetching or speculative parallelization. Interesting cases in instrumentation are revealed by indirect memory accesses or pointer arithmetic based accesses, as they cannot be determined statically. Our framework introduces a new pragma inserted in the higher level source code and delimiting the regions for instrumentation. Next, it extends the LLVM compiler to process the marked regions and statically create an instrumented version of the code. For a minimal time overhead, we use a sampling strategy where we instrument the first iterations of each loop of the considered nest. At runtime, the executions of instrumented and non-instrumented versions alternate, thanks to a runtime system which guides the execution flow by patching the binary code. Based on the acquired information related to accessed memory addresses and loop trip counts, the runtime system interpolates on the loop indices to identify linear functions.
Document type :
Reports (Research report)
Complete list of metadata
Contributor : Vincent Loechner Connect in order to contact the contributor
Submitted on : Wednesday, November 10, 2010 - 2:08:32 PM
Last modification on : Wednesday, October 26, 2022 - 8:16:20 AM


  • HAL Id : inria-00534745, version 1



Alexandra Jimborean, Matthieu Herrmann, Vincent Loechner, Philippe Clauss. A Static-Dynamic Collaborative Framework for Nested Loops Instrumentation and Profiling. [Research Report] 2010, pp.8. ⟨inria-00534745⟩



Record views