Ketan Pundlik Umare wrote:
Than a lot John!!!!
That was great, i wanted to read the performance counter, but was always afraid how llvm would react (virtual machine)
Reading the performance counters should be fine. The tricky part is how fine-grained you want the information to be and whether you'll need kernel support to do what you want to do. If you want to limit the performance counters to just events caused by the current process, you'll need OS support to virtualize the performance counter registers. The perfctr patch to Linux (listed on the resource page of the URL I sent you) does that for Intel/AMD processors.
Thanx for the resource i ll go through it.
i think i read somewhere that llvm doesnot support assembly instructions???
That used to be true a long time ago, but it is no longer true. LLVM supports inline assembly. However, you may run into bugs or missing features with inline assembly if you use an inline assembly feature that isn't used often. If that happens, please file a bug report.
Also can you redirect me to run-time transforms for llvm, where can i find the material. I thought that the transfor pass is done on the IR only and it is static??? Please correct my thinking.
AFAIK, an LLVM transform can be done anytime you have LLVM IR for a program. With the JIT infrastructure in LLVM, I believe you can run an LLVM pass on the IR, generate native code from the IR, get performance numbers, transform the LLVM IR again, and re-generate the native code again. IIRC, regeneration of native code is done at function granularity, and all callers are updated to call the new code.
I'm not very familiar with the JIT classes in LLVM, but I believe you want to look at the ExecutionEngine class and the source code for lli (the basic LLVM JIT command line tool) and the libraries it uses.
Can others more familiar with the LLVM JIT infrastructure provide more information?
-- John T.