Dear all, Just today, I heard of the existence of the LLVM project. Because of its high activity and projects, I'm quite interested in it for using it in my research. Currently, we are comparing applications/programs/benchmarks by collecting characteristics of their dynamic behavior. This is done by instrumenting the program (using ATOM on Alpha), and subsequently running the program. During the instrumented run, anything we would like to know about the dynamic behavior of the program is captured, and spit out into log files. The only drawback is that we are currently stuck to the Alpha architecture, which means we are limited in our abilities... LLVM could provide a solution to this, because the intermediar LLVM bytecode is not biased towards a particular architecture. The question is if there are tools to support the profilation of the benchmarks I'm running (i.e. SPEC CPU2000, among others). Are there any freely available instrumentator/simulator tools available for the LLVM bytecode, which, if possible, are also properly maintained? Or is there some kind of profilation already possbile, where I can start from? Any suggestions, remarks or ideas are welcome, either through replying to the mailing list or to me directly. greetings, Kenneth Hoste Phd student @ Ghent University -- Statistics are like a bikini. What they reveal is suggestive, but what they conceal is vital (Aaron Levenstein) Kenneth Hoste ELIS - Ghent University kenneth.hoste at elis.ugent.be http://www.elis.ugent.be/~kehoste
On Wed, 12 Jul 2006, Kenneth Hoste wrote:> Just today, I heard of the existence of the LLVM project. Because of its high > activity and projects, I'm quite interested in it for using it in my > research. > Currently, we are comparing applications/programs/benchmarks by collecting > characteristics of their dynamic behavior. This is done by instrumenting the > program (using ATOM on Alpha), and subsequently running the program. During > the instrumented run, anything we would like to know about the dynamic > behavior of the program is captured, and spit out into log files.ok.> The only drawback is that we are currently stuck to the Alpha architecture, > which means we are limited in our abilities... LLVM could provide a solution > to this, because the intermediar LLVM bytecode is not biased towards a > particular architecture.Right.> The question is if there are tools to support the > profilation of the benchmarks I'm running (i.e. SPEC CPU2000, among others).Yes. :)> Are there any freely available instrumentator/simulator tools available for > the LLVM bytecode, which, if possible, are also properly maintained? Or is > there some kind of profilation already possbile, where I can start from?There are two ways to do this. The first is to instrument the LLVM interpreter. This is a matter of hacking on the functions in lib/ExecutionEngine/Interpreter/Execution.cpp, and is very easy. The other approach is to write an llvm-to-llvm instrumentation pass that inserts code which dynamically computes (and logs) the properties you're interested in. This is how our profile information works, for example. Hacking on the interpreter is easy, but has several drawbacks. In particular, the interpreter is very slow (even compared to other interpreters) and it is missing functionality: you cannot call arbitrary external functions, which causes many programs to fail in it. OTOH, writing an llvm-to-llvm transformation has many advantages: we have plenty of robust infrastructure for doing such a thing, many people use this, you can use any code generator you like with it (JIT, static compiler, or C backend), and you can even use LLVM optimizations to reduce the cost of your instrumentation. -Chris -- http://nondot.org/sabre/ http://llvm.org/
Chris Lattner wrote:> Hacking on the interpreter is easy, but has several drawbacks. In > particular, the interpreter is very slow (even compared to other > interpreters) and it is missing functionality: you cannot call arbitrary > external functions, which causes many programs to fail in it.What do you mean by external functions? I only need to print stuff to file, the measuring of the characteristics should be pretty easy I think.> OTOH, writing an llvm-to-llvm transformation has many advantages: we > have plenty of robust infrastructure for doing such a thing, many people > use this, you can use any code generator you like with it (JIT, static > compiler, or C backend), and you can even use LLVM optimizations to > reduce the cost of your instrumentation.Is there some kind of tutorial on this? Or an example program or something? This sounds quite interesting... Kenneth -- Statistics are like a bikini. What they reveal is suggestive, but what they conceal is vital (Aaron Levenstein) Kenneth Hoste ELIS - Ghent University kenneth.hoste at elis.ugent.be http://www.elis.ugent.be/~kehoste