[LLVMdev] perf tool support in MCJIT

Kaylor, Andrew andrew.kaylor at intel.com
Thu May 29 12:39:38 PDT 2014


That’s a good question.  There’s a TargetOption named JITEmitDebugInfo but I’m not sure it actually does anything.

If you are starting with a bitcode file, you can get the debug information embedded in the bitcode using the usual command line options.  (See for example, http://llvm.org/docs/DebuggingJITedCode.html).

In general, if the code generation options are set to generate debug information that information will find its way into DWARF format with MCJIT.

If you want the debug information mapped to the IR, there’s code in the lli tool that demonstrates how to do that (using lli’s ‘debug-ir’ command line option).

-Andy


From: sathvik [mailto:sathvikl at gmail.com]
Sent: Tuesday, May 27, 2014 3:30 PM
To: Kaylor, Andrew
Cc: llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] perf tool support in MCJIT

Hi Andrew,

Thanks for the pointer. I have tried the OProfileJIT agent in LLVM and it works fine. Its good to know that the VTune agent has been fixed to work with MCJIT. Do you have any pointers on how to generate the DWARF based output in LLVM which VTune would be able to use.

Thanks
-sathvik

On Thu, May 22, 2014 at 1:31 PM, Kaylor, Andrew <andrew.kaylor at intel.com<mailto:andrew.kaylor at intel.com>> wrote:
I think you can profile code generated with MCJIT using either oprofile or Intel® VTune™ Amplifier XE, but you need to do a special build of LLVM to enable it.  If you want to enable another performance tool, you can look at the code in lib/ExecutionEngine/OProfileJIT or lib/ExecutionEngine/IntelJITEvents to get an idea of how to do it.  The IntelJITEvents implementation is a bit more complete, in that it makes use of generated DWARF information if it is available.

Speaking of DWARF information, Daniel Malea wrote a pass called DebugIR that if I recall correctly writes an IR file to disc and associates debug information with it as if that were the source file.  You should be able to make that work with any DWARF-based tool to analyze the generated code.

-Andy

From: llvmdev-bounces at cs.uiuc.edu<mailto:llvmdev-bounces at cs.uiuc.edu> [mailto:llvmdev-bounces at cs.uiuc.edu<mailto:llvmdev-bounces at cs.uiuc.edu>] On Behalf Of sathvik
Sent: Wednesday, May 21, 2014 6:20 PM
To: llvmdev at cs.uiuc.edu<mailto:llvmdev at cs.uiuc.edu>
Subject: [LLVMdev] perf tool support in MCJIT

I believe the perf tool cannot profile/analyze the JITed code in MCJIT model.

Can you please confirm this ? I was working on a patch to fix this.

Another question, is the there any support to map the llvm IR with x86 generated assembly ? so its easier to analyze the code generator.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140529/23bf7c98/attachment.html>


More information about the llvm-dev mailing list