[LLVMdev] profile.pl
John Criswell
criswell at cs.uiuc.edu
Tue Aug 9 16:46:35 PDT 2011
On 8/7/11 2:41 AM, neda 8664 wrote:
> i could not use profile.pl <http://profile.pl>, however i did
> reinstall the llvm but didn't solve my problem. is there is another
> way to extract profilling information in llvm?
First, I believe that profile.pl is just a script that automates the
profiling process. You should be able to do whatever it is that the
script is doing (assuming that the profiling code in LLVM is currently
well-maintained, which I suspect it is).
Second, what do you mean by "reinstalling LLVM?" Did you just rebuild
it? Did you do a "make install?" If you did a "make install", what was
the option to the --prefix= option on the configure command line?
Are you getting the same error now, or are you getting a different error?
Third, did you try my earlier suggestion of just changing profile.pl to
look for the profile_rt.so file elsewhere? I believe the necessary line
of code is line 68 of profile.pl (from mainline LLVM). If you tried it,
did it not work? If it didn't work, what error did you get?
> i have another question, i want know how can estimate execution time
> for each operand such as mul ,add, ... ?
I don't know of an analysis that does this within LLVM. I would think
that this is less-than-straightfoward due to instruction folding (e.g.,
merging a GEP and a load into a single x86 indexed mov instruction) and
other machine-code specific optimizations.
That said, if you just need to have relative differences in execution,
you could probably write a very simple analysis that generates a rough
estimate. For example, fadd is probably much more expensive than add on
any system. Call instructions with more arguments probably cost more
than calls with less arguments, etc.
Another route might be to write such an analysis as a
MachineFunctionPass. That way, I think you can see individual machine
instruction that were actually generated and get a better estimate.
I just don't know how accurate it'd be or what level of accuracy you need.
-- John T.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110809/79cd3801/attachment.html>
More information about the llvm-dev
mailing list