[LLVMdev] RDPMC inst use in llvm
John Criswell
criswell at illinois.edu
Fri Jun 20 14:43:25 PDT 2014
On 6/20/14, 4:31 PM, sathvik wrote:
> Hi John,
>
> I don't think its possible to add/insert an inline assembly into the
> LLVM IR unless the IR interface provides some kind of stream writer
> into which inline instructions can be written into.
The LLVM IR supports inline assembly instructions. See the Language
Reference Manual and the doxygen information on the llvm::InlineAsm class.
>
> I was thinking having an LLVM intrinsic function could be a first step
> towards introducing PMU tool support in LLVM with which you can
> generate code with built-in instrumentation. What do you think ?
If you wanted to build a processor-independent tool to collect the
information that RDPMC provides, then I think an intrinsic would be the
way to go. However, that might be a greater goal than what you
currently need. It certainly seems like a difficult issue to make them
portable given how different PMCs are across different Intel processors.
Regards,
John Criswell
>
> Sathvik
>
>
>
>
>
>
> On Fri, Jun 20, 2014 at 8:21 AM, John Criswell <criswell at illinois.edu
> <mailto:criswell at illinois.edu>> wrote:
>
> On 6/19/14, 7:12 PM, sathvik wrote:
>> I want to measure the performance of a JITed code snippet on MCJIT.
>> so I was planning to inject the RDPMC inst for the code generated
>> through a llvm IR builder.
>
> I assume the easier way to do this is to add an inline assembly
> call that uses the RDPMC instruction. I don't think there's an
> LLVM IR intrinsic function that does it.
>
> Regards,
>
> John Criswell
>
>>
>> Is there a patch available ? If there's a better way to do it
>> please chime in.
>>
>> Thanks
>> sathvik
>>
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu> http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140620/5d8024df/attachment.html>
More information about the llvm-dev
mailing list