<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri, sans-serif" size="2">
<div>Our project runs LLVM in a JIT context, and we want to explore where the time is being spent in the various LLVM components.  At the moment, we’re running with a production version of 3.0, and expecting to upgrade to 3.1 soon.  We noticed that clang and
llc can display component timing using the –ftime-passes and –time-passes options respectively.  A little poking around in the code revealed that the timers are started by setting the variable “TimePassesIsEnabled” to true – that’s how the command line processing
code does it.  </div>
<div> </div>
<div>However, setting this variable in the JIT context fails to elicit the timer information coming out on stderr.  :-(</div>
<div> </div>
<div>Earlier, I implemented an optional statistics display using calls to “EnableStatistics()” and “PrintStatistics()” at appropriate places in the JIT environment.  This uses the same output file control mechanism as the timing info, and works fine.  The difference
is that the “PrintStatistics()” function is global – it knows about all the statistics being kept.   The output to stderr works fine.  </div>
<div> </div>
<div>The equivalent printing control for the timing info is, however, bound to the TimerGroup class implemented in Support/Timer.h, .cpp.   The relevant TimerGroup structures are static to the modules that define them, so there is no possibility of forcing
the printing, like I can do with Statistics.  :-(</div>
<div> </div>
<div>I haven’t yet resorted to debugging LLVM in the JIT context to figure out what’s going wrong, and I haven’t had good luck with this approach in the past, so if anyone has a clue what I’m doing wrong, I’d appreciate hearing from you.  Thanks in advance,</div>
<div>        -Kevin Harris</div>
<div>        Unisys</div>
<div> </div>
</font>
</body>
</html>